@burdenoff/microfe-cosmicintersection 2026.1109.7 → 2026.1110.2

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 (346) hide show
  1. package/dist/cosmicintersection/CosmicIntersectionRoot.d.ts +0 -1
  2. package/dist/cosmicintersection/CosmicIntersectionRoot.js +1 -2
  3. package/dist/cosmicintersection/CosmicIntersectionRoot.js.map +1 -1
  4. package/dist/cosmicintersection/CosmicIntersectionRoutes.d.ts +0 -1
  5. package/dist/cosmicintersection/CosmicIntersectionRoutes.js +36 -33
  6. package/dist/cosmicintersection/CosmicIntersectionRoutes.js.map +1 -1
  7. package/dist/cosmicintersection/api/cosmicApi.d.ts +86 -1
  8. package/dist/cosmicintersection/api/cosmicApi.js +70 -14
  9. package/dist/cosmicintersection/api/cosmicApi.js.map +1 -1
  10. package/dist/cosmicintersection/api/databricksTransport.d.ts +0 -1
  11. package/dist/cosmicintersection/api/databricksTransport.js +1 -2
  12. package/dist/cosmicintersection/api/databricksTransport.js.map +1 -1
  13. package/dist/cosmicintersection/api/tagsApi.d.ts +0 -1
  14. package/dist/cosmicintersection/api/tagsApi.js +1 -2
  15. package/dist/cosmicintersection/api/tagsApi.js.map +1 -1
  16. package/dist/cosmicintersection/components/ActionMenu.d.ts +0 -1
  17. package/dist/cosmicintersection/components/ActionMenu.js +1 -2
  18. package/dist/cosmicintersection/components/ActionMenu.js.map +1 -1
  19. package/dist/cosmicintersection/components/ActivityFeedPanel.d.ts +0 -1
  20. package/dist/cosmicintersection/components/ActivityFeedPanel.js +27 -25
  21. package/dist/cosmicintersection/components/ActivityFeedPanel.js.map +1 -1
  22. package/dist/cosmicintersection/components/AiRunAttribution.d.ts +0 -1
  23. package/dist/cosmicintersection/components/AiRunAttribution.js +1 -2
  24. package/dist/cosmicintersection/components/AiRunAttribution.js.map +1 -1
  25. package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts +0 -1
  26. package/dist/cosmicintersection/components/DatabricksQueueForm.js +1 -2
  27. package/dist/cosmicintersection/components/DatabricksQueueForm.js.map +1 -1
  28. package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts +0 -1
  29. package/dist/cosmicintersection/components/DatabricksRunPanel.js +1 -2
  30. package/dist/cosmicintersection/components/DatabricksRunPanel.js.map +1 -1
  31. package/dist/cosmicintersection/components/DiscussionPanel.d.ts +0 -1
  32. package/dist/cosmicintersection/components/DiscussionPanel.js +4 -4
  33. package/dist/cosmicintersection/components/DiscussionPanel.js.map +1 -1
  34. package/dist/cosmicintersection/components/EmptyState.d.ts +0 -1
  35. package/dist/cosmicintersection/components/EmptyState.js +1 -2
  36. package/dist/cosmicintersection/components/EmptyState.js.map +1 -1
  37. package/dist/cosmicintersection/components/EntityFormShell.d.ts +0 -1
  38. package/dist/cosmicintersection/components/EntityFormShell.js +1 -2
  39. package/dist/cosmicintersection/components/EntityFormShell.js.map +1 -1
  40. package/dist/cosmicintersection/components/EntityTagsField.d.ts +0 -1
  41. package/dist/cosmicintersection/components/EntityTagsField.js +1 -2
  42. package/dist/cosmicintersection/components/EntityTagsField.js.map +1 -1
  43. package/dist/cosmicintersection/components/ErrorState.d.ts +0 -1
  44. package/dist/cosmicintersection/components/ErrorState.js +1 -2
  45. package/dist/cosmicintersection/components/ErrorState.js.map +1 -1
  46. package/dist/cosmicintersection/components/FacetPanel.d.ts +0 -1
  47. package/dist/cosmicintersection/components/FacetPanel.js +1 -2
  48. package/dist/cosmicintersection/components/FacetPanel.js.map +1 -1
  49. package/dist/cosmicintersection/components/FileUploadField.d.ts +0 -1
  50. package/dist/cosmicintersection/components/FileUploadField.js +1 -2
  51. package/dist/cosmicintersection/components/FileUploadField.js.map +1 -1
  52. package/dist/cosmicintersection/components/LineageGraph.d.ts +0 -1
  53. package/dist/cosmicintersection/components/LineageGraph.js +7 -12
  54. package/dist/cosmicintersection/components/LineageGraph.js.map +1 -1
  55. package/dist/cosmicintersection/components/LoadingState.d.ts +0 -1
  56. package/dist/cosmicintersection/components/LoadingState.js +1 -2
  57. package/dist/cosmicintersection/components/LoadingState.js.map +1 -1
  58. package/dist/cosmicintersection/components/PageLayout.d.ts +0 -1
  59. package/dist/cosmicintersection/components/PageLayout.js +1 -2
  60. package/dist/cosmicintersection/components/PageLayout.js.map +1 -1
  61. package/dist/cosmicintersection/components/Pagination.d.ts +0 -1
  62. package/dist/cosmicintersection/components/Pagination.js +1 -2
  63. package/dist/cosmicintersection/components/Pagination.js.map +1 -1
  64. package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts +0 -1
  65. package/dist/cosmicintersection/components/ReleaseDraftDialog.js +7 -12
  66. package/dist/cosmicintersection/components/ReleaseDraftDialog.js.map +1 -1
  67. package/dist/cosmicintersection/components/ResultsChart.d.ts +0 -1
  68. package/dist/cosmicintersection/components/ResultsChart.js +4 -8
  69. package/dist/cosmicintersection/components/ResultsChart.js.map +1 -1
  70. package/dist/cosmicintersection/components/RunTriageCard.d.ts +0 -1
  71. package/dist/cosmicintersection/components/RunTriageCard.js +18 -19
  72. package/dist/cosmicintersection/components/RunTriageCard.js.map +1 -1
  73. package/dist/cosmicintersection/components/SafeLink.d.ts +0 -1
  74. package/dist/cosmicintersection/components/SafeLink.js +8 -7
  75. package/dist/cosmicintersection/components/SafeLink.js.map +1 -1
  76. package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts +0 -1
  77. package/dist/cosmicintersection/components/SchemaProposalPanel.js +17 -18
  78. package/dist/cosmicintersection/components/SchemaProposalPanel.js.map +1 -1
  79. package/dist/cosmicintersection/components/ScienceCanvas.d.ts +0 -1
  80. package/dist/cosmicintersection/components/ScienceCanvas.js +226 -233
  81. package/dist/cosmicintersection/components/ScienceCanvas.js.map +1 -1
  82. package/dist/cosmicintersection/components/StatusBadge.d.ts +0 -1
  83. package/dist/cosmicintersection/components/StatusBadge.js +1 -2
  84. package/dist/cosmicintersection/components/StatusBadge.js.map +1 -1
  85. package/dist/cosmicintersection/components/StepDAG.d.ts +0 -1
  86. package/dist/cosmicintersection/components/StepDAG.js +1 -2
  87. package/dist/cosmicintersection/components/StepDAG.js.map +1 -1
  88. package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts +0 -1
  89. package/dist/cosmicintersection/components/WorkspaceTagsPicker.js +1 -2
  90. package/dist/cosmicintersection/components/WorkspaceTagsPicker.js.map +1 -1
  91. package/dist/cosmicintersection/components/index.d.ts +0 -1
  92. package/dist/cosmicintersection/components/index.js +14 -14
  93. package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts +0 -1
  94. package/dist/cosmicintersection/context/CosmicIntersectionContext.js +2 -7
  95. package/dist/cosmicintersection/context/CosmicIntersectionContext.js.map +1 -1
  96. package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts +0 -1
  97. package/dist/cosmicintersection/hooks/useDatabricksExecutions.js +18 -19
  98. package/dist/cosmicintersection/hooks/useDatabricksExecutions.js.map +1 -1
  99. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts +0 -1
  100. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.js +1 -2
  101. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.js.map +1 -1
  102. package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts +0 -1
  103. package/dist/cosmicintersection/hooks/useEntityTagSync.js +29 -25
  104. package/dist/cosmicintersection/hooks/useEntityTagSync.js.map +1 -1
  105. package/dist/cosmicintersection/index.d.ts +0 -1
  106. package/dist/cosmicintersection/lib/assistantAwareDialog.d.ts +0 -1
  107. package/dist/cosmicintersection/lib/assistantAwareDialog.js +1 -2
  108. package/dist/cosmicintersection/lib/assistantAwareDialog.js.map +1 -1
  109. package/dist/cosmicintersection/lib/databricksForm.d.ts +0 -1
  110. package/dist/cosmicintersection/lib/databricksForm.js +1 -2
  111. package/dist/cosmicintersection/lib/databricksForm.js.map +1 -1
  112. package/dist/cosmicintersection/lib/databricksIntent.d.ts +0 -1
  113. package/dist/cosmicintersection/lib/databricksIntent.js +1 -2
  114. package/dist/cosmicintersection/lib/databricksIntent.js.map +1 -1
  115. package/dist/cosmicintersection/lib/databricksPresentation.d.ts +0 -1
  116. package/dist/cosmicintersection/lib/databricksPresentation.js +1 -2
  117. package/dist/cosmicintersection/lib/databricksPresentation.js.map +1 -1
  118. package/dist/cosmicintersection/lib/mutationResult.d.ts +0 -1
  119. package/dist/cosmicintersection/lib/mutationResult.js +1 -2
  120. package/dist/cosmicintersection/lib/mutationResult.js.map +1 -1
  121. package/dist/cosmicintersection/lib/toast.d.ts +0 -1
  122. package/dist/cosmicintersection/lib/toast.js +1 -2
  123. package/dist/cosmicintersection/lib/toast.js.map +1 -1
  124. package/dist/cosmicintersection/lib/useSelectedRecord.d.ts +0 -1
  125. package/dist/cosmicintersection/lib/useSelectedRecord.js +1 -2
  126. package/dist/cosmicintersection/lib/useSelectedRecord.js.map +1 -1
  127. package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts +0 -1
  128. package/dist/cosmicintersection/lib/useTrackRecentItem.js +7 -8
  129. package/dist/cosmicintersection/lib/useTrackRecentItem.js.map +1 -1
  130. package/dist/cosmicintersection/lib/visualization.d.ts +0 -1
  131. package/dist/cosmicintersection/lib/visualization.js +2 -3
  132. package/dist/cosmicintersection/lib/visualization.js.map +1 -1
  133. package/dist/cosmicintersection/lib/visualizationSamples.d.ts +0 -1
  134. package/dist/cosmicintersection/pages/access/AccessPage.d.ts +0 -1
  135. package/dist/cosmicintersection/pages/access/AccessPage.js +225 -226
  136. package/dist/cosmicintersection/pages/access/AccessPage.js.map +1 -1
  137. package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts +0 -1
  138. package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +259 -260
  139. package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
  140. package/dist/cosmicintersection/pages/archive/ArchivePage.d.ts +2 -0
  141. package/dist/cosmicintersection/pages/archive/ArchivePage.js +256 -0
  142. package/dist/cosmicintersection/pages/archive/ArchivePage.js.map +1 -0
  143. package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts +0 -1
  144. package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js +32 -33
  145. package/dist/cosmicintersection/pages/collections/CollectionDetailPage.js.map +1 -1
  146. package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts +0 -1
  147. package/dist/cosmicintersection/pages/collections/CollectionFormPage.js +17 -18
  148. package/dist/cosmicintersection/pages/collections/CollectionFormPage.js.map +1 -1
  149. package/dist/cosmicintersection/pages/collections/CollectionsPage.d.ts +0 -1
  150. package/dist/cosmicintersection/pages/collections/CollectionsPage.js +20 -21
  151. package/dist/cosmicintersection/pages/collections/CollectionsPage.js.map +1 -1
  152. package/dist/cosmicintersection/pages/dashboard/DashboardPage.d.ts +0 -1
  153. package/dist/cosmicintersection/pages/dashboard/DashboardPage.js +19 -20
  154. package/dist/cosmicintersection/pages/dashboard/DashboardPage.js.map +1 -1
  155. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts +0 -1
  156. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +64 -75
  157. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
  158. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts +0 -1
  159. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js +22 -23
  160. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js.map +1 -1
  161. package/dist/cosmicintersection/pages/datasets/DatasetsPage.d.ts +0 -1
  162. package/dist/cosmicintersection/pages/datasets/DatasetsPage.js +207 -208
  163. package/dist/cosmicintersection/pages/datasets/DatasetsPage.js.map +1 -1
  164. package/dist/cosmicintersection/pages/discovery/DiscoveryPage.d.ts +0 -1
  165. package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js +20 -24
  166. package/dist/cosmicintersection/pages/discovery/DiscoveryPage.js.map +1 -1
  167. package/dist/cosmicintersection/pages/lineage/LineagePage.d.ts +0 -1
  168. package/dist/cosmicintersection/pages/lineage/LineagePage.js +53 -54
  169. package/dist/cosmicintersection/pages/lineage/LineagePage.js.map +1 -1
  170. package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts +0 -1
  171. package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js +61 -62
  172. package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.js.map +1 -1
  173. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts +0 -1
  174. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js +50 -48
  175. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js.map +1 -1
  176. package/dist/cosmicintersection/pages/notebooks/NotebooksPage.d.ts +0 -1
  177. package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js +28 -29
  178. package/dist/cosmicintersection/pages/notebooks/NotebooksPage.js.map +1 -1
  179. package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts +0 -1
  180. package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js +119 -120
  181. package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.js.map +1 -1
  182. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts +0 -1
  183. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +41 -42
  184. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
  185. package/dist/cosmicintersection/pages/pipelines/PipelinesPage.d.ts +0 -1
  186. package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js +30 -31
  187. package/dist/cosmicintersection/pages/pipelines/PipelinesPage.js.map +1 -1
  188. package/dist/cosmicintersection/pages/releases/ReleaseFormPage.d.ts +0 -1
  189. package/dist/cosmicintersection/pages/releases/ReleaseFormPage.js +16 -17
  190. package/dist/cosmicintersection/pages/releases/ReleaseFormPage.js.map +1 -1
  191. package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts +0 -1
  192. package/dist/cosmicintersection/pages/releases/ReleasesPage.js +268 -269
  193. package/dist/cosmicintersection/pages/releases/ReleasesPage.js.map +1 -1
  194. package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts +0 -1
  195. package/dist/cosmicintersection/pages/runs/RunDetailPage.js +194 -195
  196. package/dist/cosmicintersection/pages/runs/RunDetailPage.js.map +1 -1
  197. package/dist/cosmicintersection/pages/runs/RunsPage.d.ts +0 -1
  198. package/dist/cosmicintersection/pages/runs/RunsPage.js +20 -21
  199. package/dist/cosmicintersection/pages/runs/RunsPage.js.map +1 -1
  200. package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts +0 -1
  201. package/dist/cosmicintersection/pages/sources/SourceDetailPage.js +31 -32
  202. package/dist/cosmicintersection/pages/sources/SourceDetailPage.js.map +1 -1
  203. package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts +0 -1
  204. package/dist/cosmicintersection/pages/sources/SourceFormPage.js +23 -24
  205. package/dist/cosmicintersection/pages/sources/SourceFormPage.js.map +1 -1
  206. package/dist/cosmicintersection/pages/sources/SourcesPage.d.ts +0 -1
  207. package/dist/cosmicintersection/pages/sources/SourcesPage.js +184 -182
  208. package/dist/cosmicintersection/pages/sources/SourcesPage.js.map +1 -1
  209. package/dist/cosmicintersection/types/index.d.ts +0 -1
  210. package/dist/cosmicintersection/utils/cn.d.ts +0 -1
  211. package/dist/cosmicintersection/utils/cn.js +1 -2
  212. package/dist/cosmicintersection/utils/cn.js.map +1 -1
  213. package/dist/cosmicintersection/utils/i18n.d.ts +0 -1
  214. package/dist/cosmicintersection/utils/navigation.d.ts +0 -1
  215. package/dist/dev/main.d.ts +0 -1
  216. package/dist/generated/global-types.d.ts +0 -1
  217. package/dist/generated/wspace-operations.d.ts +0 -1
  218. package/dist/generated/wspace-operations.js +1 -2
  219. package/dist/generated/wspace-operations.js.map +1 -1
  220. package/dist/generated/wspace-types.d.ts +155 -85
  221. package/dist/index.d.ts +0 -1
  222. package/dist/index.js +3 -3
  223. package/dist/node_modules/clsx/dist/clsx.js +7 -6
  224. package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
  225. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +4 -21
  226. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  227. package/dist/services/createSandboxAssistantTransport.d.ts +0 -1
  228. package/dist/services/createSandboxAssistantTransport.js +1 -2
  229. package/dist/services/createSandboxAssistantTransport.js.map +1 -1
  230. package/dist/services/recentItems.d.ts +0 -1
  231. package/dist/services/recentItems.js +5 -6
  232. package/dist/services/recentItems.js.map +1 -1
  233. package/dist/shared/hooks/useTr.d.ts +0 -1
  234. package/dist/shared/hooks/useTr.js +1 -2
  235. package/dist/shared/hooks/useTr.js.map +1 -1
  236. package/dist/stories/EmptyState.stories.d.ts +0 -1
  237. package/dist/stories/LoadingState.stories.d.ts +0 -1
  238. package/dist/stories/ScienceCanvas.stories.d.ts +0 -1
  239. package/dist/stories/StatusBadge.stories.d.ts +0 -1
  240. package/dist/stories/WorkspaceTagsPicker.stories.d.ts +0 -1
  241. package/dist/test/fakeGateway.d.ts +0 -1
  242. package/dist/test/fixtures.d.ts +0 -1
  243. package/dist/test/happydom.d.ts +1 -0
  244. package/dist/test/i18nMock.d.ts +13 -1
  245. package/dist/test/renderWithProviders.d.ts +1 -2
  246. package/dist/test/storage.d.ts +13 -0
  247. package/dist/types/assistant.d.ts +0 -1
  248. package/dist/utils/pageContext.d.ts +0 -1
  249. package/dist/utils/pageContext.js +1 -2
  250. package/dist/utils/pageContext.js.map +1 -1
  251. package/package.json +64 -38
  252. package/dist/cosmicintersection/CosmicIntersectionRoot.d.ts.map +0 -1
  253. package/dist/cosmicintersection/CosmicIntersectionRoutes.d.ts.map +0 -1
  254. package/dist/cosmicintersection/api/cosmicApi.d.ts.map +0 -1
  255. package/dist/cosmicintersection/api/databricksTransport.d.ts.map +0 -1
  256. package/dist/cosmicintersection/api/tagsApi.d.ts.map +0 -1
  257. package/dist/cosmicintersection/components/ActionMenu.d.ts.map +0 -1
  258. package/dist/cosmicintersection/components/ActivityFeedPanel.d.ts.map +0 -1
  259. package/dist/cosmicintersection/components/AiRunAttribution.d.ts.map +0 -1
  260. package/dist/cosmicintersection/components/DatabricksQueueForm.d.ts.map +0 -1
  261. package/dist/cosmicintersection/components/DatabricksRunPanel.d.ts.map +0 -1
  262. package/dist/cosmicintersection/components/DiscussionPanel.d.ts.map +0 -1
  263. package/dist/cosmicintersection/components/EmptyState.d.ts.map +0 -1
  264. package/dist/cosmicintersection/components/EntityFormShell.d.ts.map +0 -1
  265. package/dist/cosmicintersection/components/EntityTagsField.d.ts.map +0 -1
  266. package/dist/cosmicintersection/components/ErrorState.d.ts.map +0 -1
  267. package/dist/cosmicintersection/components/FacetPanel.d.ts.map +0 -1
  268. package/dist/cosmicintersection/components/FileUploadField.d.ts.map +0 -1
  269. package/dist/cosmicintersection/components/LineageGraph.d.ts.map +0 -1
  270. package/dist/cosmicintersection/components/LoadingState.d.ts.map +0 -1
  271. package/dist/cosmicintersection/components/PageLayout.d.ts.map +0 -1
  272. package/dist/cosmicintersection/components/Pagination.d.ts.map +0 -1
  273. package/dist/cosmicintersection/components/ReleaseDraftDialog.d.ts.map +0 -1
  274. package/dist/cosmicintersection/components/ResultsChart.d.ts.map +0 -1
  275. package/dist/cosmicintersection/components/RunTriageCard.d.ts.map +0 -1
  276. package/dist/cosmicintersection/components/SafeLink.d.ts.map +0 -1
  277. package/dist/cosmicintersection/components/SchemaProposalPanel.d.ts.map +0 -1
  278. package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +0 -1
  279. package/dist/cosmicintersection/components/StatusBadge.d.ts.map +0 -1
  280. package/dist/cosmicintersection/components/StepDAG.d.ts.map +0 -1
  281. package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts.map +0 -1
  282. package/dist/cosmicintersection/components/index.d.ts.map +0 -1
  283. package/dist/cosmicintersection/context/CosmicIntersectionContext.d.ts.map +0 -1
  284. package/dist/cosmicintersection/hooks/useDatabricksExecutions.d.ts.map +0 -1
  285. package/dist/cosmicintersection/hooks/useDatabricksQueueForm.d.ts.map +0 -1
  286. package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts.map +0 -1
  287. package/dist/cosmicintersection/index.d.ts.map +0 -1
  288. package/dist/cosmicintersection/lib/assistantAwareDialog.d.ts.map +0 -1
  289. package/dist/cosmicintersection/lib/databricksForm.d.ts.map +0 -1
  290. package/dist/cosmicintersection/lib/databricksIntent.d.ts.map +0 -1
  291. package/dist/cosmicintersection/lib/databricksPresentation.d.ts.map +0 -1
  292. package/dist/cosmicintersection/lib/mutationResult.d.ts.map +0 -1
  293. package/dist/cosmicintersection/lib/toast.d.ts.map +0 -1
  294. package/dist/cosmicintersection/lib/useSelectedRecord.d.ts.map +0 -1
  295. package/dist/cosmicintersection/lib/useTrackRecentItem.d.ts.map +0 -1
  296. package/dist/cosmicintersection/lib/visualization.d.ts.map +0 -1
  297. package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +0 -1
  298. package/dist/cosmicintersection/pages/access/AccessPage.d.ts.map +0 -1
  299. package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +0 -1
  300. package/dist/cosmicintersection/pages/collections/CollectionDetailPage.d.ts.map +0 -1
  301. package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts.map +0 -1
  302. package/dist/cosmicintersection/pages/collections/CollectionsPage.d.ts.map +0 -1
  303. package/dist/cosmicintersection/pages/dashboard/DashboardPage.d.ts.map +0 -1
  304. package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +0 -1
  305. package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts.map +0 -1
  306. package/dist/cosmicintersection/pages/datasets/DatasetsPage.d.ts.map +0 -1
  307. package/dist/cosmicintersection/pages/discovery/DiscoveryPage.d.ts.map +0 -1
  308. package/dist/cosmicintersection/pages/lineage/LineagePage.d.ts.map +0 -1
  309. package/dist/cosmicintersection/pages/notebooks/NotebookDetailPage.d.ts.map +0 -1
  310. package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts.map +0 -1
  311. package/dist/cosmicintersection/pages/notebooks/NotebooksPage.d.ts.map +0 -1
  312. package/dist/cosmicintersection/pages/pipelines/PipelineDetailPage.d.ts.map +0 -1
  313. package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts.map +0 -1
  314. package/dist/cosmicintersection/pages/pipelines/PipelinesPage.d.ts.map +0 -1
  315. package/dist/cosmicintersection/pages/releases/ReleaseFormPage.d.ts.map +0 -1
  316. package/dist/cosmicintersection/pages/releases/ReleasesPage.d.ts.map +0 -1
  317. package/dist/cosmicintersection/pages/runs/RunDetailPage.d.ts.map +0 -1
  318. package/dist/cosmicintersection/pages/runs/RunsPage.d.ts.map +0 -1
  319. package/dist/cosmicintersection/pages/sources/SourceDetailPage.d.ts.map +0 -1
  320. package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts.map +0 -1
  321. package/dist/cosmicintersection/pages/sources/SourcesPage.d.ts.map +0 -1
  322. package/dist/cosmicintersection/types/index.d.ts.map +0 -1
  323. package/dist/cosmicintersection/utils/cn.d.ts.map +0 -1
  324. package/dist/cosmicintersection/utils/i18n.d.ts.map +0 -1
  325. package/dist/cosmicintersection/utils/navigation.d.ts.map +0 -1
  326. package/dist/dev/main.d.ts.map +0 -1
  327. package/dist/generated/global-types.d.ts.map +0 -1
  328. package/dist/generated/wspace-operations.d.ts.map +0 -1
  329. package/dist/generated/wspace-types.d.ts.map +0 -1
  330. package/dist/index.d.ts.map +0 -1
  331. package/dist/services/createSandboxAssistantTransport.d.ts.map +0 -1
  332. package/dist/services/recentItems.d.ts.map +0 -1
  333. package/dist/shared/hooks/useTr.d.ts.map +0 -1
  334. package/dist/stories/EmptyState.stories.d.ts.map +0 -1
  335. package/dist/stories/LoadingState.stories.d.ts.map +0 -1
  336. package/dist/stories/ScienceCanvas.stories.d.ts.map +0 -1
  337. package/dist/stories/StatusBadge.stories.d.ts.map +0 -1
  338. package/dist/stories/WorkspaceTagsPicker.stories.d.ts.map +0 -1
  339. package/dist/test/fakeGateway.d.ts.map +0 -1
  340. package/dist/test/fixtures.d.ts.map +0 -1
  341. package/dist/test/i18nMock.d.ts.map +0 -1
  342. package/dist/test/renderWithProviders.d.ts.map +0 -1
  343. package/dist/test/setup.d.ts +0 -1
  344. package/dist/test/setup.d.ts.map +0 -1
  345. package/dist/types/assistant.d.ts.map +0 -1
  346. package/dist/utils/pageContext.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cosmicApi.js","names":[],"sources":["../../../src/cosmicintersection/api/cosmicApi.ts"],"sourcesContent":["/**\n * cosmicApi — hand-written typed data layer for the CosmicIntersection MFE.\n *\n * Mirrors the pattern in microfe-eventfullymanaged's eventApi.ts: inline `gql`\n * documents + `@apollo/client/react` hooks, with hand-written response/variables\n * types that track the wspace-cosmicintersection-svc subgraph SDL exactly. The\n * Apollo client is provided by the HOST app shell via React context (integrated\n * mode) — this module never constructs a client. Every `cos*` operation runs on\n * the workspace gateway (the default client in context).\n *\n * Scalar mapping: BigInt -> string, JSON -> Record<string, unknown>,\n * DateTime -> string (ISO).\n */\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\n\n/**\n * Shared mutation error sink. The gateway client runs with `errorPolicy: 'all'`,\n * so in-band GraphQL errors also invoke `onError`; wiring this on every write\n * mutation guarantees a failure is always surfaced to the user even if a caller\n * forgets to inspect the resolved result.\n */\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', error.message || 'Please try again.');\n};\n\n// ============================================================================\n// ENUMS (string-literal unions — exact SDL values)\n// ============================================================================\n\nexport type CosDatasetStatus = 'DRAFT' | 'INGESTING' | 'AVAILABLE' | 'DEPRECATED' | 'ARCHIVED';\nexport type CosAccessLevel = 'PUBLIC' | 'WORKSPACE' | 'RESTRICTED' | 'EMBARGOED';\nexport type CosSourceType =\n | 'TELESCOPE'\n | 'SATELLITE'\n | 'GROUND_SENSOR'\n | 'ARCHIVE'\n | 'API'\n | 'STREAM'\n | 'FILE_DROP'\n | 'SIMULATION';\nexport type CosSourceStatus =\n 'CONFIGURING' | 'CONNECTED' | 'SYNCING' | 'DEGRADED' | 'ERROR' | 'DISABLED';\nexport type CosFieldType =\n | 'STRING'\n | 'INTEGER'\n | 'FLOAT'\n | 'BOOLEAN'\n | 'TIMESTAMP'\n | 'COORDINATE'\n | 'SPECTRUM'\n | 'GEOMETRY'\n | 'IMAGE_REF'\n | 'JSON';\nexport type CosPipelineStatus = 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';\nexport type CosRunStatus = 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';\n/**\n * Full SDL vocabulary. The four geospatial kinds are recognised values a step\n * can already carry (BOFF-4355) — only RASTER_CALC has an execution backend, so\n * they are readable/renderable but are deliberately not offered as authoring\n * options in the add-step form.\n */\nexport type CosStepKind =\n | 'INGEST'\n | 'CALIBRATE'\n | 'TRANSFORM'\n | 'ANALYZE'\n | 'EXPORT'\n | 'NOTIFY'\n | 'RASTER_CALC'\n | 'REPROJECT'\n | 'TILE'\n | 'ZONAL_STATS';\nexport type CosNotebookStatus = 'DRAFT' | 'RUNNING' | 'PUBLISHED' | 'ARCHIVED';\nexport type CosAnalysisStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';\nexport type CosReleaseStatus = 'DRAFT' | 'UNDER_REVIEW' | 'PUBLISHED' | 'RETRACTED';\nexport type CosGrantStatus = 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'REVOKED';\n\n// ============================================================================\n// AI DECISION ENGINE (BOFF-3781 / BOFF-3814) — proposals, never writes.\n// \"AI proposes; scientists review.\" Every cosAi* operation returns a proposal\n// the human accepts through the named domain mutation; nothing here mutates a\n// domain entity. Types mirror wspace-cosmicintersection-svc's ai.gql exactly.\n// ============================================================================\n\nexport type CosTriageAction =\n | 'PROMOTE'\n | 'RERUN_WITH_PARAMS'\n | 'QUARANTINE_DATASET'\n | 'FLAG_SOURCE_DEGRADED'\n | 'INSUFFICIENT_TELEMETRY';\n\nexport type CosTriageSignalSeverity = 'INFO' | 'WARNING' | 'CRITICAL';\nexport type CosTriageEvidenceKind = 'RUN' | 'RUN_METRIC' | 'STEP' | 'SOURCE' | 'BASELINE';\nexport type CosSearchEntityType = 'DATASET' | 'COLLECTION' | 'RELEASE' | 'NOTEBOOK';\nexport type CosSearchEvidenceKind =\n | 'DATASET_TEXT'\n | 'SCHEMA_FIELD'\n | 'SCHEMA_PROVENANCE'\n | 'COVERAGE'\n | 'COVERAGE_WINDOW'\n | 'SOURCE'\n | 'COLLECTION'\n | 'RELEASE_ABSTRACT'\n | 'ANALYSIS_METHOD'\n | 'NOTEBOOK';\nexport type CosSearchLineageKind =\n 'SOURCE' | 'PIPELINE_RUN' | 'PIPELINE_STEP' | 'ANALYSIS' | 'RELEASE';\n\nexport interface CosSchemaFieldSuggestion {\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n nullable: boolean;\n position: number;\n description?: string | null;\n /** Drafted provenance note: where the column came from and why it was typed so. */\n provenanceNote: string;\n confidence: number;\n reasons: string[];\n sampledValues: number;\n emptyValues: number;\n /** True when the dataset already defines this name — it is never overwritten. */\n alreadyDefined: boolean;\n existingFieldId?: string | null;\n conflicts: string[];\n}\n\nexport interface CosSchemaFieldProposal {\n datasetId: string;\n sampleOrigin: 'REQUEST' | 'DATASET_CONTEXT' | 'SOURCE_CONFIG';\n sampledRows: number;\n fields: CosSchemaFieldSuggestion[];\n notes: string[];\n /** Id of this run in the shared AI invocation ledger. */\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosTriageSignal {\n code: string;\n severity: CosTriageSignalSeverity;\n message: string;\n}\n\nexport interface CosTriageEvidence {\n kind: CosTriageEvidenceKind;\n refId: string;\n field: string;\n value: string;\n}\n\nexport interface CosRunTriageMetrics {\n rowsIn?: number | null;\n rowsOut?: number | null;\n anomaliesFlagged?: number | null;\n warnings?: number | null;\n anomalyRate?: number | null;\n rowLossRate?: number | null;\n baselineAnomalyRate?: number | null;\n}\n\nexport interface CosTriageProposedAction {\n /** Name of the existing mutation a person would run; triage never runs it. */\n mutation: string;\n targetId: string;\n arguments: Record<string, unknown>;\n description: string;\n}\n\nexport interface CosRunTriage {\n runId: string;\n action: CosTriageAction;\n confidence: number;\n rationale: string;\n signals: CosTriageSignal[];\n evidence: CosTriageEvidence[];\n metrics: CosRunTriageMetrics;\n suggestedParams?: Record<string, unknown> | null;\n proposedAction?: CosTriageProposedAction | null;\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosReleaseAuthorSuggestion {\n actorId: string;\n roles: string[];\n contributions: number;\n}\n\nexport interface CosReleaseDraft {\n notebookId: string;\n title: string;\n abstract: string;\n version: string;\n authors: string[];\n authorSuggestions: CosReleaseAuthorSuggestion[];\n license: string;\n licenseRationale: string;\n datasetIds: string[];\n analysisIds: string[];\n warnings: string[];\n notes: string[];\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosSearchEvidence {\n kind: CosSearchEvidenceKind;\n entityId?: string | null;\n label?: string | null;\n text: string;\n}\n\nexport interface CosSearchLineageNode {\n kind: CosSearchLineageKind;\n id: string;\n label: string;\n relation: string;\n parentId?: string | null;\n}\n\nexport interface CosSearchHit {\n entityType: CosSearchEntityType;\n id: string;\n title: string;\n snippet?: string | null;\n score: number;\n dataset?: CosDataset | null;\n collection?: CosCollection | null;\n release?: CosRelease | null;\n notebook?: CosNotebook | null;\n evidence: CosSearchEvidence[];\n lineage: CosSearchLineageNode[];\n}\n\nexport interface CosSearchResults {\n query: string;\n interpretedTerms: string[];\n expandedTerms: string[];\n timeWindow?: { fromYear: number; toYear: number } | null;\n hits: CosSearchHit[];\n total: number;\n}\n\nexport interface CosSemanticSearchInput {\n query: string;\n entityTypes?: CosSearchEntityType[];\n limit?: number;\n includeLineage?: boolean;\n}\n\nexport interface CosUpdateSchemaFieldInput {\n name?: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\n// ============================================================================\n// ENTITY TYPES\n// ============================================================================\n\n/** Federated wspace-files File stub — only `{ id }` is resolvable in this subgraph. */\nexport interface CosFileRef {\n id: string;\n}\n\n/** An entity selected id-only, where the operation needs its existence, not its body. */\nexport interface CosIdRef {\n id: string;\n}\n\n/**\n * Per-parent cap the subgraph applies to every relation field\n * (`capPerGroup(rows, key, DEFAULT_LIMIT)` in wspace-cosmicintersection-svc's\n * dataloaders — DEFAULT_LIMIT is 50).\n *\n * A relation array of exactly this length means \"at least this many\", NOT an\n * exact total: render it as `50+`, never as a precise count.\n */\nexport const COS_RELATION_PAGE_SIZE = 50;\n\nexport interface CosSchemaField {\n id: string;\n workspaceId: string;\n datasetId: string;\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n description?: string | null;\n nullable: boolean;\n position: number;\n provenance?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataset {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n format?: string | null;\n sourceId?: string | null;\n collectionId?: string | null;\n /** BigInt returned as a numeric string. */\n rowCount: string;\n /** BigInt returned as a numeric string. */\n sizeBytes: string;\n version: number;\n lineageCaptured: boolean;\n coverage?: Record<string, unknown> | null;\n ingestedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — only present when the operation selects them (detail queries).\n source?: CosSource | null;\n collection?: CosCollection | null;\n file?: CosFileRef | null;\n schemaFields?: CosSchemaField[];\n}\n\nexport interface CosSource {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n type: CosSourceType;\n status: CosSourceStatus;\n endpoint?: string | null;\n config?: Record<string, unknown> | null;\n lastSyncedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosCollection {\n id: string;\n workspaceId: string;\n name: string;\n slug?: string | null;\n description?: string | null;\n isPublic: boolean;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosPipeline {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosPipelineStatus;\n /** Ordered science steps (CosStepKind vocabulary). Orchestration lives in the linked canonical workflow. */\n steps?: Record<string, unknown> | null;\n /** Opaque canonical WorkflowDefinition id (wspace-workflow-svc); null = manual runs only. */\n workflowDefinitionId?: string | null;\n lastRunAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n runs?: CosPipelineRun[];\n}\n\nexport interface CosPipelineRun {\n id: string;\n workspaceId: string;\n pipelineId: string;\n runNumber: number;\n status: CosRunStatus;\n datasetId?: string | null;\n /** Opaque canonical WorkflowRun id (wspace-workflow-svc) when the pipeline is automated. */\n workflowRunId?: string | null;\n params?: Record<string, unknown> | null;\n metrics?: Record<string, unknown> | null;\n triggeredBy?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n pipeline?: CosPipeline | null;\n steps?: CosPipelineStep[];\n}\n\nexport interface CosPipelineStep {\n id: string;\n workspaceId: string;\n runId: string;\n name: string;\n kind: CosStepKind;\n position: number;\n status: CosRunStatus;\n inputs?: Record<string, unknown> | null;\n outputs?: Record<string, unknown> | null;\n logsRef?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosNotebook {\n id: string;\n workspaceId: string;\n title: string;\n description?: string | null;\n status: CosNotebookStatus;\n runtime?: string | null;\n environment?: Record<string, unknown> | null;\n datasetIds: string[];\n isShared: boolean;\n shareSlug?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n file?: CosFileRef | null;\n analyses?: CosAnalysis[];\n releases?: CosRelease[];\n}\n\nexport interface CosAnalysis {\n id: string;\n workspaceId: string;\n title: string;\n status: CosAnalysisStatus;\n method?: string | null;\n aiAssisted: boolean;\n notebookId?: string | null;\n datasetId?: string | null;\n results?: Record<string, unknown> | null;\n outputFile?: CosFileRef | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosRelease {\n id: string;\n workspaceId: string;\n title: string;\n version: string;\n status: CosReleaseStatus;\n abstract?: string | null;\n authors: string[];\n datasetIds: string[];\n notebookId?: string | null;\n doi?: string | null;\n license?: string | null;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataAccessGrant {\n id: string;\n workspaceId: string;\n datasetId: string;\n granteeId: string;\n status: CosGrantStatus;\n scopes: string[];\n reason?: string | null;\n grantedAt?: string | null;\n expiresAt?: string | null;\n revokedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n// ============================================================================\n// PAGINATION / CONNECTIONS\n// ============================================================================\n\nexport interface CosPageInfo {\n hasMore: boolean;\n cursor?: string | null;\n}\n\nexport interface CosConnection<T> {\n items: T[];\n pageInfo: CosPageInfo;\n}\n\n/** Offset-based pagination input (PaginationInput in the SDL; limit defaults to 50). */\nexport interface CosPaginationInput {\n limit?: number;\n offset?: number;\n cursor?: string;\n}\n\n// ============================================================================\n// INPUT TYPES\n// ============================================================================\n\nexport interface CosCreateDatasetInput {\n name: string;\n description?: string;\n status?: CosDatasetStatus;\n accessLevel?: CosAccessLevel;\n format?: string;\n sourceId?: string;\n collectionId?: string;\n fileId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateDatasetInput {\n name?: string;\n description?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosAddSchemaFieldInput {\n datasetId: string;\n name: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\nexport interface CosCreateSourceInput {\n name: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateSourceInput {\n name?: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosCreateCollectionInput {\n name: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\n/** All fields optional — only the provided keys are updated (CosUpdateCollectionInput in the SDL). */\nexport interface CosUpdateCollectionInput {\n name?: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\nexport interface CosCreatePipelineInput {\n name: string;\n description?: string;\n /** Ordered science steps (CosStepKind vocabulary). */\n steps?: Record<string, unknown>;\n /** Optional canonical WorkflowDefinition id (wspace-workflow-svc) for real automation. */\n workflowDefinitionId?: string;\n tags?: string[];\n}\n\nexport interface CosUpdatePipelineInput {\n name?: string;\n description?: string;\n status?: CosPipelineStatus;\n steps?: Record<string, unknown>;\n /** Send null to unlink the canonical workflow. */\n workflowDefinitionId?: string | null;\n tags?: string[];\n}\n\nexport interface CosStartRunInput {\n pipelineId: string;\n datasetId?: string;\n params?: Record<string, unknown>;\n}\n\nexport interface CosAddRunStepInput {\n runId: string;\n name: string;\n kind?: CosStepKind;\n inputs?: Record<string, unknown>;\n position?: number;\n}\n\nexport interface CosCreateNotebookInput {\n title: string;\n description?: string;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n fileId?: string;\n tags?: string[];\n}\n\nexport interface CosUpdateNotebookInput {\n title?: string;\n description?: string;\n status?: CosNotebookStatus;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n isShared?: boolean;\n shareSlug?: string;\n tags?: string[];\n}\n\nexport interface CosRunAnalysisInput {\n title: string;\n method?: string;\n aiAssisted?: boolean;\n notebookId?: string;\n datasetId?: string;\n}\n\nexport interface CosCreateReleaseInput {\n title: string;\n version?: string;\n abstract?: string;\n authors?: string[];\n datasetIds?: string[];\n notebookId?: string;\n license?: string;\n}\n\nexport interface CosGrantAccessInput {\n datasetId: string;\n granteeId: string;\n scopes?: string[];\n reason?: string;\n expiresAt?: string;\n}\n\n// ============================================================================\n// GQL DOCUMENTS — QUERIES\n// ============================================================================\n\nexport const COS_HEALTH_QUERY = gql`\n query CosHealth {\n cosHealth\n }\n`;\n\nexport const COS_DATASETS_QUERY = gql`\n query CosListDatasets(\n $q: String\n $accessLevel: CosAccessLevel\n $format: String\n $collectionId: ID\n $sourceId: ID\n $status: CosDatasetStatus\n $pagination: PaginationInput\n ) {\n cosListDatasets(\n q: $q\n accessLevel: $accessLevel\n format: $format\n collectionId: $collectionId\n sourceId: $sourceId\n status: $status\n pagination: $pagination\n ) {\n items {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n ingestedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_DATASET_QUERY = gql`\n query CosDataset($id: ID!) {\n cosDataset(id: $id) {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n coverage\n ingestedAt\n tags\n createdAt\n updatedAt\n file {\n id\n }\n source {\n id\n name\n type\n status\n }\n collection {\n id\n name\n slug\n }\n schemaFields {\n id\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const COS_SOURCES_QUERY = gql`\n query CosListSources(\n $type: CosSourceType\n $status: CosSourceStatus\n $pagination: PaginationInput\n ) {\n cosListSources(type: $type, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_SOURCE_QUERY = gql`\n query CosSource($id: ID!) {\n cosSource(id: $id) {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n datasets {\n id\n name\n status\n accessLevel\n rowCount\n updatedAt\n }\n }\n }\n`;\n\n/**\n * `datasets` is selected id-only so each card can show how many datasets the\n * collection holds. The subgraph resolves it through `collectionDatasetsLoader`\n * (one batched query for the whole page) and filters to the datasets THIS actor\n * may read, so the length is the caller's visible count — capped at\n * `COS_RELATION_PAGE_SIZE`.\n */\nexport const COS_COLLECTIONS_QUERY = gql`\n query CosListCollections {\n cosListCollections {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n datasets {\n id\n }\n }\n }\n`;\n\nexport const COS_COLLECTION_QUERY = gql`\n query CosCollection($id: ID!) {\n cosCollection(id: $id) {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_SCHEMA_FIELDS_QUERY = gql`\n query CosListSchemaFields($datasetId: ID!) {\n cosListSchemaFields(datasetId: $datasetId) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PIPELINES_QUERY = gql`\n query CosListPipelines($status: CosPipelineStatus, $pagination: PaginationInput) {\n cosListPipelines(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n status\n workflowDefinitionId\n lastRunAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_PIPELINE_QUERY = gql`\n query CosPipeline($id: ID!) {\n cosPipeline(id: $id) {\n id\n workspaceId\n name\n description\n status\n steps\n workflowDefinitionId\n lastRunAt\n tags\n createdAt\n updatedAt\n runs {\n id\n runNumber\n status\n datasetId\n workflowRunId\n startedAt\n finishedAt\n durationMs\n createdAt\n }\n }\n }\n`;\n\nexport const COS_RUNS_QUERY = gql`\n query CosListRuns($pipelineId: ID, $status: CosRunStatus, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_RUN_QUERY = gql`\n query CosRun($id: ID!) {\n cosRun(id: $id) {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n workflowRunId\n params\n metrics\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n pipeline {\n id\n name\n status\n workflowDefinitionId\n }\n steps {\n id\n runId\n name\n kind\n position\n status\n startedAt\n finishedAt\n durationMs\n errorMessage\n }\n }\n }\n`;\n\n/**\n * Other FAILED runs of the same pipeline, newest first, each with its steps so\n * the caller can name the step that broke. `steps` resolves through\n * `pipelineRunStepsLoader`, so the whole list costs one extra batched query.\n */\nexport const COS_PIPELINE_FAILED_RUNS_QUERY = gql`\n query CosPipelineFailedRuns($pipelineId: ID!, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: FAILED, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n errorMessage\n startedAt\n finishedAt\n createdAt\n updatedAt\n steps {\n id\n runId\n name\n kind\n position\n status\n errorMessage\n }\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * Minimal dataset lookup — resolves an id held on another entity (e.g.\n * `CosPipelineRun.datasetId`, which the SDL exposes as a bare ID with no\n * relation field) to something a human can read. Returns null when the caller\n * has no read access to that dataset, so callers must fall back to the id.\n */\nexport const COS_DATASET_SUMMARY_QUERY = gql`\n query CosDatasetSummary($id: ID!) {\n cosDataset(id: $id) {\n id\n name\n status\n accessLevel\n }\n }\n`;\n\nexport const COS_RUN_STEPS_QUERY = gql`\n query CosListRunSteps($runId: ID!) {\n cosListRunSteps(runId: $runId) {\n id\n workspaceId\n runId\n name\n kind\n position\n status\n inputs\n outputs\n logsRef\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_NOTEBOOKS_QUERY = gql`\n query CosListNotebooks($status: CosNotebookStatus, $pagination: PaginationInput) {\n cosListNotebooks(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_NOTEBOOK_QUERY = gql`\n query CosNotebook($id: ID!) {\n cosNotebook(id: $id) {\n id\n workspaceId\n title\n description\n status\n runtime\n environment\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n file {\n id\n }\n analyses {\n id\n title\n status\n aiAssisted\n method\n createdAt\n }\n releases {\n id\n title\n version\n status\n publishedAt\n }\n }\n }\n`;\n\nexport const COS_ANALYSES_QUERY = gql`\n query CosListAnalyses($datasetId: ID, $notebookId: ID, $status: CosAnalysisStatus) {\n cosListAnalyses(datasetId: $datasetId, notebookId: $notebookId, status: $status) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\n/**\n * One analysis by id, independent of list paging and filters; the analyses\n * page falls back to it when the `?id=` analysis is not in the loaded list.\n */\nexport const COS_ANALYSIS_QUERY = gql`\n query CosAnalysis($id: ID!) {\n cosAnalysis(id: $id) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_RELEASES_QUERY = gql`\n query CosListReleases($status: CosReleaseStatus, $pagination: PaginationInput) {\n cosListReleases(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * One release by id, independent of list paging and filters. The releases page\n * falls back to it when the `?id=` release is not on the loaded list page, so a\n * deep link or a command-palette Recent entry always reopens the release.\n */\nexport const COS_RELEASE_QUERY = gql`\n query CosRelease($id: ID!) {\n cosRelease(id: $id) {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ACCESS_GRANTS_QUERY = gql`\n query CosListAccessGrants($datasetId: ID, $status: CosGrantStatus) {\n cosListAccessGrants(datasetId: $datasetId, status: $status) {\n id\n workspaceId\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n revokedAt\n createdAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// PLATFORM REUSE — activity feed (wspace-activity-svc, federated on the\n// workspace supergraph). The cos mutation-audit plugin already writes these\n// ActivityLog rows via be-sdk `trackOperation`; this is the read surface,\n// scoped to a single cos entity by `resourceId`. Only scalar fields are\n// selected so no cross-subgraph entity resolution is required.\n// ============================================================================\n\nexport const COS_ACTIVITY_BY_RESOURCE_QUERY = gql`\n query CosResourceActivity($filter: ActivityLogFilter) {\n getActivities(filter: $filter) {\n id\n action\n description\n resourceType\n resourceId\n userId\n timestamp\n }\n }\n`;\n\n// ============================================================================\n// GQL DOCUMENTS — MUTATIONS\n// ============================================================================\n\nexport const COS_CREATE_DATASET_MUTATION = gql`\n mutation CosCreateDataset($input: CosCreateDatasetInput!) {\n cosCreateDataset(input: $input) {\n id\n name\n status\n accessLevel\n sourceId\n collectionId\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_DATASET_MUTATION = gql`\n mutation CosUpdateDataset($id: ID!, $input: CosUpdateDatasetInput!) {\n cosUpdateDataset(id: $id, input: $input) {\n id\n name\n description\n status\n accessLevel\n format\n collectionId\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_DATASET_MUTATION = gql`\n mutation CosPublishDataset($id: ID!) {\n cosPublishDataset(id: $id) {\n id\n status\n ingestedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_DATASET_MUTATION = gql`\n mutation CosArchiveDataset($id: ID!) {\n cosArchiveDataset(id: $id)\n }\n`;\n\nexport const COS_ADD_SCHEMA_FIELD_MUTATION = gql`\n mutation CosAddSchemaField($input: CosAddSchemaFieldInput!) {\n cosAddSchemaField(input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_SOURCE_MUTATION = gql`\n mutation CosCreateSource($input: CosCreateSourceInput!) {\n cosCreateSource(input: $input) {\n id\n name\n type\n status\n endpoint\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SOURCE_MUTATION = gql`\n mutation CosUpdateSource($id: ID!, $input: CosUpdateSourceInput!) {\n cosUpdateSource(id: $id, input: $input) {\n id\n name\n description\n type\n status\n endpoint\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_MARK_SOURCE_SYNCED_MUTATION = gql`\n mutation CosMarkSourceSynced($id: ID!) {\n cosMarkSourceSynced(id: $id) {\n id\n status\n lastSyncedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_SOURCE_MUTATION = gql`\n mutation CosArchiveSource($id: ID!) {\n cosArchiveSource(id: $id)\n }\n`;\n\nexport const COS_CREATE_COLLECTION_MUTATION = gql`\n mutation CosCreateCollection($input: CosCreateCollectionInput!) {\n cosCreateCollection(input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_COLLECTION_MUTATION = gql`\n mutation CosUpdateCollection($id: ID!, $input: CosUpdateCollectionInput!) {\n cosUpdateCollection(id: $id, input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_COLLECTION_MUTATION = gql`\n mutation CosArchiveCollection($id: ID!) {\n cosArchiveCollection(id: $id)\n }\n`;\n\nexport const COS_CREATE_PIPELINE_MUTATION = gql`\n mutation CosCreatePipeline($input: CosCreatePipelineInput!) {\n cosCreatePipeline(input: $input) {\n id\n name\n status\n workflowDefinitionId\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_PIPELINE_MUTATION = gql`\n mutation CosUpdatePipeline($id: ID!, $input: CosUpdatePipelineInput!) {\n cosUpdatePipeline(id: $id, input: $input) {\n id\n name\n description\n status\n workflowDefinitionId\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_PIPELINE_MUTATION = gql`\n mutation CosArchivePipeline($id: ID!) {\n cosArchivePipeline(id: $id)\n }\n`;\n\nexport const COS_START_RUN_MUTATION = gql`\n mutation CosStartRun($input: CosStartRunInput!) {\n cosStartRun(input: $input) {\n id\n pipelineId\n runNumber\n status\n datasetId\n workflowRunId\n errorMessage\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_TRANSITION_RUN_MUTATION = gql`\n mutation CosTransitionRun($id: ID!, $status: CosRunStatus!) {\n cosTransitionRun(id: $id, status: $status) {\n id\n status\n startedAt\n finishedAt\n durationMs\n updatedAt\n }\n }\n`;\n\nexport const COS_ADD_RUN_STEP_MUTATION = gql`\n mutation CosAddRunStep($input: CosAddRunStepInput!) {\n cosAddRunStep(input: $input) {\n id\n runId\n name\n kind\n position\n status\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_NOTEBOOK_MUTATION = gql`\n mutation CosCreateNotebook($input: CosCreateNotebookInput!) {\n cosCreateNotebook(input: $input) {\n id\n title\n status\n runtime\n datasetIds\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_NOTEBOOK_MUTATION = gql`\n mutation CosUpdateNotebook($id: ID!, $input: CosUpdateNotebookInput!) {\n cosUpdateNotebook(id: $id, input: $input) {\n id\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_NOTEBOOK_MUTATION = gql`\n mutation CosArchiveNotebook($id: ID!) {\n cosArchiveNotebook(id: $id)\n }\n`;\n\nexport const COS_RUN_ANALYSIS_MUTATION = gql`\n mutation CosRunAnalysis($input: CosRunAnalysisInput!) {\n cosRunAnalysis(input: $input) {\n id\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_COMPLETE_ANALYSIS_MUTATION = gql`\n mutation CosCompleteAnalysis(\n $id: ID!\n $status: CosAnalysisStatus!\n $results: JSON\n $outputFileId: ID\n ) {\n cosCompleteAnalysis(id: $id, status: $status, results: $results, outputFileId: $outputFileId) {\n id\n status\n results\n finishedAt\n errorMessage\n outputFile {\n id\n }\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_RELEASE_MUTATION = gql`\n mutation CosCreateRelease($input: CosCreateReleaseInput!) {\n cosCreateRelease(input: $input) {\n id\n title\n version\n status\n authors\n datasetIds\n notebookId\n license\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_RELEASE_MUTATION = gql`\n mutation CosPublishRelease($id: ID!, $doi: String, $mintDoi: Boolean) {\n cosPublishRelease(id: $id, doi: $doi, mintDoi: $mintDoi) {\n id\n status\n doi\n publishedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_MINT_DOI_MUTATION = gql`\n mutation CosMintDoi($releaseId: ID!) {\n cosMintDoi(releaseId: $releaseId) {\n id\n doi\n state\n mode\n errorMessage\n mintedAt\n }\n }\n`;\n\nexport const COS_GRANT_ACCESS_MUTATION = gql`\n mutation CosGrantAccess($input: CosGrantAccessInput!) {\n cosGrantAccess(input: $input) {\n id\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REVOKE_ACCESS_MUTATION = gql`\n mutation CosRevokeAccess($id: ID!) {\n cosRevokeAccess(id: $id) {\n id\n status\n revokedAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// RESPONSE / VARIABLES TYPES\n// ============================================================================\n\nexport interface CosHealthQueryData {\n cosHealth: string;\n}\n\nexport interface CosDatasetsQueryData {\n cosListDatasets: CosConnection<CosDataset>;\n}\nexport interface CosDatasetsQueryVars {\n /** Full-text search across dataset name/description/tags (backend `q` arg). */\n q?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n sourceId?: string;\n status?: CosDatasetStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosDatasetQueryData {\n cosDataset: CosDataset | null;\n}\n\nexport interface CosSourcesQueryData {\n cosListSources: CosConnection<CosSource>;\n}\nexport interface CosSourcesQueryVars {\n type?: CosSourceType;\n status?: CosSourceStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosSourceQueryData {\n cosSource: CosSource | null;\n}\n\n/**\n * Row shape of `cosListCollections` — same as `CosCollection` except `datasets`\n * is the id-only selection COS_COLLECTIONS_QUERY makes, so the list page can\n * size each collection without over-fetching dataset bodies.\n */\nexport interface CosCollectionListItem extends Omit<CosCollection, 'datasets'> {\n datasets: CosIdRef[];\n}\n\nexport interface CosCollectionsQueryData {\n cosListCollections: CosCollectionListItem[];\n}\n\nexport interface CosCollectionQueryData {\n cosCollection: CosCollection | null;\n}\n\nexport interface CosSchemaFieldsQueryData {\n cosListSchemaFields: CosSchemaField[];\n}\n\nexport interface CosPipelinesQueryData {\n cosListPipelines: CosConnection<CosPipeline>;\n}\nexport interface CosPipelinesQueryVars {\n status?: CosPipelineStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosPipelineQueryData {\n cosPipeline: CosPipeline | null;\n}\n\nexport interface CosRunsQueryData {\n cosListRuns: CosConnection<CosPipelineRun>;\n}\nexport interface CosRunsQueryVars {\n pipelineId?: string;\n status?: CosRunStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosRunQueryData {\n cosRun: CosPipelineRun | null;\n}\n\nexport interface CosRunStepsQueryData {\n cosListRunSteps: CosPipelineStep[];\n}\n\n/** Row of COS_PIPELINE_FAILED_RUNS_QUERY — `steps` is always selected. */\nexport interface CosFailedRunListItem extends Omit<CosPipelineRun, 'steps'> {\n steps: CosPipelineStep[];\n}\n\nexport interface CosPipelineFailedRunsQueryData {\n cosListRuns: CosConnection<CosFailedRunListItem>;\n}\nexport interface CosPipelineFailedRunsQueryVars {\n pipelineId: string;\n pagination?: CosPaginationInput;\n}\n\n/** Just enough of a dataset to render its name in place of a bare id. */\nexport interface CosDatasetSummary {\n id: string;\n name: string;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n}\n\nexport interface CosDatasetSummaryQueryData {\n cosDataset: CosDatasetSummary | null;\n}\n\nexport interface CosNotebooksQueryData {\n cosListNotebooks: CosConnection<CosNotebook>;\n}\nexport interface CosNotebooksQueryVars {\n status?: CosNotebookStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosNotebookQueryData {\n cosNotebook: CosNotebook | null;\n}\n\nexport interface CosAnalysesQueryData {\n cosListAnalyses: CosAnalysis[];\n}\nexport interface CosAnalysesQueryVars {\n datasetId?: string;\n notebookId?: string;\n status?: CosAnalysisStatus;\n}\n\nexport interface CosAnalysisQueryData {\n cosAnalysis: CosAnalysis | null;\n}\nexport interface CosReleaseQueryData {\n cosRelease: CosRelease | null;\n}\nexport interface CosReleasesQueryData {\n cosListReleases: CosConnection<CosRelease>;\n}\nexport interface CosReleasesQueryVars {\n status?: CosReleaseStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosAccessGrantsQueryData {\n cosListAccessGrants: CosDataAccessGrant[];\n}\nexport interface CosAccessGrantsQueryVars {\n datasetId?: string;\n status?: CosGrantStatus;\n}\n\n/** A single platform activity record (subset of wspace-activity-svc ActivityLog). */\nexport interface CosActivityEntry {\n id: string;\n action: string;\n description?: string | null;\n resourceType?: string | null;\n resourceId?: string | null;\n userId: string;\n timestamp: string;\n}\n\nexport interface CosActivityQueryData {\n getActivities: CosActivityEntry[];\n}\n\n/** Mirrors ActivityLogFilter — only the fields the cos activity panel needs. */\nexport interface CosActivityFilter {\n workspaceId?: string;\n resourceId?: string;\n resourceType?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface CosActivityQueryVars {\n filter?: CosActivityFilter;\n}\n\n// ============================================================================\n// QUERY HOOKS\n// ============================================================================\n\nexport const useCosHealthQuery = () => useQuery<CosHealthQueryData>(COS_HEALTH_QUERY);\n\nexport const useCosDatasetsQuery = (variables: CosDatasetsQueryVars = {}) =>\n useQuery<CosDatasetsQueryData, CosDatasetsQueryVars>(COS_DATASETS_QUERY, { variables });\n\nexport const useCosDatasetQuery = (id: string) =>\n useQuery<CosDatasetQueryData, { id: string }>(COS_DATASET_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSourcesQuery = (variables: CosSourcesQueryVars = {}) =>\n useQuery<CosSourcesQueryData, CosSourcesQueryVars>(COS_SOURCES_QUERY, { variables });\n\nexport const useCosSourceQuery = (id: string) =>\n useQuery<CosSourceQueryData, { id: string }>(COS_SOURCE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosCollectionsQuery = () =>\n useQuery<CosCollectionsQueryData>(COS_COLLECTIONS_QUERY);\n\nexport const useCosCollectionQuery = (id: string) =>\n useQuery<CosCollectionQueryData, { id: string }>(COS_COLLECTION_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSchemaFieldsQuery = (datasetId: string) =>\n useQuery<CosSchemaFieldsQueryData, { datasetId: string }>(COS_SCHEMA_FIELDS_QUERY, {\n variables: { datasetId },\n skip: !datasetId,\n });\n\n// ---------------------------------------------------------------------------\n// Canonical workflows (wspace-workflow-svc) — the pipeline automation link\n// (OVL-09, BOFF-5232). Workflows are owned by the shared engine; CosmicIntersection\n// stores only the chosen definition's opaque id on CosPipeline.workflowDefinitionId.\n// ---------------------------------------------------------------------------\nexport interface CosWorkflowOption {\n id: string;\n name: string;\n workflowKey: string;\n version: string;\n}\n\nexport const COS_RUNNABLE_WORKFLOWS_QUERY = gql`\n query CosRunnableWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items {\n id\n name\n workflowKey\n version\n }\n total\n hasMore\n }\n }\n`;\n\nexport const COS_WORKFLOW_DEFINITION_QUERY = gql`\n query CosWorkflowDefinition($id: ID!) {\n workflowDefinition(id: $id) {\n id\n name\n workflowKey\n version\n status\n }\n }\n`;\n\n/** One page is plenty for a picker; the engine caps a list at this size. */\nexport const MAX_WORKFLOW_OPTIONS = 100;\n\nexport const useRunnableWorkflowsQuery = () =>\n useQuery<{\n workflowDefinitions: { items: CosWorkflowOption[]; total: number; hasMore: boolean };\n }>(COS_RUNNABLE_WORKFLOWS_QUERY, {\n variables: { input: { status: 'ACTIVE', limit: MAX_WORKFLOW_OPTIONS, offset: 0 } },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useWorkflowDefinitionQuery = (id: string | null | undefined) =>\n useQuery<{ workflowDefinition: (CosWorkflowOption & { status: string }) | null }, { id: string }>(\n COS_WORKFLOW_DEFINITION_QUERY,\n { variables: { id: id ?? '' }, skip: !id }\n );\n\nexport const useCosPipelinesQuery = (variables: CosPipelinesQueryVars = {}) =>\n useQuery<CosPipelinesQueryData, CosPipelinesQueryVars>(COS_PIPELINES_QUERY, { variables });\n\nexport const useCosPipelineQuery = (id: string) =>\n useQuery<CosPipelineQueryData, { id: string }>(COS_PIPELINE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunsQuery = (variables: CosRunsQueryVars = {}) =>\n useQuery<CosRunsQueryData, CosRunsQueryVars>(COS_RUNS_QUERY, { variables });\n\nexport const useCosRunQuery = (id: string) =>\n useQuery<CosRunQueryData, { id: string }>(COS_RUN_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunStepsQuery = (runId: string) =>\n useQuery<CosRunStepsQueryData, { runId: string }>(COS_RUN_STEPS_QUERY, {\n variables: { runId },\n skip: !runId,\n });\n\n/**\n * Failed runs of one pipeline. Skipped until a pipelineId is known so the run\n * detail page can call it unconditionally while its own query is still loading.\n */\nexport const useCosPipelineFailedRunsQuery = (\n pipelineId: string | undefined,\n options: { limit?: number; skip?: boolean } = {}\n) =>\n useQuery<CosPipelineFailedRunsQueryData, CosPipelineFailedRunsQueryVars>(\n COS_PIPELINE_FAILED_RUNS_QUERY,\n {\n variables: {\n pipelineId: pipelineId ?? '',\n pagination: { limit: options.limit ?? 20, offset: 0 },\n },\n skip: !pipelineId || options.skip === true,\n }\n );\n\n/** Resolves a dataset id to its name. Returns null data when unreadable. */\nexport const useCosDatasetSummaryQuery = (id: string | null | undefined) =>\n useQuery<CosDatasetSummaryQueryData, { id: string }>(COS_DATASET_SUMMARY_QUERY, {\n variables: { id: id ?? '' },\n skip: !id,\n });\n\nexport const useCosNotebooksQuery = (variables: CosNotebooksQueryVars = {}) =>\n useQuery<CosNotebooksQueryData, CosNotebooksQueryVars>(COS_NOTEBOOKS_QUERY, { variables });\n\nexport const useCosNotebookQuery = (id: string) =>\n useQuery<CosNotebookQueryData, { id: string }>(COS_NOTEBOOK_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosAnalysesQuery = (variables: CosAnalysesQueryVars = {}) =>\n useQuery<CosAnalysesQueryData, CosAnalysesQueryVars>(COS_ANALYSES_QUERY, { variables });\n\nexport const useCosReleasesQuery = (variables: CosReleasesQueryVars = {}) =>\n useQuery<CosReleasesQueryData, CosReleasesQueryVars>(COS_RELEASES_QUERY, { variables });\n\n/** One analysis by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosAnalysisQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosAnalysisQueryData, { id: string }>(COS_ANALYSIS_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\n/** One release by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosReleaseQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosReleaseQueryData, { id: string }>(COS_RELEASE_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\nexport const useCosAccessGrantsQuery = (variables: CosAccessGrantsQueryVars = {}) =>\n useQuery<CosAccessGrantsQueryData, CosAccessGrantsQueryVars>(COS_ACCESS_GRANTS_QUERY, {\n variables,\n });\n\n/**\n * Resource-scoped platform activity for a single cos entity. RBAC on\n * `getActivities` scopes on `filter.workspaceId`, so both a workspaceId and the\n * entity's resourceId are required — the query is skipped until both are known.\n */\nexport const useCosResourceActivityQuery = (params: {\n workspaceId?: string;\n resourceId: string;\n resourceType?: string;\n limit?: number;\n}) => {\n const { workspaceId, resourceId, resourceType, limit = 20 } = params;\n return useQuery<CosActivityQueryData, CosActivityQueryVars>(COS_ACTIVITY_BY_RESOURCE_QUERY, {\n variables: { filter: { workspaceId, resourceId, resourceType, limit } },\n skip: !workspaceId || !resourceId,\n fetchPolicy: 'cache-and-network',\n });\n};\n\n// ============================================================================\n// MUTATION HOOKS\n// ============================================================================\n\nexport const useCosCreateDatasetMutation = () =>\n useMutation<{ cosCreateDataset: CosDataset }, { input: CosCreateDatasetInput }>(\n COS_CREATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosUpdateDatasetMutation = () =>\n useMutation<{ cosUpdateDataset: CosDataset }, { id: string; input: CosUpdateDatasetInput }>(\n COS_UPDATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosPublishDatasetMutation = () =>\n useMutation<{ cosPublishDataset: CosDataset }, { id: string }>(COS_PUBLISH_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosArchiveDatasetMutation = () =>\n useMutation<{ cosArchiveDataset: boolean }, { id: string }>(COS_ARCHIVE_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosAddSchemaFieldMutation = () =>\n useMutation<{ cosAddSchemaField: CosSchemaField }, { input: CosAddSchemaFieldInput }>(\n COS_ADD_SCHEMA_FIELD_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateSourceMutation = () =>\n useMutation<{ cosCreateSource: CosSource }, { input: CosCreateSourceInput }>(\n COS_CREATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosUpdateSourceMutation = () =>\n useMutation<{ cosUpdateSource: CosSource }, { id: string; input: CosUpdateSourceInput }>(\n COS_UPDATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosMarkSourceSyncedMutation = () =>\n useMutation<{ cosMarkSourceSynced: CosSource }, { id: string }>(COS_MARK_SOURCE_SYNCED_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosArchiveSourceMutation = () =>\n useMutation<{ cosArchiveSource: boolean }, { id: string }>(COS_ARCHIVE_SOURCE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosCreateCollectionMutation = () =>\n useMutation<{ cosCreateCollection: CosCollection }, { input: CosCreateCollectionInput }>(\n COS_CREATE_COLLECTION_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n }\n );\n\nexport const useCosUpdateCollectionMutation = () =>\n useMutation<\n { cosUpdateCollection: CosCollection },\n { id: string; input: CosUpdateCollectionInput }\n >(COS_UPDATE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosArchiveCollectionMutation = () =>\n useMutation<{ cosArchiveCollection: boolean }, { id: string }>(COS_ARCHIVE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosCreatePipelineMutation = () =>\n useMutation<{ cosCreatePipeline: CosPipeline }, { input: CosCreatePipelineInput }>(\n COS_CREATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosUpdatePipelineMutation = () =>\n useMutation<{ cosUpdatePipeline: CosPipeline }, { id: string; input: CosUpdatePipelineInput }>(\n COS_UPDATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosArchivePipelineMutation = () =>\n useMutation<{ cosArchivePipeline: boolean }, { id: string }>(COS_ARCHIVE_PIPELINE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n });\n\nexport const useCosStartRunMutation = () =>\n useMutation<{ cosStartRun: CosPipelineRun }, { input: CosStartRunInput }>(\n COS_START_RUN_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RUNS_QUERY }],\n }\n );\n\nexport const useCosTransitionRunMutation = () =>\n useMutation<{ cosTransitionRun: CosPipelineRun }, { id: string; status: CosRunStatus }>(\n COS_TRANSITION_RUN_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_RUNS_QUERY }] }\n );\n\nexport const useCosAddRunStepMutation = () =>\n useMutation<{ cosAddRunStep: CosPipelineStep }, { input: CosAddRunStepInput }>(\n COS_ADD_RUN_STEP_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateNotebookMutation = () =>\n useMutation<{ cosCreateNotebook: CosNotebook }, { input: CosCreateNotebookInput }>(\n COS_CREATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosUpdateNotebookMutation = () =>\n useMutation<{ cosUpdateNotebook: CosNotebook }, { id: string; input: CosUpdateNotebookInput }>(\n COS_UPDATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosArchiveNotebookMutation = () =>\n useMutation<{ cosArchiveNotebook: boolean }, { id: string }>(COS_ARCHIVE_NOTEBOOK_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n });\n\nexport const useCosRunAnalysisMutation = () =>\n useMutation<{ cosRunAnalysis: CosAnalysis }, { input: CosRunAnalysisInput }>(\n COS_RUN_ANALYSIS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n }\n );\n\nexport const useCosCompleteAnalysisMutation = () =>\n useMutation<\n { cosCompleteAnalysis: CosAnalysis },\n {\n id: string;\n status: Extract<CosAnalysisStatus, 'COMPLETED' | 'FAILED'>;\n results?: Record<string, unknown>;\n outputFileId?: string;\n }\n >(COS_COMPLETE_ANALYSIS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n });\n\nexport const useCosCreateReleaseMutation = () =>\n useMutation<{ cosCreateRelease: CosRelease }, { input: CosCreateReleaseInput }>(\n COS_CREATE_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosPublishReleaseMutation = () =>\n useMutation<{ cosPublishRelease: CosRelease }, { id: string; doi?: string; mintDoi?: boolean }>(\n COS_PUBLISH_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosMintDoiMutation = () =>\n useMutation<\n {\n cosMintDoi: {\n id: string;\n doi?: string | null;\n state: string;\n mode: string;\n errorMessage?: string | null;\n mintedAt?: string | null;\n };\n },\n { releaseId: string }\n >(COS_MINT_DOI_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n });\n\nexport const useCosGrantAccessMutation = () =>\n useMutation<{ cosGrantAccess: CosDataAccessGrant }, { input: CosGrantAccessInput }>(\n COS_GRANT_ACCESS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n }\n );\n\nexport const useCosRevokeAccessMutation = () =>\n useMutation<{ cosRevokeAccess: CosDataAccessGrant }, { id: string }>(COS_REVOKE_ACCESS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n });\n\n// ============================================================================\n// AI DECISION ENGINE OPERATIONS (BOFF-3814)\n// ============================================================================\n\n/**\n * Propose one schema field per dataset column. Writes nothing — accepting a\n * suggestion is the separate, human-pressed `cosAddSchemaField` call.\n */\nexport const COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION = gql`\n mutation CosAiProposeSchemaFields($datasetId: ID!, $sample: CosSchemaSampleInput) {\n cosAiProposeSchemaFields(datasetId: $datasetId, sample: $sample) {\n datasetId\n sampleOrigin\n sampledRows\n fields {\n name\n fieldType\n unit\n nullable\n position\n description\n provenanceNote\n confidence\n reasons\n sampledValues\n emptyValues\n alreadyDefined\n existingFieldId\n conflicts\n }\n notes\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\n/**\n * Recommend what to do with a finished run, with rationale + the telemetry it\n * read as evidence. Writes nothing — applying the recommendation is the\n * human-pressed mutation named in `proposedAction`.\n */\nexport const COS_AI_TRIAGE_RUN_MUTATION = gql`\n mutation CosAiTriageRun($runId: ID!) {\n cosAiTriageRun(runId: $runId) {\n runId\n action\n confidence\n rationale\n signals {\n code\n severity\n message\n }\n evidence {\n kind\n refId\n field\n value\n }\n metrics {\n rowsIn\n rowsOut\n anomaliesFlagged\n warnings\n anomalyRate\n rowLossRate\n baselineAnomalyRate\n }\n suggestedParams\n proposedAction {\n mutation\n targetId\n arguments\n description\n }\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\n/**\n * Draft a release from a notebook. Writes nothing — `cosCreateRelease` and\n * the confirmed `cosPublishRelease` stay human actions.\n */\nexport const COS_AI_DRAFT_RELEASE_MUTATION = gql`\n mutation CosAiDraftRelease($notebookId: ID!) {\n cosAiDraftRelease(notebookId: $notebookId) {\n notebookId\n title\n abstract\n version\n authors\n authorSuggestions {\n actorId\n roles\n contributions\n }\n license\n licenseRationale\n datasetIds\n analysisIds\n warnings\n notes\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SCHEMA_FIELD_MUTATION = gql`\n mutation CosUpdateSchemaField($id: ID!, $input: CosUpdateSchemaFieldInput!) {\n cosUpdateSchemaField(id: $id, input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REMOVE_SCHEMA_FIELD_MUTATION = gql`\n mutation CosRemoveSchemaField($id: ID!) {\n cosRemoveSchemaField(id: $id)\n }\n`;\n\nexport const COS_SEMANTIC_SEARCH_QUERY = gql`\n query CosSemanticSearch($input: CosSemanticSearchInput!) {\n cosSemanticSearch(input: $input) {\n query\n interpretedTerms\n expandedTerms\n timeWindow {\n fromYear\n toYear\n }\n total\n hits {\n entityType\n id\n title\n snippet\n score\n dataset {\n id\n name\n status\n accessLevel\n format\n }\n collection {\n id\n name\n }\n release {\n id\n title\n status\n }\n notebook {\n id\n title\n status\n }\n evidence {\n kind\n entityId\n label\n text\n }\n lineage {\n kind\n id\n label\n relation\n parentId\n }\n }\n }\n }\n`;\n\nexport const useCosAiProposeSchemaFieldsMutation = () =>\n useMutation<\n { cosAiProposeSchemaFields: CosSchemaFieldProposal },\n { datasetId: string; sample?: { columns?: string[]; rows: unknown } }\n >(COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION, { errorPolicy: 'all', onError: onMutationError });\n\nexport const useCosAiTriageRunMutation = () =>\n useMutation<{ cosAiTriageRun: CosRunTriage }, { runId: string }>(COS_AI_TRIAGE_RUN_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n });\n\nexport const useCosAiDraftReleaseMutation = () =>\n useMutation<{ cosAiDraftRelease: CosReleaseDraft }, { notebookId: string }>(\n COS_AI_DRAFT_RELEASE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosUpdateSchemaFieldMutation = () =>\n useMutation<\n { cosUpdateSchemaField: CosSchemaField },\n { id: string; input: CosUpdateSchemaFieldInput }\n >(COS_UPDATE_SCHEMA_FIELD_MUTATION, { errorPolicy: 'all', onError: onMutationError });\n\nexport const useCosRemoveSchemaFieldMutation = () =>\n useMutation<{ cosRemoveSchemaField: boolean }, { id: string }>(COS_REMOVE_SCHEMA_FIELD_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n });\n\nexport const useCosSemanticSearchLazyQuery = () =>\n useLazyQuery<{ cosSemanticSearch: CosSearchResults }, { input: CosSemanticSearchInput }>(\n COS_SEMANTIC_SEARCH_QUERY\n );\n"],"mappings":";;;;AAwBA,IAAM,KAAmB,MAA2B;CAClD,EAAO,MAAM,wBAAwB,EAAM,WAAW,mBAAmB;AAC3E;AAgpBgC,CAAG;;;;;AAMnC,IAAa,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CxB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDvB,IAAoB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BvB,IAAmB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;GAkCtB,IAAwB,CAAG;;;;;;;;;;;;;;;;;GAmB3B,IAAuB,CAAG;;;;;;;;;;;;;;;AAgBA,CAAG;;;;;;;;;;;;;;;;;;AAmB1C,IAAa,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;GAuBzB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BxB,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;GA0BpB,KAAgB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CnB,KAAiC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCpC,IAA4B,CAAG;;;;;;;;;GAW/B,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;GAuBzB,IAAsB,CAAG;;;;;;;;;;;;;;;;;;;;;;;GAyBzB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCxB,IAAqB,CAAG;;;;;;;;;;;;;;;;;;;;;;GA4BxB,IAAqB,CAAG;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8ChC,KAAgC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;GA2BnC,KAAmC,CAAG;;;;;;;;;;;;;;;;;GAmBtC,KAAmC,CAAG;;;;GAMtC,KAA4B,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwD/B,WACX,EAGE,IAAuC;CAAE,aAAa;CAAO,SAAS;AAAgB,CAAC,GAE9E,WACX,EAAiE,GAA4B;CAC3F,aAAa;CACb,SAAS;AACX,CAAC,GAEU,WACX,EACE,IACA;CAAE,aAAa;CAAO,SAAS;AAAgB,CACjD,GAEW,WACX,EAGE,IAAkC;CAAE,aAAa;CAAO,SAAS;AAAgB,CAAC,GAEzE,WACX,EAA+D,IAAkC;CAC/F,aAAa;CACb,SAAS;AACX,CAAC,GAEU,WACX,EACE,EACF"}
1
+ {"version":3,"file":"cosmicApi.js","names":["onMutationError","error","COS_DATASETS_QUERY","COS_DATASET_QUERY","COS_SOURCES_QUERY","COS_SOURCE_QUERY","COS_COLLECTIONS_QUERY","COS_COLLECTION_QUERY","COS_PIPELINES_QUERY","COS_PIPELINE_QUERY","COS_RUNS_QUERY","COS_RUN_QUERY","COS_PIPELINE_FAILED_RUNS_QUERY","COS_DATASET_SUMMARY_QUERY","COS_RUN_STEPS_QUERY","COS_NOTEBOOKS_QUERY","COS_NOTEBOOK_QUERY","COS_ANALYSES_QUERY","COS_ANALYSIS_QUERY","COS_RELEASES_QUERY","COS_RELEASE_QUERY","COS_ACCESS_GRANTS_QUERY","COS_ACTIVITY_BY_RESOURCE_QUERY","COS_CREATE_DATASET_MUTATION","COS_UPDATE_DATASET_MUTATION","COS_PUBLISH_DATASET_MUTATION","COS_ARCHIVE_DATASET_MUTATION","COS_ADD_SCHEMA_FIELD_MUTATION","COS_CREATE_SOURCE_MUTATION","COS_UPDATE_SOURCE_MUTATION","COS_MARK_SOURCE_SYNCED_MUTATION","COS_ARCHIVE_SOURCE_MUTATION","COS_CREATE_COLLECTION_MUTATION","COS_UPDATE_COLLECTION_MUTATION","COS_ARCHIVE_COLLECTION_MUTATION","COS_CREATE_PIPELINE_MUTATION","COS_UPDATE_PIPELINE_MUTATION","COS_ARCHIVE_PIPELINE_MUTATION","COS_START_RUN_MUTATION","COS_TRANSITION_RUN_MUTATION","COS_ADD_RUN_STEP_MUTATION","COS_CREATE_NOTEBOOK_MUTATION","COS_UPDATE_NOTEBOOK_MUTATION","COS_ARCHIVE_NOTEBOOK_MUTATION","COS_RUN_ANALYSIS_MUTATION","COS_COMPLETE_ANALYSIS_MUTATION","COS_CREATE_RELEASE_MUTATION","COS_PUBLISH_RELEASE_MUTATION","COS_MINT_DOI_MUTATION","COS_GRANT_ACCESS_MUTATION","COS_REVOKE_ACCESS_MUTATION","useCosDatasetsQuery","useQuery","useCosDatasetQuery","id","useCosSourcesQuery","useCosSourceQuery","useCosCollectionsQuery","useCosCollectionQuery","COS_RUNNABLE_WORKFLOWS_QUERY","COS_WORKFLOW_DEFINITION_QUERY","useRunnableWorkflowsQuery","useWorkflowDefinitionQuery","useCosPipelinesQuery","useCosPipelineQuery","useCosRunsQuery","useCosRunQuery","useCosRunStepsQuery","runId","useCosPipelineFailedRunsQuery","pipelineId","options","useCosDatasetSummaryQuery","useCosNotebooksQuery","useCosNotebookQuery","useCosAnalysesQuery","useCosReleasesQuery","useCosAnalysisQuery","useCosReleaseQuery","useCosAccessGrantsQuery","useCosResourceActivityQuery","params","workspaceId","resourceId","useCosCreateDatasetMutation","useMutation","useCosUpdateDatasetMutation","useCosPublishDatasetMutation","useCosArchiveDatasetMutation","useCosAddSchemaFieldMutation","useCosCreateSourceMutation","useCosUpdateSourceMutation","useCosMarkSourceSyncedMutation","useCosArchiveSourceMutation","useCosCreateCollectionMutation","useCosUpdateCollectionMutation","useCosArchiveCollectionMutation","useCosCreatePipelineMutation","useCosUpdatePipelineMutation","useCosArchivePipelineMutation","useCosStartRunMutation","useCosTransitionRunMutation","useCosAddRunStepMutation","useCosCreateNotebookMutation","useCosUpdateNotebookMutation","useCosArchiveNotebookMutation","useCosRunAnalysisMutation","useCosCompleteAnalysisMutation","useCosCreateReleaseMutation","useCosPublishReleaseMutation","useCosMintDoiMutation","useCosGrantAccessMutation","useCosRevokeAccessMutation","COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION","COS_AI_TRIAGE_RUN_MUTATION","COS_AI_DRAFT_RELEASE_MUTATION","COS_UPDATE_SCHEMA_FIELD_MUTATION","COS_REMOVE_SCHEMA_FIELD_MUTATION","COS_SEMANTIC_SEARCH_QUERY","useCosAiProposeSchemaFieldsMutation","useCosAiTriageRunMutation","useCosAiDraftReleaseMutation","useCosUpdateSchemaFieldMutation","useCosRemoveSchemaFieldMutation","useCosSemanticSearchLazyQuery","useLazyQuery","COS_ARCHIVE_MISSIONS_QUERY","COS_ARCHIVE_SEARCH_QUERY","COS_ARCHIVE_PRODUCTS_QUERY","useCosArchiveMissionsQuery","useCosArchiveSearchLazyQuery","useCosArchiveProductsLazyQuery"],"sources":["../../../src/cosmicintersection/api/cosmicApi.ts"],"sourcesContent":["/**\n * cosmicApi — hand-written typed data layer for the CosmicIntersection MFE.\n *\n * Mirrors the pattern in microfe-eventfullymanaged's eventApi.ts: inline `gql`\n * documents + `@apollo/client/react` hooks, with hand-written response/variables\n * types that track the wspace-cosmicintersection-svc subgraph SDL exactly. The\n * Apollo client is provided by the HOST app shell via React context (integrated\n * mode) — this module never constructs a client. Every `cos*` operation runs on\n * the workspace gateway (the default client in context).\n *\n * Scalar mapping: BigInt -> string, JSON -> Record<string, unknown>,\n * DateTime -> string (ISO).\n */\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useLazyQuery, useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\n\n/**\n * Shared mutation error sink. The gateway client runs with `errorPolicy: 'all'`,\n * so in-band GraphQL errors also invoke `onError`; wiring this on every write\n * mutation guarantees a failure is always surfaced to the user even if a caller\n * forgets to inspect the resolved result.\n */\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', error.message || 'Please try again.');\n};\n\n// ============================================================================\n// ENUMS (string-literal unions — exact SDL values)\n// ============================================================================\n\nexport type CosDatasetStatus = 'DRAFT' | 'INGESTING' | 'AVAILABLE' | 'DEPRECATED' | 'ARCHIVED';\nexport type CosAccessLevel = 'PUBLIC' | 'WORKSPACE' | 'RESTRICTED' | 'EMBARGOED';\nexport type CosSourceType =\n | 'TELESCOPE'\n | 'SATELLITE'\n | 'GROUND_SENSOR'\n | 'ARCHIVE'\n | 'API'\n | 'STREAM'\n | 'FILE_DROP'\n | 'SIMULATION';\nexport type CosSourceStatus =\n 'CONFIGURING' | 'CONNECTED' | 'SYNCING' | 'DEGRADED' | 'ERROR' | 'DISABLED';\nexport type CosFieldType =\n | 'STRING'\n | 'INTEGER'\n | 'FLOAT'\n | 'BOOLEAN'\n | 'TIMESTAMP'\n | 'COORDINATE'\n | 'SPECTRUM'\n | 'GEOMETRY'\n | 'IMAGE_REF'\n | 'JSON';\nexport type CosPipelineStatus = 'DRAFT' | 'ACTIVE' | 'PAUSED' | 'ARCHIVED';\nexport type CosRunStatus = 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';\n/**\n * Full SDL vocabulary. The four geospatial kinds are recognised values a step\n * can already carry (BOFF-4355) — only RASTER_CALC has an execution backend, so\n * they are readable/renderable but are deliberately not offered as authoring\n * options in the add-step form.\n */\nexport type CosStepKind =\n | 'INGEST'\n | 'CALIBRATE'\n | 'TRANSFORM'\n | 'ANALYZE'\n | 'EXPORT'\n | 'NOTIFY'\n | 'RASTER_CALC'\n | 'REPROJECT'\n | 'TILE'\n | 'ZONAL_STATS';\nexport type CosNotebookStatus = 'DRAFT' | 'RUNNING' | 'PUBLISHED' | 'ARCHIVED';\nexport type CosAnalysisStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';\nexport type CosReleaseStatus = 'DRAFT' | 'UNDER_REVIEW' | 'PUBLISHED' | 'RETRACTED';\nexport type CosGrantStatus = 'PENDING' | 'ACTIVE' | 'EXPIRED' | 'REVOKED';\n\n// ============================================================================\n// AI DECISION ENGINE (BOFF-3781 / BOFF-3814) — proposals, never writes.\n// \"AI proposes; scientists review.\" Every cosAi* operation returns a proposal\n// the human accepts through the named domain mutation; nothing here mutates a\n// domain entity. Types mirror wspace-cosmicintersection-svc's ai.gql exactly.\n// ============================================================================\n\nexport type CosTriageAction =\n | 'PROMOTE'\n | 'RERUN_WITH_PARAMS'\n | 'QUARANTINE_DATASET'\n | 'FLAG_SOURCE_DEGRADED'\n | 'INSUFFICIENT_TELEMETRY';\n\nexport type CosTriageSignalSeverity = 'INFO' | 'WARNING' | 'CRITICAL';\nexport type CosTriageEvidenceKind = 'RUN' | 'RUN_METRIC' | 'STEP' | 'SOURCE' | 'BASELINE';\nexport type CosSearchEntityType = 'DATASET' | 'COLLECTION' | 'RELEASE' | 'NOTEBOOK';\nexport type CosSearchEvidenceKind =\n | 'DATASET_TEXT'\n | 'SCHEMA_FIELD'\n | 'SCHEMA_PROVENANCE'\n | 'COVERAGE'\n | 'COVERAGE_WINDOW'\n | 'SOURCE'\n | 'COLLECTION'\n | 'RELEASE_ABSTRACT'\n | 'ANALYSIS_METHOD'\n | 'NOTEBOOK';\nexport type CosSearchLineageKind =\n 'SOURCE' | 'PIPELINE_RUN' | 'PIPELINE_STEP' | 'ANALYSIS' | 'RELEASE';\n\nexport interface CosSchemaFieldSuggestion {\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n nullable: boolean;\n position: number;\n description?: string | null;\n /** Drafted provenance note: where the column came from and why it was typed so. */\n provenanceNote: string;\n confidence: number;\n reasons: string[];\n sampledValues: number;\n emptyValues: number;\n /** True when the dataset already defines this name — it is never overwritten. */\n alreadyDefined: boolean;\n existingFieldId?: string | null;\n conflicts: string[];\n}\n\nexport interface CosSchemaFieldProposal {\n datasetId: string;\n sampleOrigin: 'REQUEST' | 'DATASET_CONTEXT' | 'SOURCE_CONFIG';\n sampledRows: number;\n fields: CosSchemaFieldSuggestion[];\n notes: string[];\n /** Id of this run in the shared AI invocation ledger. */\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosTriageSignal {\n code: string;\n severity: CosTriageSignalSeverity;\n message: string;\n}\n\nexport interface CosTriageEvidence {\n kind: CosTriageEvidenceKind;\n refId: string;\n field: string;\n value: string;\n}\n\nexport interface CosRunTriageMetrics {\n rowsIn?: number | null;\n rowsOut?: number | null;\n anomaliesFlagged?: number | null;\n warnings?: number | null;\n anomalyRate?: number | null;\n rowLossRate?: number | null;\n baselineAnomalyRate?: number | null;\n}\n\nexport interface CosTriageProposedAction {\n /** Name of the existing mutation a person would run; triage never runs it. */\n mutation: string;\n targetId: string;\n arguments: Record<string, unknown>;\n description: string;\n}\n\nexport interface CosRunTriage {\n runId: string;\n action: CosTriageAction;\n confidence: number;\n rationale: string;\n signals: CosTriageSignal[];\n evidence: CosTriageEvidence[];\n metrics: CosRunTriageMetrics;\n suggestedParams?: Record<string, unknown> | null;\n proposedAction?: CosTriageProposedAction | null;\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosReleaseAuthorSuggestion {\n actorId: string;\n roles: string[];\n contributions: number;\n}\n\nexport interface CosReleaseDraft {\n notebookId: string;\n title: string;\n abstract: string;\n version: string;\n authors: string[];\n authorSuggestions: CosReleaseAuthorSuggestion[];\n license: string;\n licenseRationale: string;\n datasetIds: string[];\n analysisIds: string[];\n warnings: string[];\n notes: string[];\n agentRunId: string;\n engineVersion: string;\n method: string;\n generatedAt: string;\n}\n\nexport interface CosSearchEvidence {\n kind: CosSearchEvidenceKind;\n entityId?: string | null;\n label?: string | null;\n text: string;\n}\n\nexport interface CosSearchLineageNode {\n kind: CosSearchLineageKind;\n id: string;\n label: string;\n relation: string;\n parentId?: string | null;\n}\n\nexport interface CosSearchHit {\n entityType: CosSearchEntityType;\n id: string;\n title: string;\n snippet?: string | null;\n score: number;\n dataset?: CosDataset | null;\n collection?: CosCollection | null;\n release?: CosRelease | null;\n notebook?: CosNotebook | null;\n evidence: CosSearchEvidence[];\n lineage: CosSearchLineageNode[];\n}\n\nexport interface CosSearchResults {\n query: string;\n interpretedTerms: string[];\n expandedTerms: string[];\n timeWindow?: { fromYear: number; toYear: number } | null;\n hits: CosSearchHit[];\n total: number;\n}\n\nexport interface CosSemanticSearchInput {\n query: string;\n entityTypes?: CosSearchEntityType[];\n limit?: number;\n includeLineage?: boolean;\n}\n\nexport interface CosUpdateSchemaFieldInput {\n name?: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\n// ============================================================================\n// ENTITY TYPES\n// ============================================================================\n\n/** Federated wspace-files File stub — only `{ id }` is resolvable in this subgraph. */\nexport interface CosFileRef {\n id: string;\n}\n\n/** An entity selected id-only, where the operation needs its existence, not its body. */\nexport interface CosIdRef {\n id: string;\n}\n\n/**\n * Per-parent cap the subgraph applies to every relation field\n * (`capPerGroup(rows, key, DEFAULT_LIMIT)` in wspace-cosmicintersection-svc's\n * dataloaders — DEFAULT_LIMIT is 50).\n *\n * A relation array of exactly this length means \"at least this many\", NOT an\n * exact total: render it as `50+`, never as a precise count.\n */\nexport const COS_RELATION_PAGE_SIZE = 50;\n\nexport interface CosSchemaField {\n id: string;\n workspaceId: string;\n datasetId: string;\n name: string;\n fieldType: CosFieldType;\n unit?: string | null;\n description?: string | null;\n nullable: boolean;\n position: number;\n provenance?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataset {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n format?: string | null;\n sourceId?: string | null;\n collectionId?: string | null;\n /** BigInt returned as a numeric string. */\n rowCount: string;\n /** BigInt returned as a numeric string. */\n sizeBytes: string;\n version: number;\n lineageCaptured: boolean;\n coverage?: Record<string, unknown> | null;\n ingestedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — only present when the operation selects them (detail queries).\n source?: CosSource | null;\n collection?: CosCollection | null;\n file?: CosFileRef | null;\n schemaFields?: CosSchemaField[];\n}\n\nexport interface CosSource {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n type: CosSourceType;\n status: CosSourceStatus;\n endpoint?: string | null;\n config?: Record<string, unknown> | null;\n lastSyncedAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosCollection {\n id: string;\n workspaceId: string;\n name: string;\n slug?: string | null;\n description?: string | null;\n isPublic: boolean;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n datasets?: CosDataset[];\n}\n\nexport interface CosPipeline {\n id: string;\n workspaceId: string;\n name: string;\n description?: string | null;\n status: CosPipelineStatus;\n /** Ordered science steps (CosStepKind vocabulary). Orchestration lives in the linked canonical workflow. */\n steps?: Record<string, unknown> | null;\n /** Opaque canonical WorkflowDefinition id (wspace-workflow-svc); null = manual runs only. */\n workflowDefinitionId?: string | null;\n lastRunAt?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relation — present only on detail queries.\n runs?: CosPipelineRun[];\n}\n\nexport interface CosPipelineRun {\n id: string;\n workspaceId: string;\n pipelineId: string;\n runNumber: number;\n status: CosRunStatus;\n datasetId?: string | null;\n /** Opaque canonical WorkflowRun id (wspace-workflow-svc) when the pipeline is automated. */\n workflowRunId?: string | null;\n params?: Record<string, unknown> | null;\n metrics?: Record<string, unknown> | null;\n triggeredBy?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n pipeline?: CosPipeline | null;\n steps?: CosPipelineStep[];\n}\n\nexport interface CosPipelineStep {\n id: string;\n workspaceId: string;\n runId: string;\n name: string;\n kind: CosStepKind;\n position: number;\n status: CosRunStatus;\n inputs?: Record<string, unknown> | null;\n outputs?: Record<string, unknown> | null;\n logsRef?: string | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n durationMs?: number | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosNotebook {\n id: string;\n workspaceId: string;\n title: string;\n description?: string | null;\n status: CosNotebookStatus;\n runtime?: string | null;\n environment?: Record<string, unknown> | null;\n datasetIds: string[];\n isShared: boolean;\n shareSlug?: string | null;\n tags: string[];\n createdAt: string;\n updatedAt: string;\n // Relations — present only on detail queries.\n file?: CosFileRef | null;\n analyses?: CosAnalysis[];\n releases?: CosRelease[];\n}\n\nexport interface CosAnalysis {\n id: string;\n workspaceId: string;\n title: string;\n status: CosAnalysisStatus;\n method?: string | null;\n aiAssisted: boolean;\n notebookId?: string | null;\n datasetId?: string | null;\n results?: Record<string, unknown> | null;\n outputFile?: CosFileRef | null;\n startedAt?: string | null;\n finishedAt?: string | null;\n errorMessage?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosRelease {\n id: string;\n workspaceId: string;\n title: string;\n version: string;\n status: CosReleaseStatus;\n abstract?: string | null;\n authors: string[];\n datasetIds: string[];\n notebookId?: string | null;\n doi?: string | null;\n license?: string | null;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface CosDataAccessGrant {\n id: string;\n workspaceId: string;\n datasetId: string;\n granteeId: string;\n status: CosGrantStatus;\n scopes: string[];\n reason?: string | null;\n grantedAt?: string | null;\n expiresAt?: string | null;\n revokedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n// ============================================================================\n// PAGINATION / CONNECTIONS\n// ============================================================================\n\nexport interface CosPageInfo {\n hasMore: boolean;\n cursor?: string | null;\n}\n\nexport interface CosConnection<T> {\n items: T[];\n pageInfo: CosPageInfo;\n}\n\n/** Offset-based pagination input (PaginationInput in the SDL; limit defaults to 50). */\nexport interface CosPaginationInput {\n limit?: number;\n offset?: number;\n cursor?: string;\n}\n\n// ============================================================================\n// INPUT TYPES\n// ============================================================================\n\nexport interface CosCreateDatasetInput {\n name: string;\n description?: string;\n status?: CosDatasetStatus;\n accessLevel?: CosAccessLevel;\n format?: string;\n sourceId?: string;\n collectionId?: string;\n fileId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateDatasetInput {\n name?: string;\n description?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n coverage?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosAddSchemaFieldInput {\n datasetId: string;\n name: string;\n fieldType?: CosFieldType;\n unit?: string;\n description?: string;\n nullable?: boolean;\n position?: number;\n provenance?: string;\n}\n\nexport interface CosCreateSourceInput {\n name: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosUpdateSourceInput {\n name?: string;\n type?: CosSourceType;\n status?: CosSourceStatus;\n description?: string;\n endpoint?: string;\n credentialRef?: string;\n config?: Record<string, unknown>;\n tags?: string[];\n}\n\nexport interface CosCreateCollectionInput {\n name: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\n/** All fields optional — only the provided keys are updated (CosUpdateCollectionInput in the SDL). */\nexport interface CosUpdateCollectionInput {\n name?: string;\n slug?: string;\n description?: string;\n isPublic?: boolean;\n tags?: string[];\n}\n\nexport interface CosCreatePipelineInput {\n name: string;\n description?: string;\n /** Ordered science steps (CosStepKind vocabulary). */\n steps?: Record<string, unknown>;\n /** Optional canonical WorkflowDefinition id (wspace-workflow-svc) for real automation. */\n workflowDefinitionId?: string;\n tags?: string[];\n}\n\nexport interface CosUpdatePipelineInput {\n name?: string;\n description?: string;\n status?: CosPipelineStatus;\n steps?: Record<string, unknown>;\n /** Send null to unlink the canonical workflow. */\n workflowDefinitionId?: string | null;\n tags?: string[];\n}\n\nexport interface CosStartRunInput {\n pipelineId: string;\n datasetId?: string;\n params?: Record<string, unknown>;\n}\n\nexport interface CosAddRunStepInput {\n runId: string;\n name: string;\n kind?: CosStepKind;\n inputs?: Record<string, unknown>;\n position?: number;\n}\n\nexport interface CosCreateNotebookInput {\n title: string;\n description?: string;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n fileId?: string;\n tags?: string[];\n}\n\nexport interface CosUpdateNotebookInput {\n title?: string;\n description?: string;\n status?: CosNotebookStatus;\n runtime?: string;\n environment?: Record<string, unknown>;\n datasetIds?: string[];\n isShared?: boolean;\n shareSlug?: string;\n tags?: string[];\n}\n\nexport interface CosRunAnalysisInput {\n title: string;\n method?: string;\n aiAssisted?: boolean;\n notebookId?: string;\n datasetId?: string;\n}\n\nexport interface CosCreateReleaseInput {\n title: string;\n version?: string;\n abstract?: string;\n authors?: string[];\n datasetIds?: string[];\n notebookId?: string;\n license?: string;\n}\n\nexport interface CosGrantAccessInput {\n datasetId: string;\n granteeId: string;\n scopes?: string[];\n reason?: string;\n expiresAt?: string;\n}\n\n// ============================================================================\n// GQL DOCUMENTS — QUERIES\n// ============================================================================\n\nexport const COS_HEALTH_QUERY = gql`\n query CosHealth {\n cosHealth\n }\n`;\n\nexport const COS_DATASETS_QUERY = gql`\n query CosListDatasets(\n $q: String\n $accessLevel: CosAccessLevel\n $format: String\n $collectionId: ID\n $sourceId: ID\n $status: CosDatasetStatus\n $pagination: PaginationInput\n ) {\n cosListDatasets(\n q: $q\n accessLevel: $accessLevel\n format: $format\n collectionId: $collectionId\n sourceId: $sourceId\n status: $status\n pagination: $pagination\n ) {\n items {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n ingestedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_DATASET_QUERY = gql`\n query CosDataset($id: ID!) {\n cosDataset(id: $id) {\n id\n workspaceId\n name\n description\n status\n accessLevel\n format\n sourceId\n collectionId\n rowCount\n sizeBytes\n version\n lineageCaptured\n coverage\n ingestedAt\n tags\n createdAt\n updatedAt\n file {\n id\n }\n source {\n id\n name\n type\n status\n }\n collection {\n id\n name\n slug\n }\n schemaFields {\n id\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const COS_SOURCES_QUERY = gql`\n query CosListSources(\n $type: CosSourceType\n $status: CosSourceStatus\n $pagination: PaginationInput\n ) {\n cosListSources(type: $type, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_SOURCE_QUERY = gql`\n query CosSource($id: ID!) {\n cosSource(id: $id) {\n id\n workspaceId\n name\n description\n type\n status\n endpoint\n config\n lastSyncedAt\n tags\n createdAt\n updatedAt\n datasets {\n id\n name\n status\n accessLevel\n rowCount\n updatedAt\n }\n }\n }\n`;\n\n/**\n * `datasets` is selected id-only so each card can show how many datasets the\n * collection holds. The subgraph resolves it through `collectionDatasetsLoader`\n * (one batched query for the whole page) and filters to the datasets THIS actor\n * may read, so the length is the caller's visible count — capped at\n * `COS_RELATION_PAGE_SIZE`.\n */\nexport const COS_COLLECTIONS_QUERY = gql`\n query CosListCollections {\n cosListCollections {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n datasets {\n id\n }\n }\n }\n`;\n\nexport const COS_COLLECTION_QUERY = gql`\n query CosCollection($id: ID!) {\n cosCollection(id: $id) {\n id\n workspaceId\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_SCHEMA_FIELDS_QUERY = gql`\n query CosListSchemaFields($datasetId: ID!) {\n cosListSchemaFields(datasetId: $datasetId) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PIPELINES_QUERY = gql`\n query CosListPipelines($status: CosPipelineStatus, $pagination: PaginationInput) {\n cosListPipelines(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n name\n description\n status\n workflowDefinitionId\n lastRunAt\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_PIPELINE_QUERY = gql`\n query CosPipeline($id: ID!) {\n cosPipeline(id: $id) {\n id\n workspaceId\n name\n description\n status\n steps\n workflowDefinitionId\n lastRunAt\n tags\n createdAt\n updatedAt\n runs {\n id\n runNumber\n status\n datasetId\n workflowRunId\n startedAt\n finishedAt\n durationMs\n createdAt\n }\n }\n }\n`;\n\nexport const COS_RUNS_QUERY = gql`\n query CosListRuns($pipelineId: ID, $status: CosRunStatus, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_RUN_QUERY = gql`\n query CosRun($id: ID!) {\n cosRun(id: $id) {\n id\n workspaceId\n pipelineId\n runNumber\n status\n datasetId\n workflowRunId\n params\n metrics\n triggeredBy\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n pipeline {\n id\n name\n status\n workflowDefinitionId\n }\n steps {\n id\n runId\n name\n kind\n position\n status\n startedAt\n finishedAt\n durationMs\n errorMessage\n }\n }\n }\n`;\n\n/**\n * Other FAILED runs of the same pipeline, newest first, each with its steps so\n * the caller can name the step that broke. `steps` resolves through\n * `pipelineRunStepsLoader`, so the whole list costs one extra batched query.\n */\nexport const COS_PIPELINE_FAILED_RUNS_QUERY = gql`\n query CosPipelineFailedRuns($pipelineId: ID!, $pagination: PaginationInput) {\n cosListRuns(pipelineId: $pipelineId, status: FAILED, pagination: $pagination) {\n items {\n id\n workspaceId\n pipelineId\n runNumber\n status\n errorMessage\n startedAt\n finishedAt\n createdAt\n updatedAt\n steps {\n id\n runId\n name\n kind\n position\n status\n errorMessage\n }\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * Minimal dataset lookup — resolves an id held on another entity (e.g.\n * `CosPipelineRun.datasetId`, which the SDL exposes as a bare ID with no\n * relation field) to something a human can read. Returns null when the caller\n * has no read access to that dataset, so callers must fall back to the id.\n */\nexport const COS_DATASET_SUMMARY_QUERY = gql`\n query CosDatasetSummary($id: ID!) {\n cosDataset(id: $id) {\n id\n name\n status\n accessLevel\n }\n }\n`;\n\nexport const COS_RUN_STEPS_QUERY = gql`\n query CosListRunSteps($runId: ID!) {\n cosListRunSteps(runId: $runId) {\n id\n workspaceId\n runId\n name\n kind\n position\n status\n inputs\n outputs\n logsRef\n startedAt\n finishedAt\n durationMs\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_NOTEBOOKS_QUERY = gql`\n query CosListNotebooks($status: CosNotebookStatus, $pagination: PaginationInput) {\n cosListNotebooks(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\nexport const COS_NOTEBOOK_QUERY = gql`\n query CosNotebook($id: ID!) {\n cosNotebook(id: $id) {\n id\n workspaceId\n title\n description\n status\n runtime\n environment\n datasetIds\n isShared\n shareSlug\n tags\n createdAt\n updatedAt\n file {\n id\n }\n analyses {\n id\n title\n status\n aiAssisted\n method\n createdAt\n }\n releases {\n id\n title\n version\n status\n publishedAt\n }\n }\n }\n`;\n\nexport const COS_ANALYSES_QUERY = gql`\n query CosListAnalyses($datasetId: ID, $notebookId: ID, $status: CosAnalysisStatus) {\n cosListAnalyses(datasetId: $datasetId, notebookId: $notebookId, status: $status) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\n/**\n * One analysis by id, independent of list paging and filters; the analyses\n * page falls back to it when the `?id=` analysis is not in the loaded list.\n */\nexport const COS_ANALYSIS_QUERY = gql`\n query CosAnalysis($id: ID!) {\n cosAnalysis(id: $id) {\n id\n workspaceId\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n results\n outputFile {\n id\n }\n startedAt\n finishedAt\n errorMessage\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_RELEASES_QUERY = gql`\n query CosListReleases($status: CosReleaseStatus, $pagination: PaginationInput) {\n cosListReleases(status: $status, pagination: $pagination) {\n items {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n pageInfo {\n hasMore\n cursor\n }\n }\n }\n`;\n\n/**\n * One release by id, independent of list paging and filters. The releases page\n * falls back to it when the `?id=` release is not on the loaded list page, so a\n * deep link or a command-palette Recent entry always reopens the release.\n */\nexport const COS_RELEASE_QUERY = gql`\n query CosRelease($id: ID!) {\n cosRelease(id: $id) {\n id\n workspaceId\n title\n version\n status\n abstract\n authors\n datasetIds\n notebookId\n doi\n license\n publishedAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ACCESS_GRANTS_QUERY = gql`\n query CosListAccessGrants($datasetId: ID, $status: CosGrantStatus) {\n cosListAccessGrants(datasetId: $datasetId, status: $status) {\n id\n workspaceId\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n revokedAt\n createdAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// PLATFORM REUSE — activity feed (wspace-activity-svc, federated on the\n// workspace supergraph). The cos mutation-audit plugin already writes these\n// ActivityLog rows via be-sdk `trackOperation`; this is the read surface,\n// scoped to a single cos entity by `resourceId`. Only scalar fields are\n// selected so no cross-subgraph entity resolution is required.\n// ============================================================================\n\nexport const COS_ACTIVITY_BY_RESOURCE_QUERY = gql`\n query CosResourceActivity($filter: ActivityLogFilter) {\n getActivities(filter: $filter) {\n id\n action\n description\n resourceType\n resourceId\n userId\n timestamp\n }\n }\n`;\n\n// ============================================================================\n// GQL DOCUMENTS — MUTATIONS\n// ============================================================================\n\nexport const COS_CREATE_DATASET_MUTATION = gql`\n mutation CosCreateDataset($input: CosCreateDatasetInput!) {\n cosCreateDataset(input: $input) {\n id\n name\n status\n accessLevel\n sourceId\n collectionId\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_DATASET_MUTATION = gql`\n mutation CosUpdateDataset($id: ID!, $input: CosUpdateDatasetInput!) {\n cosUpdateDataset(id: $id, input: $input) {\n id\n name\n description\n status\n accessLevel\n format\n collectionId\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_DATASET_MUTATION = gql`\n mutation CosPublishDataset($id: ID!) {\n cosPublishDataset(id: $id) {\n id\n status\n ingestedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_DATASET_MUTATION = gql`\n mutation CosArchiveDataset($id: ID!) {\n cosArchiveDataset(id: $id)\n }\n`;\n\nexport const COS_ADD_SCHEMA_FIELD_MUTATION = gql`\n mutation CosAddSchemaField($input: CosAddSchemaFieldInput!) {\n cosAddSchemaField(input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_SOURCE_MUTATION = gql`\n mutation CosCreateSource($input: CosCreateSourceInput!) {\n cosCreateSource(input: $input) {\n id\n name\n type\n status\n endpoint\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SOURCE_MUTATION = gql`\n mutation CosUpdateSource($id: ID!, $input: CosUpdateSourceInput!) {\n cosUpdateSource(id: $id, input: $input) {\n id\n name\n description\n type\n status\n endpoint\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_MARK_SOURCE_SYNCED_MUTATION = gql`\n mutation CosMarkSourceSynced($id: ID!) {\n cosMarkSourceSynced(id: $id) {\n id\n status\n lastSyncedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_SOURCE_MUTATION = gql`\n mutation CosArchiveSource($id: ID!) {\n cosArchiveSource(id: $id)\n }\n`;\n\nexport const COS_CREATE_COLLECTION_MUTATION = gql`\n mutation CosCreateCollection($input: CosCreateCollectionInput!) {\n cosCreateCollection(input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_COLLECTION_MUTATION = gql`\n mutation CosUpdateCollection($id: ID!, $input: CosUpdateCollectionInput!) {\n cosUpdateCollection(id: $id, input: $input) {\n id\n name\n slug\n description\n isPublic\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_COLLECTION_MUTATION = gql`\n mutation CosArchiveCollection($id: ID!) {\n cosArchiveCollection(id: $id)\n }\n`;\n\nexport const COS_CREATE_PIPELINE_MUTATION = gql`\n mutation CosCreatePipeline($input: CosCreatePipelineInput!) {\n cosCreatePipeline(input: $input) {\n id\n name\n status\n workflowDefinitionId\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_PIPELINE_MUTATION = gql`\n mutation CosUpdatePipeline($id: ID!, $input: CosUpdatePipelineInput!) {\n cosUpdatePipeline(id: $id, input: $input) {\n id\n name\n description\n status\n workflowDefinitionId\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_PIPELINE_MUTATION = gql`\n mutation CosArchivePipeline($id: ID!) {\n cosArchivePipeline(id: $id)\n }\n`;\n\nexport const COS_START_RUN_MUTATION = gql`\n mutation CosStartRun($input: CosStartRunInput!) {\n cosStartRun(input: $input) {\n id\n pipelineId\n runNumber\n status\n datasetId\n workflowRunId\n errorMessage\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_TRANSITION_RUN_MUTATION = gql`\n mutation CosTransitionRun($id: ID!, $status: CosRunStatus!) {\n cosTransitionRun(id: $id, status: $status) {\n id\n status\n startedAt\n finishedAt\n durationMs\n updatedAt\n }\n }\n`;\n\nexport const COS_ADD_RUN_STEP_MUTATION = gql`\n mutation CosAddRunStep($input: CosAddRunStepInput!) {\n cosAddRunStep(input: $input) {\n id\n runId\n name\n kind\n position\n status\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_NOTEBOOK_MUTATION = gql`\n mutation CosCreateNotebook($input: CosCreateNotebookInput!) {\n cosCreateNotebook(input: $input) {\n id\n title\n status\n runtime\n datasetIds\n tags\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_NOTEBOOK_MUTATION = gql`\n mutation CosUpdateNotebook($id: ID!, $input: CosUpdateNotebookInput!) {\n cosUpdateNotebook(id: $id, input: $input) {\n id\n title\n description\n status\n runtime\n datasetIds\n isShared\n shareSlug\n tags\n updatedAt\n }\n }\n`;\n\nexport const COS_ARCHIVE_NOTEBOOK_MUTATION = gql`\n mutation CosArchiveNotebook($id: ID!) {\n cosArchiveNotebook(id: $id)\n }\n`;\n\nexport const COS_RUN_ANALYSIS_MUTATION = gql`\n mutation CosRunAnalysis($input: CosRunAnalysisInput!) {\n cosRunAnalysis(input: $input) {\n id\n title\n status\n method\n aiAssisted\n notebookId\n datasetId\n startedAt\n createdAt\n }\n }\n`;\n\nexport const COS_COMPLETE_ANALYSIS_MUTATION = gql`\n mutation CosCompleteAnalysis(\n $id: ID!\n $status: CosAnalysisStatus!\n $results: JSON\n $outputFileId: ID\n ) {\n cosCompleteAnalysis(id: $id, status: $status, results: $results, outputFileId: $outputFileId) {\n id\n status\n results\n finishedAt\n errorMessage\n outputFile {\n id\n }\n updatedAt\n }\n }\n`;\n\nexport const COS_CREATE_RELEASE_MUTATION = gql`\n mutation CosCreateRelease($input: CosCreateReleaseInput!) {\n cosCreateRelease(input: $input) {\n id\n title\n version\n status\n authors\n datasetIds\n notebookId\n license\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_PUBLISH_RELEASE_MUTATION = gql`\n mutation CosPublishRelease($id: ID!, $doi: String, $mintDoi: Boolean) {\n cosPublishRelease(id: $id, doi: $doi, mintDoi: $mintDoi) {\n id\n status\n doi\n publishedAt\n updatedAt\n }\n }\n`;\n\nexport const COS_MINT_DOI_MUTATION = gql`\n mutation CosMintDoi($releaseId: ID!) {\n cosMintDoi(releaseId: $releaseId) {\n id\n doi\n state\n mode\n errorMessage\n mintedAt\n }\n }\n`;\n\nexport const COS_GRANT_ACCESS_MUTATION = gql`\n mutation CosGrantAccess($input: CosGrantAccessInput!) {\n cosGrantAccess(input: $input) {\n id\n datasetId\n granteeId\n status\n scopes\n reason\n grantedAt\n expiresAt\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REVOKE_ACCESS_MUTATION = gql`\n mutation CosRevokeAccess($id: ID!) {\n cosRevokeAccess(id: $id) {\n id\n status\n revokedAt\n updatedAt\n }\n }\n`;\n\n// ============================================================================\n// RESPONSE / VARIABLES TYPES\n// ============================================================================\n\nexport interface CosHealthQueryData {\n cosHealth: string;\n}\n\nexport interface CosDatasetsQueryData {\n cosListDatasets: CosConnection<CosDataset>;\n}\nexport interface CosDatasetsQueryVars {\n /** Full-text search across dataset name/description/tags (backend `q` arg). */\n q?: string;\n accessLevel?: CosAccessLevel;\n format?: string;\n collectionId?: string;\n sourceId?: string;\n status?: CosDatasetStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosDatasetQueryData {\n cosDataset: CosDataset | null;\n}\n\nexport interface CosSourcesQueryData {\n cosListSources: CosConnection<CosSource>;\n}\nexport interface CosSourcesQueryVars {\n type?: CosSourceType;\n status?: CosSourceStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosSourceQueryData {\n cosSource: CosSource | null;\n}\n\n/**\n * Row shape of `cosListCollections` — same as `CosCollection` except `datasets`\n * is the id-only selection COS_COLLECTIONS_QUERY makes, so the list page can\n * size each collection without over-fetching dataset bodies.\n */\nexport interface CosCollectionListItem extends Omit<CosCollection, 'datasets'> {\n datasets: CosIdRef[];\n}\n\nexport interface CosCollectionsQueryData {\n cosListCollections: CosCollectionListItem[];\n}\n\nexport interface CosCollectionQueryData {\n cosCollection: CosCollection | null;\n}\n\nexport interface CosSchemaFieldsQueryData {\n cosListSchemaFields: CosSchemaField[];\n}\n\nexport interface CosPipelinesQueryData {\n cosListPipelines: CosConnection<CosPipeline>;\n}\nexport interface CosPipelinesQueryVars {\n status?: CosPipelineStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosPipelineQueryData {\n cosPipeline: CosPipeline | null;\n}\n\nexport interface CosRunsQueryData {\n cosListRuns: CosConnection<CosPipelineRun>;\n}\nexport interface CosRunsQueryVars {\n pipelineId?: string;\n status?: CosRunStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosRunQueryData {\n cosRun: CosPipelineRun | null;\n}\n\nexport interface CosRunStepsQueryData {\n cosListRunSteps: CosPipelineStep[];\n}\n\n/** Row of COS_PIPELINE_FAILED_RUNS_QUERY — `steps` is always selected. */\nexport interface CosFailedRunListItem extends Omit<CosPipelineRun, 'steps'> {\n steps: CosPipelineStep[];\n}\n\nexport interface CosPipelineFailedRunsQueryData {\n cosListRuns: CosConnection<CosFailedRunListItem>;\n}\nexport interface CosPipelineFailedRunsQueryVars {\n pipelineId: string;\n pagination?: CosPaginationInput;\n}\n\n/** Just enough of a dataset to render its name in place of a bare id. */\nexport interface CosDatasetSummary {\n id: string;\n name: string;\n status: CosDatasetStatus;\n accessLevel: CosAccessLevel;\n}\n\nexport interface CosDatasetSummaryQueryData {\n cosDataset: CosDatasetSummary | null;\n}\n\nexport interface CosNotebooksQueryData {\n cosListNotebooks: CosConnection<CosNotebook>;\n}\nexport interface CosNotebooksQueryVars {\n status?: CosNotebookStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosNotebookQueryData {\n cosNotebook: CosNotebook | null;\n}\n\nexport interface CosAnalysesQueryData {\n cosListAnalyses: CosAnalysis[];\n}\nexport interface CosAnalysesQueryVars {\n datasetId?: string;\n notebookId?: string;\n status?: CosAnalysisStatus;\n}\n\nexport interface CosAnalysisQueryData {\n cosAnalysis: CosAnalysis | null;\n}\nexport interface CosReleaseQueryData {\n cosRelease: CosRelease | null;\n}\nexport interface CosReleasesQueryData {\n cosListReleases: CosConnection<CosRelease>;\n}\nexport interface CosReleasesQueryVars {\n status?: CosReleaseStatus;\n pagination?: CosPaginationInput;\n}\n\nexport interface CosAccessGrantsQueryData {\n cosListAccessGrants: CosDataAccessGrant[];\n}\nexport interface CosAccessGrantsQueryVars {\n datasetId?: string;\n status?: CosGrantStatus;\n}\n\n/** A single platform activity record (subset of wspace-activity-svc ActivityLog). */\nexport interface CosActivityEntry {\n id: string;\n action: string;\n description?: string | null;\n resourceType?: string | null;\n resourceId?: string | null;\n userId: string;\n timestamp: string;\n}\n\nexport interface CosActivityQueryData {\n getActivities: CosActivityEntry[];\n}\n\n/** Mirrors ActivityLogFilter — only the fields the cos activity panel needs. */\nexport interface CosActivityFilter {\n workspaceId?: string;\n resourceId?: string;\n resourceType?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface CosActivityQueryVars {\n filter?: CosActivityFilter;\n}\n\n// ============================================================================\n// QUERY HOOKS\n// ============================================================================\n\nexport const useCosHealthQuery = () => useQuery<CosHealthQueryData>(COS_HEALTH_QUERY);\n\nexport const useCosDatasetsQuery = (variables: CosDatasetsQueryVars = {}) =>\n useQuery<CosDatasetsQueryData, CosDatasetsQueryVars>(COS_DATASETS_QUERY, { variables });\n\nexport const useCosDatasetQuery = (id: string) =>\n useQuery<CosDatasetQueryData, { id: string }>(COS_DATASET_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSourcesQuery = (variables: CosSourcesQueryVars = {}) =>\n useQuery<CosSourcesQueryData, CosSourcesQueryVars>(COS_SOURCES_QUERY, { variables });\n\nexport const useCosSourceQuery = (id: string) =>\n useQuery<CosSourceQueryData, { id: string }>(COS_SOURCE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosCollectionsQuery = () =>\n useQuery<CosCollectionsQueryData>(COS_COLLECTIONS_QUERY);\n\nexport const useCosCollectionQuery = (id: string) =>\n useQuery<CosCollectionQueryData, { id: string }>(COS_COLLECTION_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosSchemaFieldsQuery = (datasetId: string) =>\n useQuery<CosSchemaFieldsQueryData, { datasetId: string }>(COS_SCHEMA_FIELDS_QUERY, {\n variables: { datasetId },\n skip: !datasetId,\n });\n\n// ---------------------------------------------------------------------------\n// Canonical workflows (wspace-workflow-svc) — the pipeline automation link\n// (OVL-09, BOFF-5232). Workflows are owned by the shared engine; CosmicIntersection\n// stores only the chosen definition's opaque id on CosPipeline.workflowDefinitionId.\n// ---------------------------------------------------------------------------\nexport interface CosWorkflowOption {\n id: string;\n name: string;\n workflowKey: string;\n version: string;\n}\n\nexport const COS_RUNNABLE_WORKFLOWS_QUERY = gql`\n query CosRunnableWorkflows($input: ListWorkflowDefinitionsInput!) {\n workflowDefinitions(input: $input) {\n items {\n id\n name\n workflowKey\n version\n }\n total\n hasMore\n }\n }\n`;\n\nexport const COS_WORKFLOW_DEFINITION_QUERY = gql`\n query CosWorkflowDefinition($id: ID!) {\n workflowDefinition(id: $id) {\n id\n name\n workflowKey\n version\n status\n }\n }\n`;\n\n/** One page is plenty for a picker; the engine caps a list at this size. */\nexport const MAX_WORKFLOW_OPTIONS = 100;\n\nexport const useRunnableWorkflowsQuery = () =>\n useQuery<{\n workflowDefinitions: { items: CosWorkflowOption[]; total: number; hasMore: boolean };\n }>(COS_RUNNABLE_WORKFLOWS_QUERY, {\n variables: { input: { status: 'ACTIVE', limit: MAX_WORKFLOW_OPTIONS, offset: 0 } },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useWorkflowDefinitionQuery = (id: string | null | undefined) =>\n useQuery<{ workflowDefinition: (CosWorkflowOption & { status: string }) | null }, { id: string }>(\n COS_WORKFLOW_DEFINITION_QUERY,\n { variables: { id: id ?? '' }, skip: !id }\n );\n\nexport const useCosPipelinesQuery = (variables: CosPipelinesQueryVars = {}) =>\n useQuery<CosPipelinesQueryData, CosPipelinesQueryVars>(COS_PIPELINES_QUERY, { variables });\n\nexport const useCosPipelineQuery = (id: string) =>\n useQuery<CosPipelineQueryData, { id: string }>(COS_PIPELINE_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunsQuery = (variables: CosRunsQueryVars = {}) =>\n useQuery<CosRunsQueryData, CosRunsQueryVars>(COS_RUNS_QUERY, { variables });\n\nexport const useCosRunQuery = (id: string) =>\n useQuery<CosRunQueryData, { id: string }>(COS_RUN_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosRunStepsQuery = (runId: string) =>\n useQuery<CosRunStepsQueryData, { runId: string }>(COS_RUN_STEPS_QUERY, {\n variables: { runId },\n skip: !runId,\n });\n\n/**\n * Failed runs of one pipeline. Skipped until a pipelineId is known so the run\n * detail page can call it unconditionally while its own query is still loading.\n */\nexport const useCosPipelineFailedRunsQuery = (\n pipelineId: string | undefined,\n options: { limit?: number; skip?: boolean } = {}\n) =>\n useQuery<CosPipelineFailedRunsQueryData, CosPipelineFailedRunsQueryVars>(\n COS_PIPELINE_FAILED_RUNS_QUERY,\n {\n variables: {\n pipelineId: pipelineId ?? '',\n pagination: { limit: options.limit ?? 20, offset: 0 },\n },\n skip: !pipelineId || options.skip === true,\n }\n );\n\n/** Resolves a dataset id to its name. Returns null data when unreadable. */\nexport const useCosDatasetSummaryQuery = (id: string | null | undefined) =>\n useQuery<CosDatasetSummaryQueryData, { id: string }>(COS_DATASET_SUMMARY_QUERY, {\n variables: { id: id ?? '' },\n skip: !id,\n });\n\nexport const useCosNotebooksQuery = (variables: CosNotebooksQueryVars = {}) =>\n useQuery<CosNotebooksQueryData, CosNotebooksQueryVars>(COS_NOTEBOOKS_QUERY, { variables });\n\nexport const useCosNotebookQuery = (id: string) =>\n useQuery<CosNotebookQueryData, { id: string }>(COS_NOTEBOOK_QUERY, {\n variables: { id },\n skip: !id,\n });\n\nexport const useCosAnalysesQuery = (variables: CosAnalysesQueryVars = {}) =>\n useQuery<CosAnalysesQueryData, CosAnalysesQueryVars>(COS_ANALYSES_QUERY, { variables });\n\nexport const useCosReleasesQuery = (variables: CosReleasesQueryVars = {}) =>\n useQuery<CosReleasesQueryData, CosReleasesQueryVars>(COS_RELEASES_QUERY, { variables });\n\n/** One analysis by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosAnalysisQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosAnalysisQueryData, { id: string }>(COS_ANALYSIS_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\n/** One release by id; skipped while `id` is empty or `skip` is set. */\nexport const useCosReleaseQuery = (\n id: string | null | undefined,\n options: { skip?: boolean } = {}\n) =>\n useQuery<CosReleaseQueryData, { id: string }>(COS_RELEASE_QUERY, {\n variables: { id: id ?? '' },\n skip: !id || options.skip === true,\n });\n\nexport const useCosAccessGrantsQuery = (variables: CosAccessGrantsQueryVars = {}) =>\n useQuery<CosAccessGrantsQueryData, CosAccessGrantsQueryVars>(COS_ACCESS_GRANTS_QUERY, {\n variables,\n });\n\n/**\n * Resource-scoped platform activity for a single cos entity. RBAC on\n * `getActivities` scopes on `filter.workspaceId`, so both a workspaceId and the\n * entity's resourceId are required — the query is skipped until both are known.\n */\nexport const useCosResourceActivityQuery = (params: {\n workspaceId?: string;\n resourceId: string;\n resourceType?: string;\n limit?: number;\n}) => {\n const { workspaceId, resourceId, resourceType, limit = 20 } = params;\n return useQuery<CosActivityQueryData, CosActivityQueryVars>(COS_ACTIVITY_BY_RESOURCE_QUERY, {\n variables: { filter: { workspaceId, resourceId, resourceType, limit } },\n skip: !workspaceId || !resourceId,\n fetchPolicy: 'cache-and-network',\n });\n};\n\n// ============================================================================\n// MUTATION HOOKS\n// ============================================================================\n\nexport const useCosCreateDatasetMutation = () =>\n useMutation<{ cosCreateDataset: CosDataset }, { input: CosCreateDatasetInput }>(\n COS_CREATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosUpdateDatasetMutation = () =>\n useMutation<{ cosUpdateDataset: CosDataset }, { id: string; input: CosUpdateDatasetInput }>(\n COS_UPDATE_DATASET_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n }\n );\n\nexport const useCosPublishDatasetMutation = () =>\n useMutation<{ cosPublishDataset: CosDataset }, { id: string }>(COS_PUBLISH_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosArchiveDatasetMutation = () =>\n useMutation<{ cosArchiveDataset: boolean }, { id: string }>(COS_ARCHIVE_DATASET_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_DATASETS_QUERY }],\n });\n\nexport const useCosAddSchemaFieldMutation = () =>\n useMutation<{ cosAddSchemaField: CosSchemaField }, { input: CosAddSchemaFieldInput }>(\n COS_ADD_SCHEMA_FIELD_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateSourceMutation = () =>\n useMutation<{ cosCreateSource: CosSource }, { input: CosCreateSourceInput }>(\n COS_CREATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosUpdateSourceMutation = () =>\n useMutation<{ cosUpdateSource: CosSource }, { id: string; input: CosUpdateSourceInput }>(\n COS_UPDATE_SOURCE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_SOURCES_QUERY }] }\n );\n\nexport const useCosMarkSourceSyncedMutation = () =>\n useMutation<{ cosMarkSourceSynced: CosSource }, { id: string }>(COS_MARK_SOURCE_SYNCED_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosArchiveSourceMutation = () =>\n useMutation<{ cosArchiveSource: boolean }, { id: string }>(COS_ARCHIVE_SOURCE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_SOURCES_QUERY }],\n });\n\nexport const useCosCreateCollectionMutation = () =>\n useMutation<{ cosCreateCollection: CosCollection }, { input: CosCreateCollectionInput }>(\n COS_CREATE_COLLECTION_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n }\n );\n\nexport const useCosUpdateCollectionMutation = () =>\n useMutation<\n { cosUpdateCollection: CosCollection },\n { id: string; input: CosUpdateCollectionInput }\n >(COS_UPDATE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosArchiveCollectionMutation = () =>\n useMutation<{ cosArchiveCollection: boolean }, { id: string }>(COS_ARCHIVE_COLLECTION_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_COLLECTIONS_QUERY }],\n });\n\nexport const useCosCreatePipelineMutation = () =>\n useMutation<{ cosCreatePipeline: CosPipeline }, { input: CosCreatePipelineInput }>(\n COS_CREATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosUpdatePipelineMutation = () =>\n useMutation<{ cosUpdatePipeline: CosPipeline }, { id: string; input: CosUpdatePipelineInput }>(\n COS_UPDATE_PIPELINE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n }\n );\n\nexport const useCosArchivePipelineMutation = () =>\n useMutation<{ cosArchivePipeline: boolean }, { id: string }>(COS_ARCHIVE_PIPELINE_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_PIPELINES_QUERY }],\n });\n\nexport const useCosStartRunMutation = () =>\n useMutation<{ cosStartRun: CosPipelineRun }, { input: CosStartRunInput }>(\n COS_START_RUN_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RUNS_QUERY }],\n }\n );\n\nexport const useCosTransitionRunMutation = () =>\n useMutation<{ cosTransitionRun: CosPipelineRun }, { id: string; status: CosRunStatus }>(\n COS_TRANSITION_RUN_MUTATION,\n { errorPolicy: 'all', onError: onMutationError, refetchQueries: [{ query: COS_RUNS_QUERY }] }\n );\n\nexport const useCosAddRunStepMutation = () =>\n useMutation<{ cosAddRunStep: CosPipelineStep }, { input: CosAddRunStepInput }>(\n COS_ADD_RUN_STEP_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosCreateNotebookMutation = () =>\n useMutation<{ cosCreateNotebook: CosNotebook }, { input: CosCreateNotebookInput }>(\n COS_CREATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosUpdateNotebookMutation = () =>\n useMutation<{ cosUpdateNotebook: CosNotebook }, { id: string; input: CosUpdateNotebookInput }>(\n COS_UPDATE_NOTEBOOK_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n }\n );\n\nexport const useCosArchiveNotebookMutation = () =>\n useMutation<{ cosArchiveNotebook: boolean }, { id: string }>(COS_ARCHIVE_NOTEBOOK_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_NOTEBOOKS_QUERY }],\n });\n\nexport const useCosRunAnalysisMutation = () =>\n useMutation<{ cosRunAnalysis: CosAnalysis }, { input: CosRunAnalysisInput }>(\n COS_RUN_ANALYSIS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n }\n );\n\nexport const useCosCompleteAnalysisMutation = () =>\n useMutation<\n { cosCompleteAnalysis: CosAnalysis },\n {\n id: string;\n status: Extract<CosAnalysisStatus, 'COMPLETED' | 'FAILED'>;\n results?: Record<string, unknown>;\n outputFileId?: string;\n }\n >(COS_COMPLETE_ANALYSIS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ANALYSES_QUERY }],\n });\n\nexport const useCosCreateReleaseMutation = () =>\n useMutation<{ cosCreateRelease: CosRelease }, { input: CosCreateReleaseInput }>(\n COS_CREATE_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosPublishReleaseMutation = () =>\n useMutation<{ cosPublishRelease: CosRelease }, { id: string; doi?: string; mintDoi?: boolean }>(\n COS_PUBLISH_RELEASE_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n }\n );\n\nexport const useCosMintDoiMutation = () =>\n useMutation<\n {\n cosMintDoi: {\n id: string;\n doi?: string | null;\n state: string;\n mode: string;\n errorMessage?: string | null;\n mintedAt?: string | null;\n };\n },\n { releaseId: string }\n >(COS_MINT_DOI_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_RELEASES_QUERY }],\n });\n\nexport const useCosGrantAccessMutation = () =>\n useMutation<{ cosGrantAccess: CosDataAccessGrant }, { input: CosGrantAccessInput }>(\n COS_GRANT_ACCESS_MUTATION,\n {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n }\n );\n\nexport const useCosRevokeAccessMutation = () =>\n useMutation<{ cosRevokeAccess: CosDataAccessGrant }, { id: string }>(COS_REVOKE_ACCESS_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n refetchQueries: [{ query: COS_ACCESS_GRANTS_QUERY }],\n });\n\n// ============================================================================\n// AI DECISION ENGINE OPERATIONS (BOFF-3814)\n// ============================================================================\n\n/**\n * Propose one schema field per dataset column. Writes nothing — accepting a\n * suggestion is the separate, human-pressed `cosAddSchemaField` call.\n */\nexport const COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION = gql`\n mutation CosAiProposeSchemaFields($datasetId: ID!, $sample: CosSchemaSampleInput) {\n cosAiProposeSchemaFields(datasetId: $datasetId, sample: $sample) {\n datasetId\n sampleOrigin\n sampledRows\n fields {\n name\n fieldType\n unit\n nullable\n position\n description\n provenanceNote\n confidence\n reasons\n sampledValues\n emptyValues\n alreadyDefined\n existingFieldId\n conflicts\n }\n notes\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\n/**\n * Recommend what to do with a finished run, with rationale + the telemetry it\n * read as evidence. Writes nothing — applying the recommendation is the\n * human-pressed mutation named in `proposedAction`.\n */\nexport const COS_AI_TRIAGE_RUN_MUTATION = gql`\n mutation CosAiTriageRun($runId: ID!) {\n cosAiTriageRun(runId: $runId) {\n runId\n action\n confidence\n rationale\n signals {\n code\n severity\n message\n }\n evidence {\n kind\n refId\n field\n value\n }\n metrics {\n rowsIn\n rowsOut\n anomaliesFlagged\n warnings\n anomalyRate\n rowLossRate\n baselineAnomalyRate\n }\n suggestedParams\n proposedAction {\n mutation\n targetId\n arguments\n description\n }\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\n/**\n * Draft a release from a notebook. Writes nothing — `cosCreateRelease` and\n * the confirmed `cosPublishRelease` stay human actions.\n */\nexport const COS_AI_DRAFT_RELEASE_MUTATION = gql`\n mutation CosAiDraftRelease($notebookId: ID!) {\n cosAiDraftRelease(notebookId: $notebookId) {\n notebookId\n title\n abstract\n version\n authors\n authorSuggestions {\n actorId\n roles\n contributions\n }\n license\n licenseRationale\n datasetIds\n analysisIds\n warnings\n notes\n agentRunId\n engineVersion\n method\n generatedAt\n }\n }\n`;\n\nexport const COS_UPDATE_SCHEMA_FIELD_MUTATION = gql`\n mutation CosUpdateSchemaField($id: ID!, $input: CosUpdateSchemaFieldInput!) {\n cosUpdateSchemaField(id: $id, input: $input) {\n id\n workspaceId\n datasetId\n name\n fieldType\n unit\n description\n nullable\n position\n provenance\n createdAt\n updatedAt\n }\n }\n`;\n\nexport const COS_REMOVE_SCHEMA_FIELD_MUTATION = gql`\n mutation CosRemoveSchemaField($id: ID!) {\n cosRemoveSchemaField(id: $id)\n }\n`;\n\nexport const COS_SEMANTIC_SEARCH_QUERY = gql`\n query CosSemanticSearch($input: CosSemanticSearchInput!) {\n cosSemanticSearch(input: $input) {\n query\n interpretedTerms\n expandedTerms\n timeWindow {\n fromYear\n toYear\n }\n total\n hits {\n entityType\n id\n title\n snippet\n score\n dataset {\n id\n name\n status\n accessLevel\n format\n }\n collection {\n id\n name\n }\n release {\n id\n title\n status\n }\n notebook {\n id\n title\n status\n }\n evidence {\n kind\n entityId\n label\n text\n }\n lineage {\n kind\n id\n label\n relation\n parentId\n }\n }\n }\n }\n`;\n\nexport const useCosAiProposeSchemaFieldsMutation = () =>\n useMutation<\n { cosAiProposeSchemaFields: CosSchemaFieldProposal },\n { datasetId: string; sample?: { columns?: string[]; rows: unknown } }\n >(COS_AI_PROPOSE_SCHEMA_FIELDS_MUTATION, { errorPolicy: 'all', onError: onMutationError });\n\nexport const useCosAiTriageRunMutation = () =>\n useMutation<{ cosAiTriageRun: CosRunTriage }, { runId: string }>(COS_AI_TRIAGE_RUN_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n });\n\nexport const useCosAiDraftReleaseMutation = () =>\n useMutation<{ cosAiDraftRelease: CosReleaseDraft }, { notebookId: string }>(\n COS_AI_DRAFT_RELEASE_MUTATION,\n { errorPolicy: 'all', onError: onMutationError }\n );\n\nexport const useCosUpdateSchemaFieldMutation = () =>\n useMutation<\n { cosUpdateSchemaField: CosSchemaField },\n { id: string; input: CosUpdateSchemaFieldInput }\n >(COS_UPDATE_SCHEMA_FIELD_MUTATION, { errorPolicy: 'all', onError: onMutationError });\n\nexport const useCosRemoveSchemaFieldMutation = () =>\n useMutation<{ cosRemoveSchemaField: boolean }, { id: string }>(COS_REMOVE_SCHEMA_FIELD_MUTATION, {\n errorPolicy: 'all',\n onError: onMutationError,\n });\n\nexport const useCosSemanticSearchLazyQuery = () =>\n useLazyQuery<{ cosSemanticSearch: CosSearchResults }, { input: CosSemanticSearchInput }>(\n COS_SEMANTIC_SEARCH_QUERY\n );\n\n// ============================================================================\n// ARCHIVE — MAST mission-specific search (BOFF-5786)\n// ============================================================================\n\nexport type CosArchiveMission =\n | 'HST'\n | 'JWST'\n | 'TESS'\n | 'KEPLER'\n | 'K2'\n | 'PANSTARRS'\n | 'GALEX'\n | 'SWIFT'\n | 'IUE'\n | 'FUSE'\n | 'EUVE'\n | 'SPITZER';\n\nexport interface CosArchiveFilterInput {\n column: string;\n values: string[];\n}\n\nexport interface CosArchiveSearchInput {\n missions?: CosArchiveMission[];\n targetName?: string;\n ra?: number;\n dec?: number;\n radiusDeg?: number;\n filters?: CosArchiveFilterInput[];\n limit?: number;\n page?: number;\n}\n\nexport interface CosArchiveProductsInput {\n productGroupId: string;\n productTypes?: string[];\n limit?: number;\n page?: number;\n}\n\nexport interface CosArchiveColumnValue {\n name: string;\n value: string;\n}\n\nexport interface CosArchiveObservation {\n mission: CosArchiveMission | null;\n missionCollection: string;\n observationId: string;\n productGroupId: string;\n targetName: string | null;\n ra: number | null;\n dec: number | null;\n instrument: string | null;\n filters: string | null;\n dataProductType: string | null;\n calibLevel: number | null;\n proposalId: string | null;\n principalInvestigator: string | null;\n startTimeMjd: number | null;\n exposureSec: number | null;\n dataRights: string | null;\n distanceDeg: number | null;\n previewUri: string | null;\n dataUri: string | null;\n previewUrl: string | null;\n dataFileUrl: string | null;\n extraColumns: CosArchiveColumnValue[];\n}\n\nexport interface CosArchiveSearchResults {\n targetName: string | null;\n ra: number | null;\n dec: number | null;\n radiusDeg: number;\n missions: CosArchiveMission[];\n page: number;\n limit: number;\n observations: CosArchiveObservation[];\n total: number;\n}\n\nexport interface CosArchiveProduct {\n uri: string;\n fileName: string;\n productType: string;\n description: string | null;\n mission: string | null;\n dataProductType: string | null;\n sizeBytes: number | null;\n downloadUrl: string;\n}\n\nexport const COS_ARCHIVE_MISSIONS_QUERY = gql`\n query CosArchiveMissions {\n cosArchiveMissions\n }\n`;\n\nexport const COS_ARCHIVE_SEARCH_QUERY = gql`\n query CosSearchArchive($input: CosArchiveSearchInput!) {\n cosSearchArchive(input: $input) {\n targetName\n ra\n dec\n radiusDeg\n missions\n page\n limit\n total\n observations {\n mission\n missionCollection\n observationId\n productGroupId\n targetName\n ra\n dec\n instrument\n filters\n dataProductType\n calibLevel\n proposalId\n principalInvestigator\n startTimeMjd\n exposureSec\n dataRights\n distanceDeg\n previewUri\n dataUri\n previewUrl\n dataFileUrl\n extraColumns {\n name\n value\n }\n }\n }\n }\n`;\n\nexport const COS_ARCHIVE_PRODUCTS_QUERY = gql`\n query CosListArchiveProducts($input: CosArchiveProductsInput!) {\n cosListArchiveProducts(input: $input) {\n uri\n fileName\n productType\n description\n mission\n dataProductType\n sizeBytes\n downloadUrl\n }\n }\n`;\n\nexport const useCosArchiveMissionsQuery = () =>\n useQuery<{ cosArchiveMissions: CosArchiveMission[] }>(COS_ARCHIVE_MISSIONS_QUERY);\n\nexport const useCosArchiveSearchLazyQuery = () =>\n useLazyQuery<{ cosSearchArchive: CosArchiveSearchResults }, { input: CosArchiveSearchInput }>(\n COS_ARCHIVE_SEARCH_QUERY\n );\n\nexport const useCosAr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WACXL,EACEE,EACF,GAEWI,WACXN,EACEG,EACF"}
@@ -10,4 +10,3 @@ export interface DatabricksRequestScope {
10
10
  projectId?: string;
11
11
  }
12
12
  export declare function databricksRequest<T>(scope: DatabricksRequestScope, document: DocumentNode, variables: Record<string, unknown>, signal: AbortSignal): Promise<T>;
13
- //# sourceMappingURL=databricksTransport.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { getStoredOrganizationId as e, getStoredProjectId as t, graphqlFetchPinned as n, prepareWorkspaceRequest as r, resolveGatewayUrl as i } from "@burdenoff/fe-libs/shared/graphql";
2
2
  import { print as a } from "graphql";
3
- //#region src/cosmicintersection/api/databricksTransport.ts
3
+ // src/cosmicintersection/api/databricksTransport.ts
4
4
  async function o(o, s, c, l) {
5
5
  let u = { ...o }, d = () => {
6
6
  if ((u.organizationId ?? null) !== (e() ?? null) || (u.projectId ?? null) !== (t() ?? null)) throw Error("The active context changed. Reopen the Databricks panel before continuing.");
@@ -32,7 +32,6 @@ async function o(o, s, c, l) {
32
32
  if (d(), m.assertCurrent(), h.errors?.length || h.data == null) throw Error("Databricks request was not confirmed. Refresh status before retrying.");
33
33
  return h.data;
34
34
  }
35
- //#endregion
36
35
  export { o as databricksRequest };
37
36
 
38
37
  //# sourceMappingURL=databricksTransport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"databricksTransport.js","names":[],"sources":["../../../src/cosmicintersection/api/databricksTransport.ts"],"sourcesContent":["import { print, type DocumentNode } from 'graphql';\nimport {\n getStoredOrganizationId,\n getStoredProjectId,\n graphqlFetchPinned,\n prepareWorkspaceRequest,\n resolveGatewayUrl,\n} from '@burdenoff/fe-libs/shared/graphql';\n\n/** Captured by the mounted run panel; never persisted or used as a cache key. */\nexport interface DatabricksRequestScope {\n apiGatewayUrl: string;\n authToken: string;\n actorId: string;\n workspaceId: string;\n tenantId?: string;\n organizationId?: string;\n projectId?: string;\n}\n\nexport async function databricksRequest<T>(\n scope: DatabricksRequestScope,\n document: DocumentNode,\n variables: Record<string, unknown>,\n signal: AbortSignal\n): Promise<T> {\n const captured = { ...scope };\n const assertCapturedContext = () => {\n if (\n (captured.organizationId ?? null) !== (getStoredOrganizationId() ?? null) ||\n (captured.projectId ?? null) !== (getStoredProjectId() ?? null)\n ) {\n throw new Error('The active context changed. Reopen the Databricks panel before continuing.');\n }\n };\n assertCapturedContext();\n const url = resolveGatewayUrl('workspace', captured.apiGatewayUrl);\n const query = print(document);\n const prepared = await prepareWorkspaceRequest({\n url,\n authToken: captured.authToken,\n actorId: captured.actorId,\n workspaceId: captured.workspaceId,\n tenantId: captured.tenantId,\n currentQuery: query,\n signal,\n });\n assertCapturedContext();\n prepared.assertCurrent();\n const response = await graphqlFetchPinned<T>({\n gateway: 'workspace',\n // Pinned fetch resolves the endpoint itself; preparation needs the full URL.\n baseUrl: captured.apiGatewayUrl,\n query,\n variables,\n authToken: captured.authToken,\n workspaceToken: prepared.workspaceToken,\n workspaceId: captured.workspaceId,\n organizationId: captured.organizationId ?? false,\n tenantId: captured.tenantId ?? false,\n projectId: captured.projectId ?? false,\n signal,\n });\n assertCapturedContext();\n prepared.assertCurrent();\n if (response.errors?.length || response.data == null) {\n throw new Error('Databricks request was not confirmed. Refresh status before retrying.');\n }\n return response.data;\n}\n"],"mappings":";;;AAoBA,eAAsB,EACpB,GACA,GACA,GACA,GACY;CACZ,IAAM,IAAW,EAAE,GAAG,EAAM,GACtB,UAA8B;EAClC,KACG,EAAS,kBAAkB,WAAW,EAAwB,KAAK,UACnE,EAAS,aAAa,WAAW,EAAmB,KAAK,OAE1D,MAAU,MAAM,4EAA4E;CAEhG;CACA,EAAsB;CACtB,IAAM,IAAM,EAAkB,aAAa,EAAS,aAAa,GAC3D,IAAQ,EAAM,CAAQ,GACtB,IAAW,MAAM,EAAwB;EAC7C;EACA,WAAW,EAAS;EACpB,SAAS,EAAS;EAClB,aAAa,EAAS;EACtB,UAAU,EAAS;EACnB,cAAc;EACd;CACF,CAAC;CAED,AADA,EAAsB,GACtB,EAAS,cAAc;CACvB,IAAM,IAAW,MAAM,EAAsB;EAC3C,SAAS;EAET,SAAS,EAAS;EAClB;EACA;EACA,WAAW,EAAS;EACpB,gBAAgB,EAAS;EACzB,aAAa,EAAS;EACtB,gBAAgB,EAAS,kBAAkB;EAC3C,UAAU,EAAS,YAAY;EAC/B,WAAW,EAAS,aAAa;EACjC;CACF,CAAC;CAGD,IAFA,EAAsB,GACtB,EAAS,cAAc,GACnB,EAAS,QAAQ,UAAU,EAAS,QAAQ,MAC9C,MAAU,MAAM,uEAAuE;CAEzF,OAAO,EAAS;AAClB"}
1
+ {"version":3,"file":"databricksTransport.js","names":["databricksRequest","captured","scope","assertCapturedContext","getStoredOrganizationId","getStoredProjectId","url","resolveGatewayUrl","query","print","document","prepared","prepareWorkspaceRequest","response","graphqlFetchPinned"],"sources":["../../../src/cosmicintersection/api/databricksTransport.ts"],"sourcesContent":["import { print, type DocumentNode } from 'graphql';\nimport {\n getStoredOrganizationId,\n getStoredProjectId,\n graphqlFetchPinned,\n prepareWorkspaceRequest,\n resolveGatewayUrl,\n} from '@burdenoff/fe-libs/shared/graphql';\n\n/** Captured by the mounted run panel; never persisted or used as a cache key. */\nexport interface DatabricksRequestScope {\n apiGatewayUrl: string;\n authToken: string;\n actorId: string;\n workspaceId: string;\n tenantId?: string;\n organizationId?: string;\n projectId?: string;\n}\n\nexport async function databricksRequest<T>(\n scope: DatabricksRequestScope,\n document: DocumentNode,\n variables: Record<string, unknown>,\n signal: AbortSignal\n): Promise<T> {\n const captured = { ...scope };\n const assertCapturedContext = () => {\n if (\n (captured.organizationId ?? null) !== (getStoredOrganizationId() ?? null) ||\n (captured.projectId ?? null) !== (getStoredProjectId() ?? null)\n ) {\n throw new Error('The active context changed. Reopen the Databricks panel before continuing.');\n }\n };\n assertCapturedContext();\n const url = resolveGatewayUrl('workspace', captured.apiGatewayUrl);\n const query = print(document);\n const prepared = await prepareWorkspaceRequest({\n url,\n authToken: captured.authToken,\n actorId: captured.actorId,\n workspaceId: captured.workspaceId,\n tenantId: captured.tenantId,\n currentQuery: query,\n signal,\n });\n assertCapturedContext();\n prepared.assertCurrent();\n const response = await graphqlFetchPinned<T>({\n gateway: 'workspace',\n // Pinned fetch resolves the endpoint itself; preparation needs the full URL.\n baseUrl: captured.apiGatewayUrl,\n query,\n variables,\n authToken: captured.authToken,\n workspaceToken: prepared.workspaceToken,\n workspaceId: captured.workspaceId,\n organizationId: captured.organizationId ?? false,\n tenantId: captured.tenantId ?? false,\n projectId: captured.projectId ?? false,\n signal,\n });\n assertCapturedContext();\n prepared.assertCurrent();\n if (response.errors?.length || response.data == null) {\n throw new Error('Databricks request was not confirmed. Refresh status before retrying.');\n }\n return response.data;\n}\n"],"mappings":";;;AAoBA,eAAsBA,EACpB,GACA,GACA,GACA,GACY;CACZ,IAAMC,IAAW,EAAE,GAAGC,EAAM,GACtBC,UAA8B;EAClC,KACGF,EAAS,kBAAkB,WAAWG,EAAwB,KAAK,UACnEH,EAAS,aAAa,WAAWI,EAAmB,KAAK,OAE1D,MAAU,MAAM,4EAA4E;CAEhG;CACA,EAAsB;CACtB,IAAMC,IAAMC,EAAkB,aAAaN,EAAS,aAAa,GAC3DO,IAAQC,EAAMC,CAAQ,GACtBC,IAAW,MAAMC,EAAwB;EAC7C;EACA,WAAWX,EAAS;EACpB,SAASA,EAAS;EAClB,aAAaA,EAAS;EACtB,UAAUA,EAAS;EACnB,cAAcO;EACd;CACF,CAAC;CAED,AADAL,EAAsB,GACtBQ,EAAS,cAAc;CACvB,IAAME,IAAW,MAAMC,EAAsB;EAC3C,SAAS;EAET,SAASb,EAAS;EAClB;EACA;EACA,WAAWA,EAAS;EACpB,gBAAgBU,EAAS;EACzB,aAAaV,EAAS;EACtB,gBAAgBA,EAAS,kBAAkB;EAC3C,UAAUA,EAAS,YAAY;EAC/B,WAAWA,EAAS,aAAa;EACjC;CACF,CAAC;CAGD,IAFAE,EAAsB,GACtBQ,EAAS,cAAc,GACnBE,EAAS,QAAQ,UAAUA,EAAS,QAAQ,MAC9C,MAAU,MAAM,uEAAuE;CAEzF,OAAOA,EAAS;AAClB"}
@@ -97,4 +97,3 @@ export declare function nextEntityTagIds(current: readonly CosEntityTagAssignmen
97
97
  * the typed text, alphabetically, capped at `limit`.
98
98
  */
99
99
  export declare function suggestWorkspaceTags(workspaceTags: readonly CosWorkspaceTag[], selected: readonly string[], query: string, limit?: number): CosWorkspaceTag[];
100
- //# sourceMappingURL=tagsApi.d.ts.map
@@ -64,7 +64,7 @@ function u(e) {
64
64
  let t = /* @__PURE__ */ new Set(), n = [];
65
65
  for (let r of e) {
66
66
  let e = l(r);
67
- !e || t.has(e) || (t.add(e), n.push(c(r)));
67
+ e && !t.has(e) && (t.add(e), n.push(c(r)));
68
68
  }
69
69
  return n;
70
70
  }
@@ -104,7 +104,6 @@ function h(e, t, n, r = 8) {
104
104
  return !t || i.has(t) || o.has(t) ? !1 : (o.add(t), a === "" || t.includes(a));
105
105
  }).sort((e, t) => e.label.localeCompare(t.label)).slice(0, r);
106
106
  }
107
- //#endregion
108
107
  export { n as AVAILABLE_COS_TAGS, o as COS_ENTITY_TAGS, r as CREATE_COS_TAG, i as REPLACE_COS_ENTITY_TAGS, a as SEARCH_COS_TAGS, c as cleanTagLabel, d as diffEntityTagLabels, f as findTagByLabel, p as labelsMissingFromAssignments, m as nextEntityTagIds, l as normalizeTagLabel, h as suggestWorkspaceTags, u as uniqueTagLabels, s as useWorkspaceTags };
109
108
 
110
109
  //# sourceMappingURL=tagsApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tagsApi.js","names":[],"sources":["../../../src/cosmicintersection/api/tagsApi.ts"],"sourcesContent":["/**\n * tagsApi — workspace tag operations for CosmicIntersection entities.\n *\n * Every document here targets the `Cos`-prefixed tag surface that\n * wspace-cosmicintersection-svc publishes from the shared\n * `@burdenoff/be-sdk/tags` builder (`availableCosTags`, `searchCosTags`,\n * `createCosTag`, `cosEntityTags`, `replaceCosEntityTags`). The service\n * forwards each call to wspace-tags-svc, so tags live in the workspace\n * taxonomy and are shared with every other product surface.\n *\n * The entity's inline `tags: [String!]` array is still written by the entity's\n * own create/update mutation (labels of the selected tags) so list filters and\n * search keep working; `useEntityTagSync` applies the labels the user added or\n * removed to the structured assignments ({@link diffEntityTagLabels}).\n */\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\n\n/** Entity types the CosmicIntersection subgraph registers with wspace-tags-svc. */\nexport type CosTagEntityType =\n | 'COSMICINTERSECTION_DATASET'\n | 'COSMICINTERSECTION_SOURCE'\n | 'COSMICINTERSECTION_NOTEBOOK'\n | 'COSMICINTERSECTION_COLLECTION'\n | 'COSMICINTERSECTION_PIPELINE'\n | 'COSMICINTERSECTION_RELEASE';\n\n/** An assignable workspace tag (`CosAvailableTag`). */\nexport interface CosWorkspaceTag {\n id: string;\n key: string;\n label: string;\n color?: string | null;\n}\n\n/** Upper bound on the workspace tags the picker loads for suggestions. */\nexport const WORKSPACE_TAG_LIMIT = 200;\n\nexport const AVAILABLE_COS_TAGS = gql`\n query AvailableCosTags($limit: Int) {\n availableCosTags(limit: $limit) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const CREATE_COS_TAG = gql`\n mutation CreateCosTag($input: CreateCosTagInput!) {\n createCosTag(input: $input) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const REPLACE_COS_ENTITY_TAGS = gql`\n mutation ReplaceCosEntityTags($input: ReplaceCosEntityTagsInput!) {\n replaceCosEntityTags(input: $input) {\n id\n tagId\n }\n }\n`;\n\nexport const SEARCH_COS_TAGS = gql`\n query SearchCosTags($query: String!, $limit: Int) {\n searchCosTags(query: $query, limit: $limit) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const COS_ENTITY_TAGS = gql`\n query CosEntityTags($input: GetCosEntityTagsInput!) {\n cosEntityTags(input: $input) {\n id\n tagId\n tagInfo {\n id\n label\n }\n }\n }\n`;\n\nexport interface AvailableCosTagsData {\n availableCosTags: CosWorkspaceTag[];\n}\n\nexport interface CreateCosTagData {\n createCosTag: CosWorkspaceTag;\n}\n\nexport interface SearchCosTagsData {\n searchCosTags: CosWorkspaceTag[];\n}\n\nexport interface CosEntityTagsData {\n cosEntityTags: Array<CosEntityTagAssignment & { id: string }>;\n}\n\nexport interface ReplaceCosEntityTagsData {\n replaceCosEntityTags: Array<{ id: string; tagId: string }>;\n}\n\n/**\n * Workspace tags for the picker's suggestions. `cache-and-network` so a tag\n * created from another form shows up the next time a picker mounts, while the\n * cached list renders instantly. A failure (tags-svc down, no permission) is\n * reported through `error` and the picker falls back to free-text entry.\n */\nexport function useWorkspaceTags(skip = false) {\n return useQuery<AvailableCosTagsData, { limit: number }>(AVAILABLE_COS_TAGS, {\n variables: { limit: WORKSPACE_TAG_LIMIT },\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n skip,\n });\n}\n\n/**\n * Longest label the picker input accepts; a cheap guard against oversized new\n * values. It is enforced on the input only: labels loaded from an entity keep\n * their full text, since the earlier free-text field accepted any length.\n */\nexport const MAX_TAG_LABEL_LENGTH = 64;\n\n/** Display form of a label: trimmed, inner whitespace collapsed. */\nexport function cleanTagLabel(label: string): string {\n return label.trim().replace(/\\s+/g, ' ');\n}\n\n/** Case- and whitespace-insensitive identity for a tag label. */\nexport function normalizeTagLabel(label: string): string {\n return cleanTagLabel(label).toLowerCase();\n}\n\n/** Unique, cleaned labels in first-seen order (duplicates by {@link normalizeTagLabel} collapse). */\nexport function uniqueTagLabels(labels: readonly string[]): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const label of labels) {\n const key = normalizeTagLabel(label);\n if (!key || seen.has(key)) continue;\n seen.add(key);\n out.push(cleanTagLabel(label));\n }\n return out;\n}\n\nexport interface EntityTagLabelDiff {\n /** Labels the user added since the entity was loaded. */\n added: string[];\n /** Labels the user removed since the entity was loaded. */\n removed: string[];\n}\n\n/**\n * What changed between the labels an entity was loaded with and the labels the\n * form now holds. Only these labels touch the entity's workspace assignments,\n * so a tag assigned from another surface (the shell `/tags` route, the API)\n * survives every save that does not explicitly remove it.\n */\nexport function diffEntityTagLabels(\n previous: readonly string[],\n next: readonly string[]\n): EntityTagLabelDiff {\n const before = uniqueTagLabels(previous);\n const after = uniqueTagLabels(next);\n const beforeKeys = new Set(before.map(normalizeTagLabel));\n const afterKeys = new Set(after.map(normalizeTagLabel));\n return {\n added: after.filter((label) => !beforeKeys.has(normalizeTagLabel(label))),\n removed: before.filter((label) => !afterKeys.has(normalizeTagLabel(label))),\n };\n}\n\n/** First workspace tag whose label matches `label` (case/whitespace-insensitive). */\nexport function findTagByLabel(\n workspaceTags: readonly CosWorkspaceTag[],\n label: string\n): CosWorkspaceTag | undefined {\n const key = normalizeTagLabel(label);\n if (!key) return undefined;\n return workspaceTags.find((tag) => normalizeTagLabel(tag.label) === key);\n}\n\n/** A current assignment as read back from `cosEntityTags`. */\nexport interface CosEntityTagAssignment {\n tagId: string;\n tagInfo?: { label?: string | null } | null;\n}\n\n/**\n * Labels the form holds that the entity has no assignment for yet. An\n * assignment's label comes from its `tagInfo`, or from the workspace taxonomy\n * when the projection is missing.\n */\nexport function labelsMissingFromAssignments(\n labels: readonly string[],\n current: readonly CosEntityTagAssignment[],\n workspaceTags: readonly CosWorkspaceTag[]\n): string[] {\n const assigned = new Set<string>();\n for (const assignment of current) {\n const label =\n assignment.tagInfo?.label ?? workspaceTags.find((tag) => tag.id === assignment.tagId)?.label;\n if (label) assigned.add(normalizeTagLabel(label));\n }\n return uniqueTagLabels(labels).filter((label) => !assigned.has(normalizeTagLabel(label)));\n}\n\n/**\n * The full tag-id set to write after a save: the entity's current assignments,\n * minus the ids whose label the user removed, plus the resolved ids of the\n * labels the user added. Order is stable and ids are unique.\n */\nexport function nextEntityTagIds(\n current: readonly CosEntityTagAssignment[],\n removedLabels: readonly string[],\n removedTagIds: readonly string[],\n addedTagIds: readonly string[]\n): string[] {\n const removedKeys = new Set(removedLabels.map(normalizeTagLabel));\n const removedIds = new Set(removedTagIds);\n const ids: string[] = [];\n const push = (id: string) => {\n if (id && !ids.includes(id)) ids.push(id);\n };\n for (const assignment of current) {\n const label = assignment.tagInfo?.label;\n const removedByLabel = label ? removedKeys.has(normalizeTagLabel(label)) : false;\n if (removedByLabel || removedIds.has(assignment.tagId)) continue;\n push(assignment.tagId);\n }\n addedTagIds.forEach(push);\n return ids;\n}\n\n/**\n * Picker suggestions: workspace tags not already selected whose label contains\n * the typed text, alphabetically, capped at `limit`.\n */\nexport function suggestWorkspaceTags(\n workspaceTags: readonly CosWorkspaceTag[],\n selected: readonly string[],\n query: string,\n limit = 8\n): CosWorkspaceTag[] {\n const taken = new Set(selected.map(normalizeTagLabel));\n const needle = normalizeTagLabel(query);\n const seen = new Set<string>();\n return workspaceTags\n .filter((tag) => {\n const key = normalizeTagLabel(tag.label);\n if (!key || taken.has(key) || seen.has(key)) return false;\n seen.add(key);\n return needle === '' || key.includes(needle);\n })\n .sort((a, b) => a.label.localeCompare(b.label))\n .slice(0, limit);\n}\n"],"mappings":";;AAsCA,IAAa,IAAqB,CAAG;;;;;;;;;GAWxB,IAAiB,CAAG;;;;;;;;;GAWpB,IAA0B,CAAG;;;;;;;GAS7B,IAAkB,CAAG;;;;;;;;;GAWrB,IAAkB,CAAG;;;;;;;;;;;;AAuClC,SAAgB,EAAiB,IAAO,IAAO;CAC7C,OAAO,EAAkD,GAAoB;EAC3E,WAAW,EAAE,OAAA,IAA2B;EACxC,aAAa;EACb,aAAa;EACb;CACF,CAAC;AACH;AAUA,SAAgB,EAAc,GAAuB;CACnD,OAAO,EAAM,KAAK,CAAC,CAAC,QAAQ,QAAQ,GAAG;AACzC;AAGA,SAAgB,EAAkB,GAAuB;CACvD,OAAO,EAAc,CAAK,CAAC,CAAC,YAAY;AAC1C;AAGA,SAAgB,EAAgB,GAAqC;CACnE,IAAM,oBAAO,IAAI,IAAY,GACvB,IAAgB,CAAC;CACvB,KAAK,IAAM,KAAS,GAAQ;EAC1B,IAAM,IAAM,EAAkB,CAAK;EAC/B,CAA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AW,SAAS;EAElC,AADuB,KAAQ,EAAY,IAAI,EAAkB,CAAK,CAAC,KACjD,EAAW,IAAI,EAAW,KAAK,KACrD,EAAK,EAAW,KAAK;CACvB;CAEA,OADA,EAAY,QAAQ,CAAI,GACjB;AACT;AAMA,SAAgB,EACd,GACA,GACA,GACA,IAAQ,GACW;CACnB,IAAM,IAAQ,IAAI,IAAI,EAAS,IAAI,CAAiB,CAAC,GAC/C,IAAS,EAAkB,CAAK,GAChC,oBAAO,IAAI,IAAY;CAC7B,OAAO,EACJ,QAAQ,MAAQ;EACf,IAAM,IAAM,EAAkB,EAAI,KAAK;EAGvC,OAFI,CAAC,KAAO,EAAM,IAAI,CAAG,KAAK,EAAK,IAAI,CAAG,IAAU,MACpD,EAAK,IAAI,CAAG,GACL,MAAW,MAAM,EAAI,SAAS,CAAM;CAC7C,CAAC,CAAC,CACD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,CAAC,CAC9C,MAAM,GAAG,CAAK;AACnB"}
1
+ {"version":3,"file":"tagsApi.js","names":["AVAILABLE_COS_TAGS","CREATE_COS_TAG","REPLACE_COS_ENTITY_TAGS","SEARCH_COS_TAGS","COS_ENTITY_TAGS","useWorkspaceTags","useQuery","cleanTagLabel","label","normalizeTagLabel","uniqueTagLabels","seen","out","labels","key","diffEntityTagLabels","before","previous","after","next","beforeKeys","afterKeys","findTagByLabel","workspaceTags","tag","labelsMissingFromAssignments","assigned","assignment","current","nextEntityTagIds","removedKeys","removedLabels","removedIds","removedTagIds","ids","push","id","addedTagIds","suggestWorkspaceTags","taken","selected","needle","query","a","b","limit"],"sources":["../../../src/cosmicintersection/api/tagsApi.ts"],"sourcesContent":["/**\n * tagsApi — workspace tag operations for CosmicIntersection entities.\n *\n * Every document here targets the `Cos`-prefixed tag surface that\n * wspace-cosmicintersection-svc publishes from the shared\n * `@burdenoff/be-sdk/tags` builder (`availableCosTags`, `searchCosTags`,\n * `createCosTag`, `cosEntityTags`, `replaceCosEntityTags`). The service\n * forwards each call to wspace-tags-svc, so tags live in the workspace\n * taxonomy and are shared with every other product surface.\n *\n * The entity's inline `tags: [String!]` array is still written by the entity's\n * own create/update mutation (labels of the selected tags) so list filters and\n * search keep working; `useEntityTagSync` applies the labels the user added or\n * removed to the structured assignments ({@link diffEntityTagLabels}).\n */\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\n\n/** Entity types the CosmicIntersection subgraph registers with wspace-tags-svc. */\nexport type CosTagEntityType =\n | 'COSMICINTERSECTION_DATASET'\n | 'COSMICINTERSECTION_SOURCE'\n | 'COSMICINTERSECTION_NOTEBOOK'\n | 'COSMICINTERSECTION_COLLECTION'\n | 'COSMICINTERSECTION_PIPELINE'\n | 'COSMICINTERSECTION_RELEASE';\n\n/** An assignable workspace tag (`CosAvailableTag`). */\nexport interface CosWorkspaceTag {\n id: string;\n key: string;\n label: string;\n color?: string | null;\n}\n\n/** Upper bound on the workspace tags the picker loads for suggestions. */\nexport const WORKSPACE_TAG_LIMIT = 200;\n\nexport const AVAILABLE_COS_TAGS = gql`\n query AvailableCosTags($limit: Int) {\n availableCosTags(limit: $limit) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const CREATE_COS_TAG = gql`\n mutation CreateCosTag($input: CreateCosTagInput!) {\n createCosTag(input: $input) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const REPLACE_COS_ENTITY_TAGS = gql`\n mutation ReplaceCosEntityTags($input: ReplaceCosEntityTagsInput!) {\n replaceCosEntityTags(input: $input) {\n id\n tagId\n }\n }\n`;\n\nexport const SEARCH_COS_TAGS = gql`\n query SearchCosTags($query: String!, $limit: Int) {\n searchCosTags(query: $query, limit: $limit) {\n id\n key\n label\n color\n }\n }\n`;\n\nexport const COS_ENTITY_TAGS = gql`\n query CosEntityTags($input: GetCosEntityTagsInput!) {\n cosEntityTags(input: $input) {\n id\n tagId\n tagInfo {\n id\n label\n }\n }\n }\n`;\n\nexport interface AvailableCosTagsData {\n availableCosTags: CosWorkspaceTag[];\n}\n\nexport interface CreateCosTagData {\n createCosTag: CosWorkspaceTag;\n}\n\nexport interface SearchCosTagsData {\n searchCosTags: CosWorkspaceTag[];\n}\n\nexport interface CosEntityTagsData {\n cosEntityTags: Array<CosEntityTagAssignment & { id: string }>;\n}\n\nexport interface ReplaceCosEntityTagsData {\n replaceCosEntityTags: Array<{ id: string; tagId: string }>;\n}\n\n/**\n * Workspace tags for the picker's suggestions. `cache-and-network` so a tag\n * created from another form shows up the next time a picker mounts, while the\n * cached list renders instantly. A failure (tags-svc down, no permission) is\n * reported through `error` and the picker falls back to free-text entry.\n */\nexport function useWorkspaceTags(skip = false) {\n return useQuery<AvailableCosTagsData, { limit: number }>(AVAILABLE_COS_TAGS, {\n variables: { limit: WORKSPACE_TAG_LIMIT },\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n skip,\n });\n}\n\n/**\n * Longest label the picker input accepts; a cheap guard against oversized new\n * values. It is enforced on the input only: labels loaded from an entity keep\n * their full text, since the earlier free-text field accepted any length.\n */\nexport const MAX_TAG_LABEL_LENGTH = 64;\n\n/** Display form of a label: trimmed, inner whitespace collapsed. */\nexport function cleanTagLabel(label: string): string {\n return label.trim().replace(/\\s+/g, ' ');\n}\n\n/** Case- and whitespace-insensitive identity for a tag label. */\nexport function normalizeTagLabel(label: string): string {\n return cleanTagLabel(label).toLowerCase();\n}\n\n/** Unique, cleaned labels in first-seen order (duplicates by {@link normalizeTagLabel} collapse). */\nexport function uniqueTagLabels(labels: readonly string[]): string[] {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const label of labels) {\n const key = normalizeTagLabel(label);\n if (!key || seen.has(key)) continue;\n seen.add(key);\n out.push(cleanTagLabel(label));\n }\n return out;\n}\n\nexport interface EntityTagLabelDiff {\n /** Labels the user added since the entity was loaded. */\n added: string[];\n /** Labels the user removed since the entity was loaded. */\n removed: string[];\n}\n\n/**\n * What changed between the labels an entity was loaded with and the labels the\n * form now holds. Only these labels touch the entity's workspace assignments,\n * so a tag assigned from another surface (the shell `/tags` route, the API)\n * survives every save that does not explicitly remove it.\n */\nexport function diffEntityTagLabels(\n previous: readonly string[],\n next: readonly string[]\n): EntityTagLabelDiff {\n const before = uniqueTagLabels(previous);\n const after = uniqueTagLabels(next);\n const beforeKeys = new Set(before.map(normalizeTagLabel));\n const afterKeys = new Set(after.map(normalizeTagLabel));\n return {\n added: after.filter((label) => !beforeKeys.has(normalizeTagLabel(label))),\n removed: before.filter((label) => !afterKeys.has(normalizeTagLabel(label))),\n };\n}\n\n/** First workspace tag whose label matches `label` (case/whitespace-insensitive). */\nexport function findTagByLabel(\n workspaceTags: readonly CosWorkspaceTag[],\n label: string\n): CosWorkspaceTag | undefined {\n const key = normalizeTagLabel(label);\n if (!key) return undefined;\n return workspaceTags.find((tag) => normalizeTagLabel(tag.label) === key);\n}\n\n/** A current assignment as read back from `cosEntityTags`. */\nexport interface CosEntityTagAssignment {\n tagId: string;\n tagInfo?: { label?: string | null } | null;\n}\n\n/**\n * Labels the form holds that the entity has no assignment for yet. An\n * assignment's label comes from its `tagInfo`, or from the workspace taxonomy\n * when the projection is missing.\n */\nexport function labelsMissingFromAssignments(\n labels: readonly string[],\n current: readonly CosEntityTagAssignment[],\n workspaceTags: readonly CosWorkspaceTag[]\n): string[] {\n const assigned = new Set<string>();\n for (const assignment of current) {\n const label =\n assignment.tagInfo?.label ?? workspaceTags.find((tag) => tag.id === assignment.tagId)?.label;\n if (label) assigned.add(normalizeTagLabel(label));\n }\n return uniqueTagLabels(labels).filter((label) => !assigned.has(normalizeTagLabel(label)));\n}\n\n/**\n * The full tag-id set to write after a save: the entity's current assignments,\n * minus the ids whose label the user removed, plus the resolved ids of the\n * labels the user added. Order is stable and ids are unique.\n */\nexport function nextEntityTagIds(\n current: readonly CosEntityTagAssignment[],\n removedLabels: readonly string[],\n removedTagIds: readonly string[],\n addedTagIds: readonly string[]\n): string[] {\n const removedKeys = new Set(removedLabels.map(normalizeTagLabel));\n const removedIds = new Set(removedTagIds);\n const ids: string[] = [];\n const push = (id: string) => {\n if (id && !ids.includes(id)) ids.push(id);\n };\n for (const assignment of current) {\n const label = assignment.tagInfo?.label;\n const removedByLabel = label ? removedKeys.has(normalizeTagLabel(label)) : false;\n if (removedByLabel || removedIds.has(assignment.tagId)) continue;\n push(assignment.tagId);\n }\n addedTagIds.forEach(push);\n return ids;\n}\n\n/**\n * Picker suggestions: workspace tags not already selected whose label contains\n * the typed text, alphabetically, capped at `limit`.\n */\nexport function suggestWorkspaceTags(\n workspaceTags: readonly CosWorkspaceTag[],\n selected: readonly string[],\n query: string,\n limit = 8\n): CosWorkspaceTag[] {\n const taken = new Set(selected.map(normalizeTagLabel));\n const needle = normalizeTagLabel(query);\n const seen = new Set<string>();\n return workspaceTags\n .filter((tag) => {\n const key = normalizeTagLabel(tag.label);\n if (!key || taken.has(key) || seen.has(key)) return false;\n seen.add(key);\n return needle === '' || key.includes(needle);\n })\n .sort((a, b) => a.label.localeCompare(b.label))\n .slice(0, limit);\n}\n"],"mappings":";;AAsCA,IAAaA,IAAqB,CAAG;;;;;;;;;GAWxBC,IAAiB,CAAG;;;;;;;;;GAWpBC,IAA0B,CAAG;;;;;;;GAS7BC,IAAkB,CAAG;;;;;;;;;GAWrBC,IAAkB,CAAG;;;;;;;;;;;;AAuClC,SAAgBC,EAAiB,IAAO,IAAO;CAC7C,OAAOC,EAAkDN,GAAoB;EAC3E,WAAW,EAAE,OAAA,IAA2B;EACxC,aAAa;EACb,aAAa;EACb;CACF,CAAC;AACH;AAUA,SAAgBO,EAAc,GAAuB;CACnD,OAAOC,EAAM,KAAK,CAAC,CAAC,QAAQ,QAAQ,GAAG;AACzC;AAGA,SAAgBC,EAAkB,GAAuB;CACvD,OAAOF,EAAcC,CAAK,CAAC,CAAC,YAAY;AAC1C;AAGA,SAAgBE,EAAgB,GAAqC;CACnE,IAAMC,oBAAO,IAAI,IAAY,GACvBC,IAAgB,CAAC;CACvB,KAAK,IAAMJ,KAASK,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,MAAe;EAC3B,AAAIC,KAAM,CAACF,EAAI,SAASE,CAAE,KAAGF,EAAI,KAAKE,CAAE;CAC1C;CACA,KAAK,IAAMT,KAAcC,GAAS;EAChC,IAAMpB,IAAQmB,EAAW,SAAS;EAElC,AADuBnB,KAAQsB,EAAY,IAAIrB,EAAkBD,CAAK,CAAC,KACjDwB,EAAW,IAAIL,EAAW,KAAK,KACrDQ,EAAKR,EAAW,KAAK;CACvB;CAEA,OADAU,EAAY,QAAQF,CAAI,GACjBD;AACT;AAMA,SAAgBI,EACd,GACA,GACA,GACA,IAAQ,GACW;CACnB,IAAMC,IAAQ,IAAI,IAAIC,EAAS,IAAI/B,CAAiB,CAAC,GAC/CgC,IAAShC,EAAkBiC,CAAK,GAChC/B,oBAAO,IAAI,IAAY;CAC7B,OAAOY,EACJ,QAAQ,MAAQ;EACf,IAAMT,IAAML,EAAkBe,EAAI,KAAK;EAGvC,OAFI,CAACV,KAAOyB,EAAM,IAAIzB,CAAG,KAAKH,EAAK,IAAIG,CAAG,IAAU,MACpDH,EAAK,IAAIG,CAAG,GACL2B,MAAW,MAAM3B,EAAI,SAAS2B,CAAM;CAC7C,CAAC,CAAC,CACD,MAAM,GAAG,MAAME,EAAE,MAAM,cAAcC,EAAE,KAAK,CAAC,CAAC,CAC9C,MAAM,GAAGC,CAAK;AACnB"}
@@ -37,4 +37,3 @@ export interface ActionMenuProps {
37
37
  */
38
38
  export declare function ActionMenu({ ariaLabel, onView, onEdit, onDelete, entityName, deleteLabel: deleteLabelProp, extraItems, align, trigger, }: ActionMenuProps): import('react').JSX.Element | null;
39
39
  export default ActionMenu;
40
- //# sourceMappingURL=ActionMenu.d.ts.map
@@ -3,7 +3,7 @@ import { useState as t } from "react";
3
3
  import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  import { AlertDialog as a, AlertDialogAction as o, AlertDialogCancel as s, AlertDialogContent as c, AlertDialogDescription as l, AlertDialogFooter as u, AlertDialogHeader as d, AlertDialogTitle as f, DropdownMenu as p, DropdownMenuContent as m, DropdownMenuItem as h, DropdownMenuSeparator as g, DropdownMenuTrigger as _, buttonVariants as v } from "@burdenoff/fe-libs/ui";
5
5
  import { Eye as y, MoreVertical as b, Pencil as x, Trash2 as S } from "lucide-react";
6
- //#region src/cosmicintersection/components/ActionMenu.tsx
6
+ // src/cosmicintersection/components/ActionMenu.tsx
7
7
  var C = "text-status-error-text focus:text-status-error-text";
8
8
  function w({ ariaLabel: w, onView: T, onEdit: E, onDelete: D, entityName: O, deleteLabel: k, extraItems: A = [], align: j = "end", trigger: M }) {
9
9
  let N = e(), P = k ?? N("cosmicintersection.common.delete", "Delete"), [F, I] = t(!1), [L, R] = t(!1), z = async () => {
@@ -97,7 +97,6 @@ function w({ ariaLabel: w, onView: T, onEdit: E, onDelete: D, entityName: O, del
97
97
  })
98
98
  }) : null] }) : null;
99
99
  }
100
- //#endregion
101
100
  export { w as ActionMenu, w as default };
102
101
 
103
102
  //# sourceMappingURL=ActionMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionMenu.js","names":[],"sources":["../../../src/cosmicintersection/components/ActionMenu.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Eye, MoreVertical, Pencil, Trash2 } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n buttonVariants,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@burdenoff/fe-libs/ui';\n\nexport interface ActionMenuItem {\n key: string;\n label: string;\n icon?: LucideIcon;\n onSelect: () => void;\n variant?: 'default' | 'danger';\n disabled?: boolean;\n separatorBefore?: boolean;\n}\n\nexport interface ActionMenuProps {\n /** Accessible name for the trigger, e.g. \"Dataset actions\". */\n ariaLabel: string;\n onView?: () => void;\n onEdit?: () => void;\n /**\n * Delete/destructive handler — opens a confirm dialog first. May be async; the\n * dialog stays open until it resolves.\n */\n onDelete?: () => void | Promise<void>;\n /** Name shown inside the confirmation (\"Archive \\\"Kepler DR3\\\"?\"). */\n entityName?: string;\n /** Label for the danger item + confirm button. Defaults to \"Delete\". */\n deleteLabel?: string;\n /** Additional items inserted before the Delete action. */\n extraItems?: ActionMenuItem[];\n align?: 'start' | 'end';\n trigger?: ReactNode;\n}\n\nconst DANGER_ITEM_CLASS = 'text-status-error-text focus:text-status-error-text';\n\n/**\n * Canonical row overflow menu (View / Edit / Delete) for CosmicIntersection list\n * pages. Built on the fe-libs Radix DropdownMenu (keyboard nav, Escape,\n * outside-click, focus return). Delete routes through an AlertDialog confirm\n * before the destructive handler fires. Safe inside clickable cards/rows — the\n * trigger and content stop click propagation.\n */\nexport function ActionMenu({\n ariaLabel,\n onView,\n onEdit,\n onDelete,\n entityName,\n deleteLabel: deleteLabelProp,\n extraItems = [],\n align = 'end',\n trigger,\n}: ActionMenuProps) {\n const tr = useTr();\n const deleteLabel = deleteLabelProp ?? tr('cosmicintersection.common.delete', 'Delete');\n const [confirmOpen, setConfirmOpen] = useState(false);\n const [deleting, setDeleting] = useState(false);\n\n const handleConfirmDelete = async () => {\n if (!onDelete) {\n return;\n }\n try {\n setDeleting(true);\n await onDelete();\n setConfirmOpen(false);\n } catch {\n // The handler surfaces its own error (toast); keep the dialog open so the\n // user can retry or cancel rather than silently dismissing.\n } finally {\n setDeleting(false);\n }\n };\n\n const triggerNode = trigger ?? (\n <button\n type=\"button\"\n className=\"inline-flex size-9 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus max-md:size-11\"\n aria-label={ariaLabel}\n >\n <MoreVertical className=\"size-4\" aria-hidden=\"true\" />\n </button>\n );\n\n const hasAnyItem = Boolean(onView || onEdit || extraItems.length > 0 || onDelete);\n if (!hasAnyItem) {\n return null;\n }\n\n return (\n <>\n <DropdownMenu>\n <DropdownMenuTrigger\n asChild\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {triggerNode}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align={align}\n className=\"min-w-44\"\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {onView ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onView()}>\n <Eye className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{tr('cosmicintersection.common.view', 'View')}</span>\n </DropdownMenuItem>\n ) : null}\n {onEdit ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onEdit()}>\n <Pencil className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{tr('cosmicintersection.common.edit', 'Edit')}</span>\n </DropdownMenuItem>\n ) : null}\n {extraItems.map((item) => {\n const Icon = item.icon;\n return (\n <div key={item.key} className=\"contents\">\n {item.separatorBefore ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n disabled={item.disabled}\n onSelect={() => item.onSelect()}\n className={`cursor-pointer gap-2 ${item.variant === 'danger' ? DANGER_ITEM_CLASS : ''}`}\n >\n {Icon ? <Icon className=\"size-4 shrink-0\" aria-hidden=\"true\" /> : null}\n <span className=\"min-w-0 truncate\">{item.label}</span>\n </DropdownMenuItem>\n </div>\n );\n })}\n {onDelete ? (\n <div className=\"contents\">\n {onView || onEdit || extraItems.length > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n className={`cursor-pointer gap-2 ${DANGER_ITEM_CLASS}`}\n onSelect={() => setConfirmOpen(true)}\n >\n <Trash2 className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{deleteLabel}</span>\n </DropdownMenuItem>\n </div>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n\n {onDelete ? (\n <AlertDialog\n open={confirmOpen}\n onOpenChange={(next) => (deleting ? undefined : setConfirmOpen(next))}\n >\n <AlertDialogContent onClick={(event) => event.stopPropagation()}>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {deleteLabel}\n {entityName ? ` “${entityName}”?` : '?'}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {tr(\n 'cosmicintersection.common.confirmDelete',\n 'This action cannot be undone. This record will be permanently affected.'\n )}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={deleting}>\n {tr('cosmicintersection.common.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={(event) => {\n event.preventDefault();\n void handleConfirmDelete();\n }}\n disabled={deleting}\n className={buttonVariants({ variant: 'destructive' })}\n >\n {deleting ? tr('cosmicintersection.common.working', 'Working…') : deleteLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ) : null}\n </>\n );\n}\n\nexport default ActionMenu;\n"],"mappings":";;;;;;AAmDA,IAAM,IAAoB;AAS1B,SAAgB,EAAW,EACzB,cACA,WACA,WACA,aACA,eACA,aAAa,GACb,gBAAa,CAAC,GACd,WAAQ,OACR,cACkB;CAClB,IAAM,IAAK,EAAM,GACX,IAAc,KAAmB,EAAG,oCAAoC,QAAQ,GAChF,CAAC,GAAa,KAAkB,EAAS,EAAK,GAC9C,CAAC,GAAU,KAAe,EAAS,EAAK,GAExC,IAAsB,YAAY;EACjC,OAGL,IAAI;GAGF,AAFA,EAAY,EAAI,GAChB,MAAM,EAAS,GACf,EAAe,EAAK;EACtB,QAAQ,CAGR,UAAU;GACR,EAAY,EAAK;EACnB;CACF,GAEM,IAAc,KAClB,kBAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,cAAY;YAEZ,kBAAC,GAAD;GAAc,WAAU;GAAS,eAAY;EAAQ,CAAA;CAC/C,CAAA;CAQV,OAL2B,KAAU,KAAU,EAAW,SAAS,KAAK,IAMtE,kB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ACE,WAAW,wBAAwB;KACnC,gBAAgB,EAAe,EAAI;eAFrC,CAIE,kBAAC,GAAD;MAAQ,WAAU;MAAkB,eAAY;KAAQ,CAAA,GACxD,kBAAC,QAAD,EAAA,UAAO,EAAkB,CAAA,CACT;MACf;QACH;EACe;GACT,EAAA,CAAA,GAEb,IACC,kBAAC,GAAD;EACE,MAAM;EACN,eAAe,MAAU,IAAW,KAAA,IAAY,EAAe,CAAI;YAEnE,kBAAC,GAAD;GAAoB,UAAU,MAAU,EAAM,gBAAgB;aAA9D,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACG,GACA,IAAa,KAAK,EAAW,MAAM,GACpB,EAAA,CAAA,GAClB,kBAAC,GAAD,EAAA,UACG,EACC,2CACA,yEACF,EACsB,CAAA,CACP,EAAA,CAAA,GACnB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;IAAmB,UAAU;cAC1B,EAAG,oCAAoC,QAAQ;GAC/B,CAAA,GACnB,kBAAC,GAAD;IACE,UAAU,MAAU;KAElB,AADA,EAAM,eAAe,GACrB,EAAyB;IAC3B;IACA,UAAU;IACV,WAAW,EAAe,EAAE,SAAS,cAAc,CAAC;cAEnD,IAAW,EAAG,qCAAqC,UAAU,IAAI;GACjD,CAAA,CACF,EAAA,CAAA,CACD;;CACT,CAAA,IACX,IACJ,EAAA,CAAA,IAlGK;AAoGX"}
1
+ {"version":3,"file":"ActionMenu.js","names":["_Fragment","Fragment$1","DANGER_ITEM_CLASS","ActionMenu","deleteLabelProp","tr","useTr","deleteLabel","confirmOpen","setConfirmOpen","useState","deleting","setDeleting","handleConfirmDelete","onDelete","triggerNode","trigger","ariaLabel","MoreVertical","onView","onEdit","extraItems","DropdownMenu","DropdownMenuTrigger","event","DropdownMenuContent","DropdownMenuItem","Eye","Pencil","Icon","item","DropdownMenuSeparator","Trash2","AlertDialog","next","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","entityName","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","buttonVariants"],"sources":["../../../src/cosmicintersection/components/ActionMenu.tsx"],"sourcesContent":["import { useState, type ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Eye, MoreVertical, Pencil, Trash2 } from 'lucide-react';\nimport { useTr } from '../../shared/hooks/useTr';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n buttonVariants,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@burdenoff/fe-libs/ui';\n\nexport interface ActionMenuItem {\n key: string;\n label: string;\n icon?: LucideIcon;\n onSelect: () => void;\n variant?: 'default' | 'danger';\n disabled?: boolean;\n separatorBefore?: boolean;\n}\n\nexport interface ActionMenuProps {\n /** Accessible name for the trigger, e.g. \"Dataset actions\". */\n ariaLabel: string;\n onView?: () => void;\n onEdit?: () => void;\n /**\n * Delete/destructive handler — opens a confirm dialog first. May be async; the\n * dialog stays open until it resolves.\n */\n onDelete?: () => void | Promise<void>;\n /** Name shown inside the confirmation (\"Archive \\\"Kepler DR3\\\"?\"). */\n entityName?: string;\n /** Label for the danger item + confirm button. Defaults to \"Delete\". */\n deleteLabel?: string;\n /** Additional items inserted before the Delete action. */\n extraItems?: ActionMenuItem[];\n align?: 'start' | 'end';\n trigger?: ReactNode;\n}\n\nconst DANGER_ITEM_CLASS = 'text-status-error-text focus:text-status-error-text';\n\n/**\n * Canonical row overflow menu (View / Edit / Delete) for CosmicIntersection list\n * pages. Built on the fe-libs Radix DropdownMenu (keyboard nav, Escape,\n * outside-click, focus return). Delete routes through an AlertDialog confirm\n * before the destructive handler fires. Safe inside clickable cards/rows — the\n * trigger and content stop click propagation.\n */\nexport function ActionMenu({\n ariaLabel,\n onView,\n onEdit,\n onDelete,\n entityName,\n deleteLabel: deleteLabelProp,\n extraItems = [],\n align = 'end',\n trigger,\n}: ActionMenuProps) {\n const tr = useTr();\n const deleteLabel = deleteLabelProp ?? tr('cosmicintersection.common.delete', 'Delete');\n const [confirmOpen, setConfirmOpen] = useState(false);\n const [deleting, setDeleting] = useState(false);\n\n const handleConfirmDelete = async () => {\n if (!onDelete) {\n return;\n }\n try {\n setDeleting(true);\n await onDelete();\n setConfirmOpen(false);\n } catch {\n // The handler surfaces its own error (toast); keep the dialog open so the\n // user can retry or cancel rather than silently dismissing.\n } finally {\n setDeleting(false);\n }\n };\n\n const triggerNode = trigger ?? (\n <button\n type=\"button\"\n className=\"inline-flex size-9 items-center justify-center rounded-button text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus max-md:size-11\"\n aria-label={ariaLabel}\n >\n <MoreVertical className=\"size-4\" aria-hidden=\"true\" />\n </button>\n );\n\n const hasAnyItem = Boolean(onView || onEdit || extraItems.length > 0 || onDelete);\n if (!hasAnyItem) {\n return null;\n }\n\n return (\n <>\n <DropdownMenu>\n <DropdownMenuTrigger\n asChild\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {triggerNode}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align={align}\n className=\"min-w-44\"\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => event.stopPropagation()}\n >\n {onView ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onView()}>\n <Eye className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{tr('cosmicintersection.common.view', 'View')}</span>\n </DropdownMenuItem>\n ) : null}\n {onEdit ? (\n <DropdownMenuItem className=\"cursor-pointer gap-2\" onSelect={() => onEdit()}>\n <Pencil className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{tr('cosmicintersection.common.edit', 'Edit')}</span>\n </DropdownMenuItem>\n ) : null}\n {extraItems.map((item) => {\n const Icon = item.icon;\n return (\n <div key={item.key} className=\"contents\">\n {item.separatorBefore ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n disabled={item.disabled}\n onSelect={() => item.onSelect()}\n className={`cursor-pointer gap-2 ${item.variant === 'danger' ? DANGER_ITEM_CLASS : ''}`}\n >\n {Icon ? <Icon className=\"size-4 shrink-0\" aria-hidden=\"true\" /> : null}\n <span className=\"min-w-0 truncate\">{item.label}</span>\n </DropdownMenuItem>\n </div>\n );\n })}\n {onDelete ? (\n <div className=\"contents\">\n {onView || onEdit || extraItems.length > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem\n className={`cursor-pointer gap-2 ${DANGER_ITEM_CLASS}`}\n onSelect={() => setConfirmOpen(true)}\n >\n <Trash2 className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span>{deleteLabel}</span>\n </DropdownMenuItem>\n </div>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n\n {onDelete ? (\n <AlertDialog\n open={confirmOpen}\n onOpenChange={(next) => (deleting ? undefined : setConfirmOpen(next))}\n >\n <AlertDialogContent onClick={(event) => event.stopPropagation()}>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {deleteLabel}\n {entityName ? ` “${entityName}”?` : '?'}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {tr(\n 'cosmicintersection.common.confirmDelete',\n 'This action cannot be undone. This record will be permanently affected.'\n )}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={deleting}>\n {tr('cosmicintersection.common.cancel', 'Cancel')}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={(event) => {\n event.preventDefault();\n void handleConfirmDelete();\n }}\n disabled={deleting}\n className={buttonVariants({ variant: 'destructive' })}\n >\n {deleting ? tr('cosmicintersection.common.working', 'Working…') : deleteLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n ) : null}\n </>\n );\n}\n\nexport default ActionMenu;\n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D,EAAA,UAAA,CACG9B,GACA+B,IAAa,KAAKA,EAAW,MAAM,GACpB,EAAA,CAAA,GAClB,kBAACC,GAAD,EAAA,UACGlC,EACC,2CACA,yEACF,EACsB,CAAA,CACP,EAAA,CAAA,GACnB,kBAACmC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;IAAmB,UAAU9B;IAC1B,UAAAN,EAAG,oCAAoC,QAAQ;GAC/B,CAAA,GACnB,kBAACqC,GAAD;IACE,UAAU,MAAU;KAElB,AADAlB,EAAM,eAAe,GACrBX,EAAyB;IAC3B;IACA,UAAUF;IACV,WAAWgC,EAAe,EAAE,SAAS,cAAc,CAAC;IAEnD,UAAAhC,IAAWN,EAAG,qCAAqC,UAAU,IAAIE;GACjD,CAAA,CACF,EAAA,CAAA,CACD;;CACT,CAAA,IACX,IACJ,EAAA,CAAA,IAlGK;AAoGX"}
@@ -7,4 +7,3 @@ export interface ActivityFeedPanelProps {
7
7
  }
8
8
  export declare function ActivityFeedPanel({ resourceId, resourceType, limit, emptyDescription, }: ActivityFeedPanelProps): import('react').JSX.Element;
9
9
  export default ActivityFeedPanel;
10
- //# sourceMappingURL=ActivityFeedPanel.d.ts.map