@stigmer/react 3.11.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (559) hide show
  1. package/activity/useRecentActivity.d.ts +3 -2
  2. package/activity/useRecentActivity.d.ts.map +1 -1
  3. package/activity/useRecentActivity.js +3 -2
  4. package/activity/useRecentActivity.js.map +1 -1
  5. package/agent/AgentDetailView.d.ts +2 -12
  6. package/agent/AgentDetailView.d.ts.map +1 -1
  7. package/agent/AgentDetailView.js +10 -42
  8. package/agent/AgentDetailView.js.map +1 -1
  9. package/agent/internal/agentToInput.d.ts.map +1 -1
  10. package/agent/internal/agentToInput.js +0 -8
  11. package/agent/internal/agentToInput.js.map +1 -1
  12. package/agent-instance/AgentInstanceList.d.ts.map +1 -1
  13. package/agent-instance/AgentInstanceList.js +2 -1
  14. package/agent-instance/AgentInstanceList.js.map +1 -1
  15. package/api-key/ApiKeyListPanel.d.ts.map +1 -1
  16. package/api-key/ApiKeyListPanel.js +2 -1
  17. package/api-key/ApiKeyListPanel.js.map +1 -1
  18. package/attachment/AttachmentChipList.d.ts.map +1 -1
  19. package/attachment/AttachmentChipList.js +9 -8
  20. package/attachment/AttachmentChipList.js.map +1 -1
  21. package/attachment/AttachmentImageLightbox.d.ts.map +1 -1
  22. package/attachment/AttachmentImageLightbox.js +1 -1
  23. package/attachment/AttachmentImageLightbox.js.map +1 -1
  24. package/channel/AgentChannelsPanel.d.ts.map +1 -1
  25. package/channel/AgentChannelsPanel.js +2 -1
  26. package/channel/AgentChannelsPanel.js.map +1 -1
  27. package/channel/ChannelConversationsDialog.d.ts.map +1 -1
  28. package/channel/ChannelConversationsDialog.js +2 -1
  29. package/channel/ChannelConversationsDialog.js.map +1 -1
  30. package/channel/ChannelTemplatesDialog.d.ts.map +1 -1
  31. package/channel/ChannelTemplatesDialog.js +2 -1
  32. package/channel/ChannelTemplatesDialog.js.map +1 -1
  33. package/channel-app/internal.d.ts.map +1 -1
  34. package/channel-app/internal.js +2 -1
  35. package/channel-app/internal.js.map +1 -1
  36. package/composer/ComposerToolbar.d.ts.map +1 -1
  37. package/composer/ComposerToolbar.js +10 -7
  38. package/composer/ComposerToolbar.js.map +1 -1
  39. package/composer/ConfigureMenu.d.ts.map +1 -1
  40. package/composer/ConfigureMenu.js +2 -1
  41. package/composer/ConfigureMenu.js.map +1 -1
  42. package/composer/ContextChip.d.ts.map +1 -1
  43. package/composer/ContextChip.js +2 -1
  44. package/composer/ContextChip.js.map +1 -1
  45. package/composer/ContextPopover.d.ts.map +1 -1
  46. package/composer/ContextPopover.js +2 -1
  47. package/composer/ContextPopover.js.map +1 -1
  48. package/composer/SessionComposer.d.ts +13 -0
  49. package/composer/SessionComposer.d.ts.map +1 -1
  50. package/composer/SessionComposer.js +12 -2
  51. package/composer/SessionComposer.js.map +1 -1
  52. package/conversation/ConversationMediaAttachment.d.ts.map +1 -1
  53. package/conversation/ConversationMediaAttachment.js +2 -1
  54. package/conversation/ConversationMediaAttachment.js.map +1 -1
  55. package/conversation/ConversationTimelineView.d.ts.map +1 -1
  56. package/conversation/ConversationTimelineView.js +14 -4
  57. package/conversation/ConversationTimelineView.js.map +1 -1
  58. package/conversation/conversationPresentation.d.ts +28 -0
  59. package/conversation/conversationPresentation.d.ts.map +1 -1
  60. package/conversation/conversationPresentation.js +38 -1
  61. package/conversation/conversationPresentation.js.map +1 -1
  62. package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -1
  63. package/cursor-accounts/MemberCoverageTable.js +6 -5
  64. package/cursor-accounts/MemberCoverageTable.js.map +1 -1
  65. package/dashboard/DashboardKPICards.d.ts.map +1 -1
  66. package/dashboard/DashboardKPICards.js +3 -1
  67. package/dashboard/DashboardKPICards.js.map +1 -1
  68. package/dependency-graph/DependencyTreeNode.d.ts.map +1 -1
  69. package/dependency-graph/DependencyTreeNode.js +1 -7
  70. package/dependency-graph/DependencyTreeNode.js.map +1 -1
  71. package/dependency-graph/types.d.ts +8 -20
  72. package/dependency-graph/types.d.ts.map +1 -1
  73. package/dependency-graph/useDependencyGraph.d.ts.map +1 -1
  74. package/dependency-graph/useDependencyGraph.js +2 -20
  75. package/dependency-graph/useDependencyGraph.js.map +1 -1
  76. package/environment/EnvironmentVariableEditor.d.ts.map +1 -1
  77. package/environment/EnvironmentVariableEditor.js +2 -1
  78. package/environment/EnvironmentVariableEditor.js.map +1 -1
  79. package/execution/ApprovalCard.d.ts.map +1 -1
  80. package/execution/ApprovalCard.js +1 -1
  81. package/execution/ApprovalCard.js.map +1 -1
  82. package/execution/ArtifactRowView.d.ts.map +1 -1
  83. package/execution/ArtifactRowView.js +2 -1
  84. package/execution/ArtifactRowView.js.map +1 -1
  85. package/execution/FilePathLink.d.ts +4 -4
  86. package/execution/FilePathLink.d.ts.map +1 -1
  87. package/execution/FilePathLink.js +4 -4
  88. package/execution/FilePathLink.js.map +1 -1
  89. package/execution/McpToolDetail.d.ts.map +1 -1
  90. package/execution/McpToolDetail.js +2 -1
  91. package/execution/McpToolDetail.js.map +1 -1
  92. package/execution/MessageAttachments.d.ts.map +1 -1
  93. package/execution/MessageAttachments.js +10 -8
  94. package/execution/MessageAttachments.js.map +1 -1
  95. package/execution/MessageEntry.d.ts.map +1 -1
  96. package/execution/MessageEntry.js +2 -1
  97. package/execution/MessageEntry.js.map +1 -1
  98. package/execution/PlanArtifactCard.d.ts.map +1 -1
  99. package/execution/PlanArtifactCard.js +7 -4
  100. package/execution/PlanArtifactCard.js.map +1 -1
  101. package/execution/ToolCallDetail.d.ts.map +1 -1
  102. package/execution/ToolCallDetail.js +1 -1
  103. package/execution/ToolCallDetail.js.map +1 -1
  104. package/execution/ToolCallItem.d.ts.map +1 -1
  105. package/execution/ToolCallItem.js +5 -1
  106. package/execution/ToolCallItem.js.map +1 -1
  107. package/execution/WriteBackCard.d.ts.map +1 -1
  108. package/execution/WriteBackCard.js +6 -4
  109. package/execution/WriteBackCard.js.map +1 -1
  110. package/execution/artifact-row-item.d.ts +1 -1
  111. package/execution/artifact-row-item.d.ts.map +1 -1
  112. package/file-reference/FileReferenceChipList.d.ts.map +1 -1
  113. package/file-reference/FileReferenceChipList.js +6 -1
  114. package/file-reference/FileReferenceChipList.js.map +1 -1
  115. package/iam-policy/OrgMembersPanel.d.ts.map +1 -1
  116. package/iam-policy/OrgMembersPanel.js +6 -5
  117. package/iam-policy/OrgMembersPanel.js.map +1 -1
  118. package/iam-policy/ProviderBadge.d.ts.map +1 -1
  119. package/iam-policy/ProviderBadge.js +3 -2
  120. package/iam-policy/ProviderBadge.js.map +1 -1
  121. package/iam-policy/RoleSelector.d.ts.map +1 -1
  122. package/iam-policy/RoleSelector.js +1 -1
  123. package/iam-policy/RoleSelector.js.map +1 -1
  124. package/identity-provider/IdentityProviderListPanel.d.ts.map +1 -1
  125. package/identity-provider/IdentityProviderListPanel.js +2 -1
  126. package/identity-provider/IdentityProviderListPanel.js.map +1 -1
  127. package/index.d.ts +0 -2
  128. package/index.d.ts.map +1 -1
  129. package/index.js +0 -6
  130. package/index.js.map +1 -1
  131. package/internal/truncated-text.d.ts +17 -0
  132. package/internal/truncated-text.d.ts.map +1 -0
  133. package/internal/truncated-text.js +27 -0
  134. package/internal/truncated-text.js.map +1 -0
  135. package/invitation/InvitationManager.d.ts.map +1 -1
  136. package/invitation/InvitationManager.js +4 -3
  137. package/invitation/InvitationManager.js.map +1 -1
  138. package/library/ScopeToggle.d.ts.map +1 -1
  139. package/library/ScopeToggle.js +10 -2
  140. package/library/ScopeToggle.js.map +1 -1
  141. package/library/VisibilitySelector.d.ts.map +1 -1
  142. package/library/VisibilitySelector.js +2 -1
  143. package/library/VisibilitySelector.js.map +1 -1
  144. package/library/useExportResource.d.ts +3 -4
  145. package/library/useExportResource.d.ts.map +1 -1
  146. package/library/useExportResource.js +1 -1
  147. package/library/useExportResource.js.map +1 -1
  148. package/manifest/EditResourceYamlDialog.d.ts.map +1 -1
  149. package/manifest/EditResourceYamlDialog.js.map +1 -1
  150. package/mcp-server/McpServerConfigPanel.d.ts +30 -1
  151. package/mcp-server/McpServerConfigPanel.d.ts.map +1 -1
  152. package/mcp-server/McpServerConfigPanel.js +18 -8
  153. package/mcp-server/McpServerConfigPanel.js.map +1 -1
  154. package/mcp-server/McpServerConnectDialog.d.ts +12 -1
  155. package/mcp-server/McpServerConnectDialog.d.ts.map +1 -1
  156. package/mcp-server/McpServerConnectDialog.js +8 -7
  157. package/mcp-server/McpServerConnectDialog.js.map +1 -1
  158. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  159. package/mcp-server/McpServerDetailView.js +4 -4
  160. package/mcp-server/McpServerDetailView.js.map +1 -1
  161. package/mcp-server/McpServerPicker.d.ts.map +1 -1
  162. package/mcp-server/McpServerPicker.js +86 -5
  163. package/mcp-server/McpServerPicker.js.map +1 -1
  164. package/mcp-server/McpToolSelector.d.ts.map +1 -1
  165. package/mcp-server/McpToolSelector.js +2 -1
  166. package/mcp-server/McpToolSelector.js.map +1 -1
  167. package/mcp-server/VendorApprovalBlockedNotice.d.ts +77 -0
  168. package/mcp-server/VendorApprovalBlockedNotice.d.ts.map +1 -0
  169. package/mcp-server/VendorApprovalBlockedNotice.js +62 -0
  170. package/mcp-server/VendorApprovalBlockedNotice.js.map +1 -0
  171. package/mcp-server/mcpServerSetupReducer.d.ts +18 -0
  172. package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -1
  173. package/mcp-server/mcpServerSetupReducer.js +6 -0
  174. package/mcp-server/mcpServerSetupReducer.js.map +1 -1
  175. package/mcp-server/useMcpServerSetup.d.ts.map +1 -1
  176. package/mcp-server/useMcpServerSetup.js +7 -0
  177. package/mcp-server/useMcpServerSetup.js.map +1 -1
  178. package/oauth-app/OAuthAppListPanel.d.ts.map +1 -1
  179. package/oauth-app/OAuthAppListPanel.js +2 -1
  180. package/oauth-app/OAuthAppListPanel.js.map +1 -1
  181. package/package.json +4 -4
  182. package/platform-client/PlatformClientListPanel.d.ts.map +1 -1
  183. package/platform-client/PlatformClientListPanel.js +3 -2
  184. package/platform-client/PlatformClientListPanel.js.map +1 -1
  185. package/pricing-governance/BaselineEditor.d.ts.map +1 -1
  186. package/pricing-governance/BaselineEditor.js +7 -1
  187. package/pricing-governance/BaselineEditor.js.map +1 -1
  188. package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -1
  189. package/pricing-governance/ModelCatalogPanel.js +2 -1
  190. package/pricing-governance/ModelCatalogPanel.js.map +1 -1
  191. package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -1
  192. package/pricing-governance/PricingGovernanceConsole.js +2 -1
  193. package/pricing-governance/PricingGovernanceConsole.js.map +1 -1
  194. package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -1
  195. package/pricing-governance/PricingGovernancePanel.js +2 -1
  196. package/pricing-governance/PricingGovernancePanel.js.map +1 -1
  197. package/resource-workbench/components/StatusBadge.d.ts.map +1 -1
  198. package/resource-workbench/components/StatusBadge.js +2 -1
  199. package/resource-workbench/components/StatusBadge.js.map +1 -1
  200. package/schedule/CadenceField.d.ts.map +1 -1
  201. package/schedule/CadenceField.js +15 -8
  202. package/schedule/CadenceField.js.map +1 -1
  203. package/schedule/ScheduleRunsTable.d.ts.map +1 -1
  204. package/schedule/ScheduleRunsTable.js +3 -2
  205. package/schedule/ScheduleRunsTable.js.map +1 -1
  206. package/session/PlanEditor.d.ts.map +1 -1
  207. package/session/PlanEditor.js +3 -5
  208. package/session/PlanEditor.js.map +1 -1
  209. package/sharing/AgentShareList.d.ts.map +1 -1
  210. package/sharing/AgentShareList.js +3 -1
  211. package/sharing/AgentShareList.js.map +1 -1
  212. package/sharing/ShareAgentDialog.d.ts.map +1 -1
  213. package/sharing/ShareAgentDialog.js +2 -1
  214. package/sharing/ShareAgentDialog.js.map +1 -1
  215. package/skill/SkillDetailView.d.ts.map +1 -1
  216. package/skill/SkillDetailView.js +3 -2
  217. package/skill/SkillDetailView.js.map +1 -1
  218. package/src/__tests__/helpers/open-menu.ts +88 -0
  219. package/src/__tests__/portal-container.test.tsx +3 -3
  220. package/src/activity/useRecentActivity.ts +3 -2
  221. package/src/agent/AgentDetailView.tsx +6 -130
  222. package/src/agent/internal/__tests__/agentToInput.test.ts +2 -11
  223. package/src/agent/internal/agentToInput.ts +0 -11
  224. package/src/agent-instance/AgentInstanceList.tsx +5 -6
  225. package/src/agent-instance/__tests__/AgentInstanceList.test.tsx +5 -4
  226. package/src/api-key/ApiKeyListPanel.tsx +11 -3
  227. package/src/attachment/AttachmentChipList.tsx +74 -65
  228. package/src/attachment/AttachmentImageLightbox.tsx +5 -4
  229. package/src/attachment/__tests__/AttachmentChipList.test.tsx +4 -3
  230. package/src/channel/AgentChannelsPanel.tsx +5 -6
  231. package/src/channel/ChannelConversationsDialog.tsx +5 -3
  232. package/src/channel/ChannelTemplatesDialog.tsx +5 -6
  233. package/src/channel/__tests__/AgentChannelsPanel.test.tsx +14 -9
  234. package/src/channel-app/internal.tsx +5 -6
  235. package/src/composer/ComposerToolbar.tsx +122 -90
  236. package/src/composer/ConfigureMenu.tsx +33 -24
  237. package/src/composer/ContextChip.tsx +2 -3
  238. package/src/composer/ContextPopover.tsx +27 -18
  239. package/src/composer/SessionComposer.tsx +41 -9
  240. package/src/composer/__tests__/SessionComposer-agentSetupError.test.tsx +124 -0
  241. package/src/composer/__tests__/SessionComposer-lockAgent.test.tsx +4 -9
  242. package/src/conversation/ConversationMediaAttachment.tsx +2 -2
  243. package/src/conversation/ConversationTimelineView.tsx +19 -2
  244. package/src/conversation/__tests__/ConversationTimelineView.test.tsx +106 -3
  245. package/src/conversation/conversationPresentation.ts +52 -1
  246. package/src/cursor-accounts/MemberCoverageTable.tsx +15 -13
  247. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +4 -4
  248. package/src/dashboard/DashboardKPICards.tsx +2 -1
  249. package/src/dependency-graph/DependencyTreeNode.tsx +1 -7
  250. package/src/dependency-graph/__tests__/useDependencyGraph.test.ts +18 -34
  251. package/src/dependency-graph/types.ts +8 -20
  252. package/src/dependency-graph/useDependencyGraph.ts +2 -22
  253. package/src/environment/EnvironmentVariableEditor.tsx +17 -6
  254. package/src/execution/ApprovalCard.tsx +1 -3
  255. package/src/execution/ArtifactRowView.tsx +68 -48
  256. package/src/execution/FilePathLink.tsx +43 -27
  257. package/src/execution/McpToolDetail.tsx +6 -2
  258. package/src/execution/MessageAttachments.tsx +57 -41
  259. package/src/execution/MessageEntry.tsx +22 -15
  260. package/src/execution/PlanArtifactCard.tsx +25 -18
  261. package/src/execution/ToolCallDetail.tsx +1 -4
  262. package/src/execution/ToolCallItem.tsx +18 -7
  263. package/src/execution/WriteBackCard.tsx +38 -29
  264. package/src/execution/__tests__/ArtifactRow.test.tsx +6 -2
  265. package/src/execution/__tests__/ArtifactRowView.test.tsx +5 -2
  266. package/src/execution/__tests__/FilePathLink.test.tsx +10 -6
  267. package/src/execution/__tests__/FileReviewCard.test.tsx +2 -1
  268. package/src/execution/__tests__/MessageEntry-attachments.test.tsx +3 -2
  269. package/src/execution/__tests__/MessageThread.test.tsx +6 -1
  270. package/src/execution/__tests__/artifact-row-tooltips.layout.test.tsx +115 -0
  271. package/src/execution/artifact-row-item.ts +1 -1
  272. package/src/file-reference/FileReferenceChipList.tsx +29 -17
  273. package/src/file-reference/__tests__/FileReferenceChipList.test.tsx +5 -2
  274. package/src/iam-policy/OrgMembersPanel.tsx +26 -19
  275. package/src/iam-policy/ProviderBadge.tsx +17 -10
  276. package/src/iam-policy/RoleSelector.tsx +0 -1
  277. package/src/identity-provider/IdentityProviderListPanel.tsx +11 -3
  278. package/src/index.ts +0 -82
  279. package/src/internal/__tests__/truncated-text.layout.test.tsx +68 -0
  280. package/src/internal/__tests__/truncated-text.test.tsx +33 -0
  281. package/src/internal/truncated-text.tsx +81 -0
  282. package/src/invitation/InvitationManager.tsx +18 -5
  283. package/src/library/ScopeToggle.tsx +14 -2
  284. package/src/library/VisibilitySelector.tsx +21 -14
  285. package/src/library/useExportResource.ts +3 -4
  286. package/src/manifest/EditResourceYamlDialog.tsx +1 -2
  287. package/src/manifest/__tests__/ApplyManifestDialog.test.tsx +2 -2
  288. package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +9 -9
  289. package/src/mcp-server/McpServerConfigPanel.tsx +79 -37
  290. package/src/mcp-server/McpServerConnectDialog.tsx +41 -5
  291. package/src/mcp-server/McpServerDetailView.tsx +23 -39
  292. package/src/mcp-server/McpServerPicker.tsx +99 -7
  293. package/src/mcp-server/McpToolSelector.tsx +12 -7
  294. package/src/mcp-server/VendorApprovalBlockedNotice.tsx +221 -0
  295. package/src/mcp-server/__tests__/McpServerPicker.test.tsx +504 -0
  296. package/src/mcp-server/__tests__/VendorApprovalBlocked.surfaces.test.tsx +321 -0
  297. package/src/mcp-server/__tests__/VendorApprovalBlockedNotice.test.tsx +154 -0
  298. package/src/mcp-server/mcpServerSetupReducer.ts +24 -0
  299. package/src/mcp-server/useMcpServerSetup.ts +9 -0
  300. package/src/oauth-app/OAuthAppListPanel.tsx +11 -3
  301. package/src/platform-client/PlatformClientListPanel.tsx +35 -18
  302. package/src/pricing-governance/BaselineEditor.tsx +20 -0
  303. package/src/pricing-governance/ModelCatalogPanel.tsx +9 -5
  304. package/src/pricing-governance/PricingGovernanceConsole.tsx +9 -5
  305. package/src/pricing-governance/PricingGovernancePanel.tsx +13 -4
  306. package/src/pricing-governance/__tests__/ModelCatalogPanel.test.tsx +37 -0
  307. package/src/resource-workbench/components/StatusBadge.tsx +7 -3
  308. package/src/schedule/CadenceField.tsx +38 -27
  309. package/src/schedule/ScheduleRunsTable.tsx +23 -11
  310. package/src/schedule/__tests__/cadence-tooltips.layout.test.tsx +86 -0
  311. package/src/session/PlanEditor.tsx +9 -8
  312. package/src/sharing/AgentShareList.tsx +28 -22
  313. package/src/sharing/ShareAgentDialog.tsx +5 -6
  314. package/src/sharing/__tests__/AgentShareList.test.tsx +4 -4
  315. package/src/skill/SkillDetailView.tsx +23 -12
  316. package/src/version-history/VersionTimelineEntry.tsx +21 -12
  317. package/src/workflow/CanvasTransitionEdge.tsx +23 -16
  318. package/src/workflow/ExecutionActiveTaskIndicator.tsx +74 -59
  319. package/src/workflow/TaskPickerPopover.tsx +0 -1
  320. package/src/workflow/WorkflowCanvasEditor.tsx +95 -64
  321. package/src/workflow/WorkflowNode.tsx +13 -6
  322. package/src/workflow/WorkflowTaskApprovalSummary.tsx +18 -11
  323. package/src/workflow/WorkflowTaskList.tsx +2 -2
  324. package/src/workflow/WorkflowVersionBadge.tsx +33 -18
  325. package/src/workflow/WorkflowVersionTimeline.tsx +7 -6
  326. package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +3 -1
  327. package/src/workflow/__tests__/structured-data-viewer.test.tsx +5 -2
  328. package/src/workflow/execution-comparison/ExecutionComparisonView.tsx +5 -3
  329. package/src/workflow/execution-comparison/TaskComparisonTable.tsx +12 -5
  330. package/src/workflow/execution-history/ExecutionHistoryTable.tsx +24 -15
  331. package/src/workflow/inspector/InspectorHeader.tsx +20 -11
  332. package/src/workflow/inspector/NestedTaskList.tsx +18 -11
  333. package/src/workflow/inspector/WorkflowSummaryPanel.tsx +5 -3
  334. package/src/workflow/inspector/tabs/BranchesTab.tsx +61 -31
  335. package/src/workflow/instance/WorkflowInstanceList.tsx +5 -6
  336. package/src/workflow/instance/__tests__/WorkflowInstanceList.test.tsx +5 -4
  337. package/src/workflow/node-shell/DiffBadge.tsx +18 -11
  338. package/src/workflow/node-shell/ExecutionBadge.tsx +73 -46
  339. package/src/workflow/node-shell/NodeActions.tsx +128 -94
  340. package/src/workflow/task-detail/StructuredDataViewer.tsx +4 -2
  341. package/src/workspace/EditorTabs.tsx +102 -85
  342. package/src/workspace/ExplorerTree.tsx +47 -30
  343. package/src/workspace/FileViewer.tsx +11 -3
  344. package/src/workspace/PanelChip.tsx +32 -23
  345. package/src/workspace/WorkspaceEditor.tsx +21 -9
  346. package/src/workspace/WorkspaceSummary.tsx +21 -12
  347. package/src/workspace/WorkspaceSurface.tsx +86 -61
  348. package/src/workspace/__tests__/EditorTabs.test.tsx +5 -2
  349. package/src/workspace/__tests__/WorkspaceSurface.test.tsx +5 -2
  350. package/styles.css +1 -1
  351. package/version-history/VersionTimelineEntry.d.ts.map +1 -1
  352. package/version-history/VersionTimelineEntry.js +2 -1
  353. package/version-history/VersionTimelineEntry.js.map +1 -1
  354. package/workflow/CanvasTransitionEdge.d.ts +1 -1
  355. package/workflow/CanvasTransitionEdge.d.ts.map +1 -1
  356. package/workflow/CanvasTransitionEdge.js +3 -2
  357. package/workflow/CanvasTransitionEdge.js.map +1 -1
  358. package/workflow/ExecutionActiveTaskIndicator.d.ts.map +1 -1
  359. package/workflow/ExecutionActiveTaskIndicator.js +12 -11
  360. package/workflow/ExecutionActiveTaskIndicator.js.map +1 -1
  361. package/workflow/TaskPickerPopover.js +1 -1
  362. package/workflow/TaskPickerPopover.js.map +1 -1
  363. package/workflow/WorkflowCanvasEditor.d.ts.map +1 -1
  364. package/workflow/WorkflowCanvasEditor.js +9 -2
  365. package/workflow/WorkflowCanvasEditor.js.map +1 -1
  366. package/workflow/WorkflowNode.d.ts.map +1 -1
  367. package/workflow/WorkflowNode.js +2 -1
  368. package/workflow/WorkflowNode.js.map +1 -1
  369. package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
  370. package/workflow/WorkflowTaskApprovalSummary.js +6 -4
  371. package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
  372. package/workflow/WorkflowTaskList.js +2 -2
  373. package/workflow/WorkflowTaskList.js.map +1 -1
  374. package/workflow/WorkflowVersionBadge.d.ts.map +1 -1
  375. package/workflow/WorkflowVersionBadge.js +2 -1
  376. package/workflow/WorkflowVersionBadge.js.map +1 -1
  377. package/workflow/WorkflowVersionTimeline.d.ts.map +1 -1
  378. package/workflow/WorkflowVersionTimeline.js +2 -1
  379. package/workflow/WorkflowVersionTimeline.js.map +1 -1
  380. package/workflow/execution-comparison/ExecutionComparisonView.d.ts.map +1 -1
  381. package/workflow/execution-comparison/ExecutionComparisonView.js +2 -1
  382. package/workflow/execution-comparison/ExecutionComparisonView.js.map +1 -1
  383. package/workflow/execution-comparison/TaskComparisonTable.d.ts.map +1 -1
  384. package/workflow/execution-comparison/TaskComparisonTable.js +2 -1
  385. package/workflow/execution-comparison/TaskComparisonTable.js.map +1 -1
  386. package/workflow/execution-history/ExecutionHistoryTable.d.ts.map +1 -1
  387. package/workflow/execution-history/ExecutionHistoryTable.js +6 -4
  388. package/workflow/execution-history/ExecutionHistoryTable.js.map +1 -1
  389. package/workflow/inspector/InspectorHeader.d.ts.map +1 -1
  390. package/workflow/inspector/InspectorHeader.js +4 -2
  391. package/workflow/inspector/InspectorHeader.js.map +1 -1
  392. package/workflow/inspector/NestedTaskList.d.ts.map +1 -1
  393. package/workflow/inspector/NestedTaskList.js +2 -1
  394. package/workflow/inspector/NestedTaskList.js.map +1 -1
  395. package/workflow/inspector/WorkflowSummaryPanel.d.ts.map +1 -1
  396. package/workflow/inspector/WorkflowSummaryPanel.js +2 -1
  397. package/workflow/inspector/WorkflowSummaryPanel.js.map +1 -1
  398. package/workflow/inspector/tabs/BranchesTab.d.ts.map +1 -1
  399. package/workflow/inspector/tabs/BranchesTab.js +5 -2
  400. package/workflow/inspector/tabs/BranchesTab.js.map +1 -1
  401. package/workflow/instance/WorkflowInstanceList.d.ts.map +1 -1
  402. package/workflow/instance/WorkflowInstanceList.js +2 -1
  403. package/workflow/instance/WorkflowInstanceList.js.map +1 -1
  404. package/workflow/node-shell/DiffBadge.d.ts.map +1 -1
  405. package/workflow/node-shell/DiffBadge.js +3 -2
  406. package/workflow/node-shell/DiffBadge.js.map +1 -1
  407. package/workflow/node-shell/ExecutionBadge.d.ts.map +1 -1
  408. package/workflow/node-shell/ExecutionBadge.js +5 -4
  409. package/workflow/node-shell/ExecutionBadge.js.map +1 -1
  410. package/workflow/node-shell/NodeActions.d.ts.map +1 -1
  411. package/workflow/node-shell/NodeActions.js +12 -11
  412. package/workflow/node-shell/NodeActions.js.map +1 -1
  413. package/workflow/task-detail/StructuredDataViewer.d.ts.map +1 -1
  414. package/workflow/task-detail/StructuredDataViewer.js +5 -1
  415. package/workflow/task-detail/StructuredDataViewer.js.map +1 -1
  416. package/workspace/EditorTabs.d.ts.map +1 -1
  417. package/workspace/EditorTabs.js +38 -37
  418. package/workspace/EditorTabs.js.map +1 -1
  419. package/workspace/ExplorerTree.d.ts.map +1 -1
  420. package/workspace/ExplorerTree.js +2 -1
  421. package/workspace/ExplorerTree.js.map +1 -1
  422. package/workspace/FileViewer.d.ts.map +1 -1
  423. package/workspace/FileViewer.js +2 -1
  424. package/workspace/FileViewer.js.map +1 -1
  425. package/workspace/PanelChip.d.ts.map +1 -1
  426. package/workspace/PanelChip.js +2 -1
  427. package/workspace/PanelChip.js.map +1 -1
  428. package/workspace/WorkspaceEditor.d.ts.map +1 -1
  429. package/workspace/WorkspaceEditor.js +2 -1
  430. package/workspace/WorkspaceEditor.js.map +1 -1
  431. package/workspace/WorkspaceSummary.d.ts.map +1 -1
  432. package/workspace/WorkspaceSummary.js +7 -2
  433. package/workspace/WorkspaceSummary.js.map +1 -1
  434. package/workspace/WorkspaceSurface.d.ts.map +1 -1
  435. package/workspace/WorkspaceSurface.js +12 -11
  436. package/workspace/WorkspaceSurface.js.map +1 -1
  437. package/datastore/CollectionRecordsBrowser.d.ts +0 -34
  438. package/datastore/CollectionRecordsBrowser.d.ts.map +0 -1
  439. package/datastore/CollectionRecordsBrowser.js +0 -223
  440. package/datastore/CollectionRecordsBrowser.js.map +0 -1
  441. package/datastore/CollectionSchemaView.d.ts +0 -29
  442. package/datastore/CollectionSchemaView.d.ts.map +0 -1
  443. package/datastore/CollectionSchemaView.js +0 -93
  444. package/datastore/CollectionSchemaView.js.map +0 -1
  445. package/datastore/DatastoreDetailView.d.ts +0 -44
  446. package/datastore/DatastoreDetailView.d.ts.map +0 -1
  447. package/datastore/DatastoreDetailView.js +0 -76
  448. package/datastore/DatastoreDetailView.js.map +0 -1
  449. package/datastore/DatastoreSyncReport.d.ts +0 -19
  450. package/datastore/DatastoreSyncReport.d.ts.map +0 -1
  451. package/datastore/DatastoreSyncReport.js +0 -45
  452. package/datastore/DatastoreSyncReport.js.map +0 -1
  453. package/datastore/DeleteDatastoreDialog.d.ts +0 -35
  454. package/datastore/DeleteDatastoreDialog.d.ts.map +0 -1
  455. package/datastore/DeleteDatastoreDialog.js +0 -90
  456. package/datastore/DeleteDatastoreDialog.js.map +0 -1
  457. package/datastore/FieldValueControl.d.ts +0 -55
  458. package/datastore/FieldValueControl.d.ts.map +0 -1
  459. package/datastore/FieldValueControl.js +0 -138
  460. package/datastore/FieldValueControl.js.map +0 -1
  461. package/datastore/RecordFilterBuilder.d.ts +0 -37
  462. package/datastore/RecordFilterBuilder.d.ts.map +0 -1
  463. package/datastore/RecordFilterBuilder.js +0 -122
  464. package/datastore/RecordFilterBuilder.js.map +0 -1
  465. package/datastore/RecordFormPanel.d.ts +0 -45
  466. package/datastore/RecordFormPanel.d.ts.map +0 -1
  467. package/datastore/RecordFormPanel.js +0 -215
  468. package/datastore/RecordFormPanel.js.map +0 -1
  469. package/datastore/index.d.ts +0 -43
  470. package/datastore/index.d.ts.map +0 -1
  471. package/datastore/index.js +0 -22
  472. package/datastore/index.js.map +0 -1
  473. package/datastore/recordFilter.d.ts +0 -62
  474. package/datastore/recordFilter.d.ts.map +0 -1
  475. package/datastore/recordFilter.js +0 -104
  476. package/datastore/recordFilter.js.map +0 -1
  477. package/datastore/recordValues.d.ts +0 -85
  478. package/datastore/recordValues.d.ts.map +0 -1
  479. package/datastore/recordValues.js +0 -282
  480. package/datastore/recordValues.js.map +0 -1
  481. package/datastore/useDatastore.d.ts +0 -39
  482. package/datastore/useDatastore.d.ts.map +0 -1
  483. package/datastore/useDatastore.js +0 -44
  484. package/datastore/useDatastore.js.map +0 -1
  485. package/datastore/useDatastoreCount.d.ts +0 -50
  486. package/datastore/useDatastoreCount.d.ts.map +0 -1
  487. package/datastore/useDatastoreCount.js +0 -27
  488. package/datastore/useDatastoreCount.js.map +0 -1
  489. package/datastore/useDatastoreDescription.d.ts +0 -54
  490. package/datastore/useDatastoreDescription.d.ts.map +0 -1
  491. package/datastore/useDatastoreDescription.js +0 -50
  492. package/datastore/useDatastoreDescription.js.map +0 -1
  493. package/datastore/useDatastoreList.d.ts +0 -57
  494. package/datastore/useDatastoreList.d.ts.map +0 -1
  495. package/datastore/useDatastoreList.js +0 -29
  496. package/datastore/useDatastoreList.js.map +0 -1
  497. package/datastore/useDatastoreSearch.d.ts +0 -19
  498. package/datastore/useDatastoreSearch.d.ts.map +0 -1
  499. package/datastore/useDatastoreSearch.js +0 -22
  500. package/datastore/useDatastoreSearch.js.map +0 -1
  501. package/datastore/useDeleteDatastore.d.ts +0 -53
  502. package/datastore/useDeleteDatastore.d.ts.map +0 -1
  503. package/datastore/useDeleteDatastore.js +0 -40
  504. package/datastore/useDeleteDatastore.js.map +0 -1
  505. package/datastore/useDeleteRecord.d.ts +0 -34
  506. package/datastore/useDeleteRecord.d.ts.map +0 -1
  507. package/datastore/useDeleteRecord.js +0 -43
  508. package/datastore/useDeleteRecord.js.map +0 -1
  509. package/datastore/useInsertRecord.d.ts +0 -50
  510. package/datastore/useInsertRecord.d.ts.map +0 -1
  511. package/datastore/useInsertRecord.js +0 -55
  512. package/datastore/useInsertRecord.js.map +0 -1
  513. package/datastore/useRecordCollection.d.ts +0 -104
  514. package/datastore/useRecordCollection.d.ts.map +0 -1
  515. package/datastore/useRecordCollection.js +0 -136
  516. package/datastore/useRecordCollection.js.map +0 -1
  517. package/datastore/useRecordList.d.ts +0 -66
  518. package/datastore/useRecordList.d.ts.map +0 -1
  519. package/datastore/useRecordList.js +0 -58
  520. package/datastore/useRecordList.js.map +0 -1
  521. package/datastore/useUpdateRecord.d.ts +0 -52
  522. package/datastore/useUpdateRecord.d.ts.map +0 -1
  523. package/datastore/useUpdateRecord.js +0 -55
  524. package/datastore/useUpdateRecord.js.map +0 -1
  525. package/src/agent/__tests__/AgentDetailView.datastores.test.tsx +0 -166
  526. package/src/datastore/CollectionRecordsBrowser.tsx +0 -570
  527. package/src/datastore/CollectionSchemaView.tsx +0 -247
  528. package/src/datastore/DatastoreDetailView.tsx +0 -201
  529. package/src/datastore/DatastoreSyncReport.tsx +0 -105
  530. package/src/datastore/DeleteDatastoreDialog.tsx +0 -202
  531. package/src/datastore/FieldValueControl.tsx +0 -289
  532. package/src/datastore/RecordFilterBuilder.tsx +0 -422
  533. package/src/datastore/RecordFormPanel.tsx +0 -432
  534. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +0 -245
  535. package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +0 -133
  536. package/src/datastore/__tests__/FieldValueControl.test.tsx +0 -160
  537. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +0 -155
  538. package/src/datastore/__tests__/RecordFormPanel.test.tsx +0 -227
  539. package/src/datastore/__tests__/recordFilter.test.ts +0 -169
  540. package/src/datastore/__tests__/recordMutations.test.tsx +0 -195
  541. package/src/datastore/__tests__/recordValues.test.ts +0 -359
  542. package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +0 -142
  543. package/src/datastore/__tests__/useDatastoreDescription.test.tsx +0 -143
  544. package/src/datastore/__tests__/useRecordCollection.test.tsx +0 -250
  545. package/src/datastore/__tests__/useRecordList.test.tsx +0 -85
  546. package/src/datastore/index.ts +0 -111
  547. package/src/datastore/recordFilter.ts +0 -154
  548. package/src/datastore/recordValues.ts +0 -327
  549. package/src/datastore/useDatastore.ts +0 -67
  550. package/src/datastore/useDatastoreCount.ts +0 -69
  551. package/src/datastore/useDatastoreDescription.ts +0 -90
  552. package/src/datastore/useDatastoreList.ts +0 -79
  553. package/src/datastore/useDatastoreSearch.ts +0 -39
  554. package/src/datastore/useDeleteDatastore.ts +0 -87
  555. package/src/datastore/useDeleteRecord.ts +0 -77
  556. package/src/datastore/useInsertRecord.ts +0 -92
  557. package/src/datastore/useRecordCollection.ts +0 -256
  558. package/src/datastore/useRecordList.ts +0 -131
  559. package/src/datastore/useUpdateRecord.ts +0 -95
@@ -1,223 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useMemo, useState } from "react";
4
- import { cn } from "@stigmer/theme";
5
- import { timestampDate } from "@bufbuild/protobuf/wkt";
6
- import { getUserMessage, isPermissionDenied } from "@stigmer/sdk";
7
- import { DatastoreVerb, FieldType, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
8
- import { ResourceTable } from "../resource-workbench/components/ResourceTable.js";
9
- import { ConfirmDialog } from "../resource-detail/ConfirmDialog.js";
10
- import { useConfirmAction } from "../resource-detail/useConfirmAction.js";
11
- import { toast } from "../feedback/toast.js";
12
- import { FIELD_INPUT_CLASSES } from "./FieldValueControl.js";
13
- import { RecordFilterBuilder } from "./RecordFilterBuilder.js";
14
- import { RecordFormPanel } from "./RecordFormPanel.js";
15
- import { buildRecordFilter } from "./recordFilter.js";
16
- import { formatFieldValue, formatSystemTimestamp, isSortableField, } from "./recordValues.js";
17
- import { useDatastoreDescription } from "./useDatastoreDescription.js";
18
- import { useRecordCollection } from "./useRecordCollection.js";
19
- import { useDeleteRecord } from "./useDeleteRecord.js";
20
- const PAGE_SIZE = 25;
21
- /**
22
- * The records browser (DD-008 SD-3): collection selector, partition
23
- * picker, schema-aware filter builder, typed-cell grid, RPC-paged
24
- * navigation, and verb-gated write affordances — the console surface
25
- * that absorbs the Supabase-dashboard capability the datastore
26
- * primitive retires.
27
- *
28
- * Authorization is rendered as the two layers it is:
29
- * - Write affordances gate on `describeDatastore`'s per-collection
30
- * effective verbs (projections, never authority — the server's
31
- * record layer stays the enforcer).
32
- * - **The denied state is a first-class render**, driven primarily by
33
- * empty access lists (deny-by-default renders as empty access, never
34
- * an error) with a caught reach-level `PERMISSION_DENIED` as the
35
- * defensive branch. Both show the relayable message plus operator
36
- * guidance — never a silently empty grid.
37
- *
38
- * All visual properties flow through `--stgm-*` design tokens.
39
- * Zero Console dependencies — safe for platform builder embedding.
40
- */
41
- export function CollectionRecordsBrowser({ org, datastoreSlug, spec, className, }) {
42
- const collections = spec.collections;
43
- const [collectionName, setCollectionName] = useState(collections[0]?.name ?? "");
44
- const collection = collections.find((c) => c.name === collectionName);
45
- const description = useDatastoreDescription(org, datastoreSlug);
46
- const [partition, setPartition] = useState("default");
47
- // Filter, sort, and page state — per collection selection.
48
- const [conditions, setConditions] = useState([]);
49
- const [sort, setSort] = useState(null);
50
- const [page, setPage] = useState(1);
51
- const selectCollection = useCallback((name) => {
52
- setCollectionName(name);
53
- setConditions([]);
54
- setSort(null);
55
- setPage(1);
56
- }, []);
57
- const selectPartition = useCallback((name) => {
58
- setPartition(name);
59
- setPage(1);
60
- }, []);
61
- const applyConditions = useCallback((next) => {
62
- setConditions(next);
63
- setPage(1);
64
- }, []);
65
- if (collections.length === 0) {
66
- return (_jsx("p", { className: cn("stg:px-3 stg:py-6 stg:text-center stg:text-sm stg:text-muted-foreground", className), children: "This datastore declares no collections." }));
67
- }
68
- if (!collection)
69
- return null;
70
- const collectionAccess = description.description?.collections.find((c) => c.name === collection.name);
71
- return (_jsxs("div", { className: cn("stg:flex stg:flex-col stg:gap-3", className), children: [_jsxs("div", { className: "stg:flex stg:flex-wrap stg:items-center stg:gap-2", children: [_jsxs("label", { className: "stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:text-muted-foreground", children: ["Collection", _jsx("select", { className: cn(FIELD_INPUT_CLASSES, "stg:w-auto"), value: collectionName, onChange: (e) => selectCollection(e.target.value), children: collections.map((c) => (_jsx("option", { value: c.name, children: c.name }, c.name))) })] }), _jsxs("label", { className: "stg:flex stg:items-center stg:gap-1.5 stg:text-xs stg:font-medium stg:text-muted-foreground", children: ["Partition", _jsx("select", { className: cn(FIELD_INPUT_CLASSES, "stg:w-auto"), value: partition, onChange: (e) => selectPartition(e.target.value), children: description.partitions.map((p) => (_jsx("option", { value: p, children: p }, p))) })] })] }), _jsx(RecordsPane, { org: org, datastoreSlug: datastoreSlug, collection: collection, partition: partition, conditions: conditions, onConditionsChange: applyConditions, sort: sort, onSortChange: setSort, page: page, onPageChange: setPage, access: collectionAccess, describeError: description.error, describeLoaded: description.description !== null })] }));
72
- }
73
- // ---------------------------------------------------------------------------
74
- // The per-collection pane: denied panel or grid
75
- // ---------------------------------------------------------------------------
76
- function RecordsPane({ org, datastoreSlug, collection, partition, conditions, onConditionsChange, sort, onSortChange, page, onPageChange, access, describeError, describeLoaded, }) {
77
- const verbs = useMemo(() => {
78
- const set = new Set();
79
- for (const grant of access?.access ?? [])
80
- set.add(grant.verb);
81
- return set;
82
- }, [access]);
83
- const canRead = verbs.has(DatastoreVerb.read);
84
- const canInsert = verbs.has(DatastoreVerb.insert);
85
- const canUpdate = verbs.has(DatastoreVerb.update);
86
- const canDelete = verbs.has(DatastoreVerb.delete);
87
- // The caller's column-level read access (empty means every field): a
88
- // field-restricted read grant returns only these fields, so the grid
89
- // and the filter builder narrow to them — no permanently-empty
90
- // columns, no filter the server would refuse (DD-008 invariant 2).
91
- const readableFields = useMemo(() => access?.access.find((a) => a.verb === DatastoreVerb.read)?.readableFields ?? [], [access]);
92
- const scope = { org, datastore: datastoreSlug, collection: collection.name, partition };
93
- const filter = useMemo(() => buildRecordFilter(conditions), [conditions]);
94
- const columns = useMemo(() => buildRecordColumns(collection, readableFields), [collection, readableFields]);
95
- // Fetch only once read access is confirmed — the denied panel is the
96
- // primary render for deny-by-default, not a failed query.
97
- const records = useRecordCollection({
98
- org: describeLoaded && canRead ? org : null,
99
- datastore: datastoreSlug,
100
- collection: collection.name,
101
- partition,
102
- filter,
103
- page,
104
- pageSize: PAGE_SIZE,
105
- sort,
106
- onSortChange,
107
- columns,
108
- });
109
- // Row actions and write panel state.
110
- const [formOpen, setFormOpen] = useState(false);
111
- const [editing, setEditing] = useState(null);
112
- const { confirmState, confirm, handleConfirm, handleCancel } = useConfirmAction();
113
- const deleteRecord = useDeleteRecord();
114
- const openInsert = useCallback(() => {
115
- setEditing(null);
116
- setFormOpen(true);
117
- }, []);
118
- const openEdit = useCallback((record) => {
119
- setEditing(record);
120
- setFormOpen(true);
121
- }, []);
122
- // Deps narrowed to the specific stable callbacks used (DD-010).
123
- const deleteRecordFn = deleteRecord.deleteRecord;
124
- const refetchRecords = records.refetch;
125
- const collectionName = collection.name;
126
- const handleDelete = useCallback(async (record) => {
127
- const ok = await confirm({
128
- title: "Delete record?",
129
- description: `Record ${record.id} will be permanently deleted.`,
130
- confirmLabel: "Delete",
131
- variant: "destructive",
132
- });
133
- if (!ok)
134
- return;
135
- try {
136
- await deleteRecordFn({
137
- org,
138
- datastore: datastoreSlug,
139
- collection: collectionName,
140
- partition,
141
- id: record.id,
142
- });
143
- toast.success("Record deleted");
144
- refetchRecords();
145
- }
146
- catch (err) {
147
- toast.error(getUserMessage(err));
148
- }
149
- }, [confirm, deleteRecordFn, refetchRecords, org, datastoreSlug, collectionName, partition]);
150
- // --- Denied states (DD-008 SD-3): first-class renders ---------------------
151
- if (describeError && isPermissionDenied(describeError)) {
152
- return _jsx(DeniedPanel, { message: getUserMessage(describeError) });
153
- }
154
- if (describeLoaded && !canRead) {
155
- return (_jsx(DeniedPanel, { message: `You do not have record access to “${collection.name}”.` }));
156
- }
157
- if (records.error && isPermissionDenied(records.error)) {
158
- return _jsx(DeniedPanel, { message: getUserMessage(records.error) });
159
- }
160
- const totalPages = Math.max(records.totalPages, 1);
161
- return (_jsxs("div", { className: "stg:flex stg:flex-col stg:gap-3", children: [_jsxs("div", { className: "stg:flex stg:flex-wrap stg:items-center stg:gap-2", children: [_jsx(RecordFilterBuilder, { collection: collection, readableFields: readableFields, conditions: conditions, onChange: onConditionsChange, className: "stg:min-w-0 stg:flex-1" }), canInsert && (_jsx("button", { type: "button", onClick: openInsert, className: cn("stg:shrink-0 stg:rounded-md stg:bg-primary stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-primary-foreground", "stg:hover:bg-primary-hover", "stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"), children: "Insert record" }))] }), records.error ? (_jsx("div", { role: "alert", className: "stg:rounded-md stg:border stg:border-destructive stg:bg-card stg:px-3 stg:py-2 stg:text-sm stg:text-destructive", children: getUserMessage(records.error) })) : records.isLoading ? (_jsx("div", { className: "stg:rounded-lg stg:border stg:border-border stg:px-3 stg:py-6 stg:text-center stg:text-sm stg:text-muted-foreground", children: "Loading records\u2026" })) : records.records.length === 0 ? (_jsx("div", { className: "stg:rounded-lg stg:border stg:border-border stg:px-3 stg:py-6 stg:text-center stg:text-sm stg:text-muted-foreground", children: conditions.length > 0
162
- ? "No records match the current filters."
163
- : `No records in “${collection.name}” yet.` })) : (records.table && (_jsx("div", { className: "stg:overflow-x-auto stg:rounded-lg stg:border stg:border-border", children: _jsx(ResourceTable, { table: records.table, "aria-label": `Records in ${collection.name}`, renderRowAction: canUpdate || canDelete
164
- ? (record) => (_jsx(RowActions, { record: record, canUpdate: canUpdate, canDelete: canDelete, onEdit: openEdit, onDelete: handleDelete }))
165
- : undefined }) }))), _jsxs("div", { className: "stg:flex stg:items-center stg:justify-between stg:text-xs stg:text-muted-foreground", children: [_jsxs("span", { children: [records.total, " record", records.total === 1 ? "" : "s"] }), _jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsx("button", { type: "button", onClick: () => onPageChange(page - 1), disabled: page <= 1, className: paginationButtonClass, children: "Previous" }), _jsxs("span", { children: ["Page ", page, " of ", totalPages] }), _jsx("button", { type: "button", onClick: () => onPageChange(page + 1), disabled: page >= totalPages, className: paginationButtonClass, children: "Next" })] })] }), _jsx(RecordFormPanel, { open: formOpen, onOpenChange: setFormOpen, scope: scope, collection: collection, record: editing, onSaved: () => records.refetch() }), _jsx(ConfirmDialog, { state: confirmState, onConfirm: handleConfirm, onCancel: handleCancel })] }));
166
- }
167
- const paginationButtonClass = cn("stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:text-foreground", "stg:hover:bg-accent stg:hover:text-accent-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50");
168
- // ---------------------------------------------------------------------------
169
- // Denied panel — an explanation, never an empty grid
170
- // ---------------------------------------------------------------------------
171
- function DeniedPanel({ message }) {
172
- return (_jsxs("div", { role: "status", className: "stg:flex stg:flex-col stg:items-center stg:gap-2 stg:rounded-lg stg:border stg:border-border stg:bg-muted stg:px-4 stg:py-8 stg:text-center", children: [_jsx("p", { className: "stg:text-sm stg:font-medium stg:text-foreground", children: message }), _jsxs("p", { className: "stg:max-w-md stg:text-xs stg:text-muted-foreground", children: ["Record access is granted by the datastore's authorization block. To gain access, add a role binding for your principal or set a", " ", _jsx("code", { className: "stg:font-mono", children: "default_role" }), " in the datastore YAML, with the verbs you need granted on this collection."] })] }));
173
- }
174
- // ---------------------------------------------------------------------------
175
- // Columns: typed cells from FieldDeclaration + system columns
176
- // ---------------------------------------------------------------------------
177
- /**
178
- * Grid columns for a collection: declared fields with typed cells, then
179
- * `created_at` (visible by default). The remaining system columns
180
- * (`id`, `updated_at`, `created_by`) stay out of the default grid —
181
- * they are shown in the record form's read-only summary; a column
182
- * toggle is recorded growth.
183
- *
184
- * `readableFields` narrows the declared columns to the caller's
185
- * column-level read access (empty means every field): a hidden field's
186
- * cells would be permanently empty, which reads as missing data rather
187
- * than restricted access.
188
- */
189
- function buildRecordColumns(collection, readableFields) {
190
- const readable = readableFields.length > 0 ? new Set(readableFields) : null;
191
- const declaredColumns = readable === null
192
- ? collection.fields
193
- : collection.fields.filter((field) => readable.has(field.name));
194
- const fieldColumns = declaredColumns.map((field) => ({
195
- id: field.name,
196
- header: field.name,
197
- sortable: isSortableField(field),
198
- cell: (record) => (_jsx(TypedCell, { value: formatFieldValue(field.type, record.fields?.[field.name]), numeric: field.type === FieldType.integer || field.type === FieldType.number, mono: field.type === FieldType.json })),
199
- }));
200
- return [
201
- ...fieldColumns,
202
- {
203
- id: "created_at",
204
- header: "created_at",
205
- sortable: true,
206
- cell: (record) => (_jsx(TypedCell, { value: record.createdAt
207
- ? formatSystemTimestamp(timestampDate(record.createdAt).toISOString())
208
- : "", mono: true })),
209
- },
210
- ];
211
- }
212
- function TypedCell({ value, numeric, mono, }) {
213
- const truncated = value.length > 80 ? `${value.slice(0, 79)}…` : value;
214
- return (_jsx("span", { title: value.length > 80 ? value : undefined, className: cn("stg:block stg:max-w-xs stg:truncate", numeric && "stg:text-right stg:tabular-nums", mono && "stg:font-mono"), children: truncated }));
215
- }
216
- // ---------------------------------------------------------------------------
217
- // Row actions
218
- // ---------------------------------------------------------------------------
219
- function RowActions({ record, canUpdate, canDelete, onEdit, onDelete, }) {
220
- return (_jsxs("div", { className: "stg:flex stg:items-center stg:gap-1", children: [canUpdate && (_jsx("button", { type: "button", onClick: () => onEdit(record), "aria-label": `Edit record ${record.id}`, className: rowActionClass, children: "Edit" })), canDelete && (_jsx("button", { type: "button", onClick: () => onDelete(record), "aria-label": `Delete record ${record.id}`, className: cn(rowActionClass, "stg:text-destructive stg:hover:text-destructive"), children: "Delete" }))] }));
221
- }
222
- const rowActionClass = cn("stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground", "stg:hover:bg-accent stg:hover:text-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring");
223
- //# sourceMappingURL=CollectionRecordsBrowser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollectionRecordsBrowser.js","sourceRoot":"","sources":["../../src/datastore/CollectionRecordsBrowser.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAA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qC,EACrC,OAAO,IAAI,iCAAiC,EAC5C,IAAI,IAAI,eAAe,CACxB,YAEA,SAAS,GACL,CACR,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,SAAS,UAAU,CAAC,EAClB,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,GAOT;IACC,OAAO,CACL,eAAK,SAAS,EAAC,qCAAqC,aACjD,SAAS,IAAI,CACZ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,gBACjB,eAAe,MAAM,CAAC,EAAE,EAAE,EACtC,SAAS,EAAE,cAAc,qBAGlB,CACV,EACA,SAAS,IAAI,CACZ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,gBACnB,iBAAiB,MAAM,CAAC,EAAE,EAAE,EACxC,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,iDAAiD,CAAC,uBAGzE,CACV,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,EAAE,CACvB,4FAA4F,EAC5F,+CAA+C,EAC/C,qFAAqF,CACtF,CAAC"}
@@ -1,29 +0,0 @@
1
- import { type DatastoreSpec, type DatastoreSubject } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
2
- /** Props for {@link CollectionSchemaView}. */
3
- export interface CollectionSchemaViewProps {
4
- /** The datastore spec — the authoritative source for structure (DD-008 SD-5). */
5
- readonly spec: DatastoreSpec;
6
- /** Additional CSS classes for the root container. */
7
- readonly className?: string;
8
- }
9
- /**
10
- * Structural view of a datastore's declared schema, rendered from the
11
- * loaded resource spec: per-collection typed field tables, the declared
12
- * constraints with their authored messages (the operator's own copy —
13
- * the same bytes agents relay), and the authorization block summary
14
- * (roles, bindings, `default_role` — operator-facing state the
15
- * describe projection deliberately excludes).
16
- *
17
- * Read-only by design: schema changes go through YAML apply, the one
18
- * write path for structure.
19
- *
20
- * All visual properties flow through `--stgm-*` design tokens.
21
- * Zero Console dependencies — safe for platform builder embedding.
22
- */
23
- export declare function CollectionSchemaView({ spec, className }: CollectionSchemaViewProps): import("react/jsx-runtime").JSX.Element;
24
- /**
25
- * Plain kind+value rendering of a datastore subject (DD-008 SD-3: the
26
- * grant system is the privacy boundary; display is honest).
27
- */
28
- export declare function formatSubject(subject: DatastoreSubject | undefined): string;
29
- //# sourceMappingURL=CollectionSchemaView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollectionSchemaView.d.ts","sourceRoot":"","sources":["../../src/datastore/CollectionSchemaView.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,yDAAyD,CAAC;AAIjE,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,yBAAyB,2CASlF;AA0ED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAa3E"}
@@ -1,93 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { cn } from "@stigmer/theme";
4
- import { toJson } from "@bufbuild/protobuf";
5
- import { ValueSchema } from "@bufbuild/protobuf/wkt";
6
- import { FieldType, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
7
- import { Section } from "../resource-detail/Section.js";
8
- import { formatFieldValue } from "./recordValues.js";
9
- /**
10
- * Structural view of a datastore's declared schema, rendered from the
11
- * loaded resource spec: per-collection typed field tables, the declared
12
- * constraints with their authored messages (the operator's own copy —
13
- * the same bytes agents relay), and the authorization block summary
14
- * (roles, bindings, `default_role` — operator-facing state the
15
- * describe projection deliberately excludes).
16
- *
17
- * Read-only by design: schema changes go through YAML apply, the one
18
- * write path for structure.
19
- *
20
- * All visual properties flow through `--stgm-*` design tokens.
21
- * Zero Console dependencies — safe for platform builder embedding.
22
- */
23
- export function CollectionSchemaView({ spec, className }) {
24
- return (_jsxs("div", { className: cn("stg:flex stg:flex-col stg:gap-6", className), children: [_jsx(AuthorizationSummary, { authorization: spec.authorization, timezone: spec.timezone }), spec.collections.map((coll) => (_jsx(CollectionSchema, { collection: coll }, coll.name)))] }));
25
- }
26
- // ---------------------------------------------------------------------------
27
- // Authorization block summary
28
- // ---------------------------------------------------------------------------
29
- function AuthorizationSummary({ authorization, timezone, }) {
30
- const roles = authorization?.roles ?? [];
31
- const bindings = authorization?.bindings ?? [];
32
- const defaultRole = authorization?.defaultRole ?? "";
33
- return (_jsx(Section, { title: "Authorization", children: _jsxs("div", { className: "stg:flex stg:flex-col stg:gap-3 stg:p-3 stg:text-sm", children: [_jsxs("div", { className: "stg:flex stg:flex-wrap stg:items-center stg:gap-2", children: [_jsx("span", { className: "stg:text-xs stg:font-medium stg:text-muted-foreground", children: "Roles" }), roles.length === 0 ? (_jsx("span", { className: "stg:text-xs stg:text-muted-foreground", children: "none declared" })) : (roles.map((r) => (_jsx("span", { className: "stg:rounded-full stg:bg-muted stg:px-2 stg:py-0.5 stg:text-xs stg:font-medium stg:text-foreground", children: r.name }, r.name))))] }), _jsxs("div", { className: "stg:flex stg:flex-wrap stg:items-center stg:gap-2", children: [_jsx("span", { className: "stg:text-xs stg:font-medium stg:text-muted-foreground", children: "Default role" }), defaultRole ? (_jsx("span", { className: "stg:rounded-full stg:bg-muted stg:px-2 stg:py-0.5 stg:text-xs stg:font-medium stg:text-foreground", children: defaultRole })) : (_jsx("span", { className: "stg:text-xs stg:text-muted-foreground", children: "none \u2014 unbound callers are denied" }))] }), bindings.length > 0 && (_jsxs("div", { className: "stg:flex stg:flex-col stg:gap-1", children: [_jsxs("span", { className: "stg:text-xs stg:font-medium stg:text-muted-foreground", children: ["Bindings (", bindings.length, ")"] }), _jsx("ul", { className: "stg:flex stg:flex-col stg:gap-0.5", children: bindings.map((b, i) => (_jsxs("li", { className: "stg:text-xs stg:text-foreground", children: [_jsx("code", { className: "stg:font-mono", children: formatSubject(b.subject) }), _jsx("span", { className: "stg:text-muted-foreground", children: " \u2192 " }), b.role] }, i))) })] })), timezone && (_jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsx("span", { className: "stg:text-xs stg:font-medium stg:text-muted-foreground", children: "Timezone" }), _jsx("span", { className: "stg:text-xs stg:text-foreground", children: timezone })] }))] }) }));
34
- }
35
- /**
36
- * Plain kind+value rendering of a datastore subject (DD-008 SD-3: the
37
- * grant system is the privacy boundary; display is honest).
38
- */
39
- export function formatSubject(subject) {
40
- switch (subject?.kind.case) {
41
- case "channelSender": {
42
- const s = subject.kind.value;
43
- return `${s.senderKind}:${s.value}`;
44
- }
45
- case "principal": {
46
- const p = subject.kind.value;
47
- return `${p.kind}/${p.id}`;
48
- }
49
- default:
50
- return "unknown";
51
- }
52
- }
53
- // ---------------------------------------------------------------------------
54
- // Per-collection schema
55
- // ---------------------------------------------------------------------------
56
- const CONSTRAINT_KIND_LABELS = {
57
- uniques: "unique",
58
- checks: "check",
59
- exists: "exists",
60
- notExists: "not exists",
61
- };
62
- function CollectionSchema({ collection }) {
63
- const constraints = [
64
- ...collection.uniques.map((c) => ({
65
- kind: CONSTRAINT_KIND_LABELS.uniques,
66
- name: c.name,
67
- fields: c.fields.join(", "),
68
- message: c.message,
69
- })),
70
- ...collection.checks.map((c) => ({
71
- kind: CONSTRAINT_KIND_LABELS.checks,
72
- name: c.name,
73
- fields: "",
74
- message: c.message,
75
- })),
76
- ...collection.exists.map((c) => ({
77
- kind: CONSTRAINT_KIND_LABELS.exists,
78
- name: c.name,
79
- fields: c.collection,
80
- message: c.message,
81
- })),
82
- ...collection.notExists.map((c) => ({
83
- kind: CONSTRAINT_KIND_LABELS.notExists,
84
- name: c.name,
85
- fields: c.collection,
86
- message: c.message,
87
- })),
88
- ];
89
- return (_jsx(Section, { title: collection.name, count: collection.fields.length, children: _jsxs("div", { className: "stg:flex stg:flex-col", children: [collection.description && (_jsx("p", { className: "stg:border-b stg:border-border stg:px-3 stg:py-2 stg:text-xs stg:text-muted-foreground", children: collection.description })), _jsxs("table", { className: "stg:w-full stg:text-left stg:text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "stg:border-b stg:border-border stg:text-muted-foreground", children: [_jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "Field" }), _jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "Type" }), _jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "Required" }), _jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "Default" }), _jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "Description" })] }) }), _jsx("tbody", { children: collection.fields.map((f) => (_jsxs("tr", { className: "stg:border-b stg:border-border stg:last:border-b-0", children: [_jsx("td", { className: "stg:px-3 stg:py-2 stg:font-mono stg:text-foreground", children: f.name }), _jsxs("td", { className: "stg:px-3 stg:py-2 stg:text-foreground", children: [FieldType[f.type], f.enumValues.length > 0 && (_jsxs("span", { className: "stg:text-muted-foreground", children: [" ", "(", f.enumValues.join(" | "), ")"] }))] }), _jsx("td", { className: "stg:px-3 stg:py-2 stg:text-muted-foreground", children: f.required ? "yes" : "" }), _jsx("td", { className: "stg:px-3 stg:py-2 stg:font-mono stg:text-muted-foreground", children: f.default !== undefined
90
- ? formatFieldValue(f.type, toJson(ValueSchema, f.default))
91
- : "" }), _jsx("td", { className: "stg:px-3 stg:py-2 stg:text-muted-foreground", children: f.description })] }, f.name))) })] }), constraints.length > 0 && (_jsxs("div", { className: "stg:border-t stg:border-border", children: [_jsx("h4", { className: "stg:px-3 stg:pt-2 stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground", children: "Constraints" }), _jsx("ul", { className: "stg:flex stg:flex-col stg:gap-1 stg:p-3", children: constraints.map((c) => (_jsxs("li", { className: "stg:flex stg:flex-wrap stg:items-baseline stg:gap-2 stg:text-xs", children: [_jsx("span", { className: "stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-medium stg:text-muted-foreground", children: c.kind }), _jsx("code", { className: "stg:font-mono stg:text-foreground", children: c.name }), c.fields && _jsxs("span", { className: "stg:text-muted-foreground", children: ["(", c.fields, ")"] }), c.message && (_jsxs("span", { className: "stg:text-muted-foreground", children: ["\u2014 \u201C", c.message, "\u201D"] }))] }, `${c.kind}:${c.name}`))) })] }))] }) }));
92
- }
93
- //# sourceMappingURL=CollectionSchemaView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CollectionSchemaView.js","sourceRoot":"","sources":["../../src/datastore/CollectionSchemaView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,SAAS,GAKV,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAUrD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAA6B;IACjF,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,SAAS,CAAC,aAC9D,KAAC,oBAAoB,IAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ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AI,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;4CAC1D,CAAC,CAAC,EAAE,GACH,EACL,aAAI,SAAS,EAAC,6CAA6C,YAAE,CAAC,CAAC,WAAW,GAAM,KAjBzE,CAAC,CAAC,IAAI,CAkBV,CACN,CAAC,GACI,IACF,EAEP,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CACzB,eAAK,SAAS,EAAC,gCAAgC,aAC7C,aAAI,SAAS,EAAC,0GAA0G,4BAEnH,EACL,aAAI,SAAS,EAAC,yCAAyC,YACpD,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACtB,cAAgC,SAAS,EAAC,iEAAiE,aACzG,eAAM,SAAS,EAAC,0FAA0F,YACvG,CAAC,CAAC,IAAI,GACF,EACP,eAAM,SAAS,EAAC,mCAAmC,YAAE,CAAC,CAAC,IAAI,GAAQ,EAClE,CAAC,CAAC,MAAM,IAAI,gBAAM,SAAS,EAAC,2BAA2B,kBAAG,CAAC,CAAC,MAAM,SAAS,EAC3E,CAAC,CAAC,OAAO,IAAI,CACZ,gBAAM,SAAS,EAAC,2BAA2B,8BAAK,CAAC,CAAC,OAAO,cAAS,CACnE,KARM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CASzB,CACN,CAAC,GACC,IACD,CACP,IACG,GACE,CACX,CAAC;AACJ,CAAC"}
@@ -1,44 +0,0 @@
1
- import type { Datastore } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/api_pb";
2
- import type { DetailAction } from "../resource-detail/types.js";
3
- /** The detail view's tabs. */
4
- export type DatastoreDetailTab = "overview" | "records";
5
- /** Props for {@link DatastoreDetailView}. */
6
- export interface DatastoreDetailViewProps {
7
- /** Organization slug. */
8
- readonly org: string;
9
- /** Datastore slug. */
10
- readonly slug: string;
11
- /** Primary action rendered as a visible button. */
12
- readonly primaryAction?: DetailAction;
13
- /** Overflow actions (Edit YAML / Export / Delete — assembled at the page level). */
14
- readonly actions?: readonly DetailAction[];
15
- /** Called when the datastore loads or reloads (e.g. breadcrumb label sync). */
16
- readonly onResourceLoad?: (datastore: Datastore) => void;
17
- /** Initial tab for uncontrolled usage. @default "overview" */
18
- readonly defaultTab?: DatastoreDetailTab;
19
- /** Controlled active tab. Uncontrolled (internal state) when omitted. */
20
- readonly activeTab?: DatastoreDetailTab;
21
- /** Tab-change callback for controlled usage. */
22
- readonly onTabChange?: (tab: DatastoreDetailTab) => void;
23
- /** Additional CSS classes for the root container. */
24
- readonly className?: string;
25
- }
26
- /**
27
- * Self-contained detail view for a Datastore — the Library-resource
28
- * home (DD-008 SD-1): an **Overview** tab (schema, authorization
29
- * summary, and the sync-report health strip — all from the loaded
30
- * resource, the authoritative source for structure and health) and a
31
- * **Records** tab (the browser, whose caller-effective verbs come from
32
- * `describeDatastore`). No version-history affordance —
33
- * `is_versioned: false` (DD-003).
34
- *
35
- * Handles loading, error, and not-found states automatically.
36
- * Zero Console dependencies — safe for platform builder embedding.
37
- * All visual properties flow through `--stgm-*` design tokens.
38
- */
39
- export declare function DatastoreDetailView({ org, slug, primaryAction, actions, onResourceLoad, defaultTab, activeTab, onTabChange, className, }: DatastoreDetailViewProps): import("react/jsx-runtime").JSX.Element;
40
- /** Database-cylinder icon shared by the detail view's states. */
41
- export declare function DatastoreIcon({ className }: {
42
- readonly className?: string;
43
- }): import("react/jsx-runtime").JSX.Element;
44
- //# sourceMappingURL=DatastoreDetailView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatastoreDetailView.d.ts","sourceRoot":"","sources":["../../src/datastore/DatastoreDetailView.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAGxF,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,6BAA6B,CAAC;AAMpF,8BAA8B;AAC9B,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,yBAAyB;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACtC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACzD,8DAA8D;IAC9D,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IACzC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IACxC,gDAAgD;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzD,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,IAAI,EACJ,aAAa,EACb,OAAO,EACP,cAAc,EACd,UAAuB,EACvB,SAAS,EACT,WAAW,EACX,SAAS,GACV,EAAE,wBAAwB,2CA+D1B;AAyDD,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAiB3E"}
@@ -1,76 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useEffect, useState } from "react";
4
- import { cn } from "@stigmer/theme";
5
- import { timestampDate } from "@bufbuild/protobuf/wkt";
6
- import { ErrorMessage } from "../error/ErrorMessage.js";
7
- import { ResourceDetailShell } from "../resource-detail/ResourceDetailShell.js";
8
- import { CollectionRecordsBrowser } from "./CollectionRecordsBrowser.js";
9
- import { CollectionSchemaView } from "./CollectionSchemaView.js";
10
- import { DatastoreSyncReport } from "./DatastoreSyncReport.js";
11
- import { useDatastore } from "./useDatastore.js";
12
- /**
13
- * Self-contained detail view for a Datastore — the Library-resource
14
- * home (DD-008 SD-1): an **Overview** tab (schema, authorization
15
- * summary, and the sync-report health strip — all from the loaded
16
- * resource, the authoritative source for structure and health) and a
17
- * **Records** tab (the browser, whose caller-effective verbs come from
18
- * `describeDatastore`). No version-history affordance —
19
- * `is_versioned: false` (DD-003).
20
- *
21
- * Handles loading, error, and not-found states automatically.
22
- * Zero Console dependencies — safe for platform builder embedding.
23
- * All visual properties flow through `--stgm-*` design tokens.
24
- */
25
- export function DatastoreDetailView({ org, slug, primaryAction, actions, onResourceLoad, defaultTab = "overview", activeTab, onTabChange, className, }) {
26
- const { datastore, isLoading, error, refetch } = useDatastore(org, slug);
27
- const [internalTab, setInternalTab] = useState(defaultTab);
28
- const tab = activeTab ?? internalTab;
29
- const setTab = onTabChange ?? setInternalTab;
30
- useEffect(() => {
31
- if (datastore)
32
- onResourceLoad?.(datastore);
33
- }, [datastore, onResourceLoad]);
34
- if (isLoading)
35
- return _jsx(LoadingSkeleton, { className: className });
36
- if (error)
37
- return _jsx(ErrorMessage, { error: error, retry: refetch, className: className });
38
- if (!datastore)
39
- return _jsx(NotFoundState, { className: className });
40
- const meta = datastore.metadata;
41
- const spec = datastore.spec;
42
- const status = datastore.status;
43
- const specAudit = status?.audit?.specAudit;
44
- const headerMeta = {
45
- name: meta?.name || meta?.slug || "Untitled",
46
- id: meta?.id || "",
47
- org: meta?.org,
48
- slug: meta?.slug,
49
- description: spec?.description,
50
- icon: _jsx(DatastoreIcon, { className: "stg:size-6 stg:text-muted-foreground" }),
51
- createdAt: specAudit?.createdAt ? timestampDate(specAudit.createdAt) : null,
52
- updatedAt: specAudit?.updatedAt ? timestampDate(specAudit.updatedAt) : null,
53
- };
54
- return (_jsx(ResourceDetailShell, { header: headerMeta, primaryAction: primaryAction, actions: actions, tabs: [
55
- { id: "overview", label: "Overview" },
56
- { id: "records", label: "Records" },
57
- ], activeTab: tab, onTabChange: (id) => setTab(id), tabsAriaLabel: "Datastore sections", className: className, children: tab === "overview" ? (_jsxs("div", { className: "stg:flex stg:flex-col stg:gap-6", children: [status && _jsx(DatastoreSyncReport, { status: status }), spec && _jsx(CollectionSchemaView, { spec: spec })] })) : (spec &&
58
- meta && (_jsx(CollectionRecordsBrowser, { org: meta.org, datastoreSlug: meta.slug, spec: spec }))) }));
59
- }
60
- // ---------------------------------------------------------------------------
61
- // Non-happy states
62
- // ---------------------------------------------------------------------------
63
- function LoadingSkeleton({ className }) {
64
- return (_jsxs("div", { className: cn("stg:flex stg:flex-col stg:gap-6", className), "aria-busy": "true", "aria-label": "Loading datastore details", children: [_jsxs("div", { className: "stg:flex stg:items-start stg:gap-3", children: [_jsx("div", { className: "stg:mt-1 stg:size-6 stg:shrink-0 stg:animate-pulse stg:rounded stg:bg-muted" }), _jsxs("div", { className: "stg:flex-1 stg:space-y-2", children: [_jsx("div", { className: "stg:h-5 stg:w-48 stg:animate-pulse stg:rounded stg:bg-muted" }), _jsx("div", { className: "stg:h-3 stg:w-64 stg:animate-pulse stg:rounded stg:bg-muted" })] })] }), _jsxs("div", { className: "stg:space-y-2", children: [_jsx("div", { className: "stg:h-3 stg:w-28 stg:animate-pulse stg:rounded stg:bg-muted" }), _jsx("div", { className: "stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted-faint", style: { height: "160px" } })] }), _jsxs("div", { className: "stg:space-y-2", children: [_jsx("div", { className: "stg:h-3 stg:w-20 stg:animate-pulse stg:rounded stg:bg-muted" }), _jsx("div", { className: "stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted-faint", style: { height: "240px" } })] })] }));
65
- }
66
- function NotFoundState({ className }) {
67
- return (_jsxs("div", { role: "status", className: cn("stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-12 stg:text-center", className), children: [_jsx(DatastoreIcon, { className: "stg:size-10 stg:text-muted-foreground-faint" }), _jsx("p", { className: "stg:text-sm stg:font-medium stg:text-muted-foreground", children: "Datastore not found" }), _jsx("p", { className: "stg:text-xs stg:text-muted-foreground-subtle", children: "This datastore doesn't exist or you don't have access to it." })] }));
68
- }
69
- // ---------------------------------------------------------------------------
70
- // Icon (inline SVG — no icon-library dependency)
71
- // ---------------------------------------------------------------------------
72
- /** Database-cylinder icon shared by the detail view's states. */
73
- export function DatastoreIcon({ className }) {
74
- return (_jsxs("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("ellipse", { cx: "12", cy: "5", rx: "8", ry: "3" }), _jsx("path", { d: "M4 5v6c0 1.66 3.58 3 8 3s8-1.34 8-3V5" }), _jsx("path", { d: "M4 11v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6" })] }));
75
- }
76
- //# sourceMappingURL=DatastoreDetailView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatastoreDetailView.js","sourceRoot":"","sources":["../../src/datastore/DatastoreDetailView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC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C1E,OAAO,CACL,eACE,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,kBAAS,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,GAAG,EACxC,eAAM,CAAC,EAAC,uCAAuC,GAAG,EAClD,eAAM,CAAC,EAAC,yCAAyC,GAAG,IAChD,CACP,CAAC;AACJ,CAAC"}
@@ -1,19 +0,0 @@
1
- import { type DatastoreStatus } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/status_pb";
2
- /** Props for {@link DatastoreSyncReport}. */
3
- export interface DatastoreSyncReportProps {
4
- /** The datastore status — the authoritative source for health (DD-008 SD-5). */
5
- readonly status: DatastoreStatus;
6
- /** Additional CSS classes for the root container. */
7
- readonly className?: string;
8
- }
9
- /**
10
- * The Overview health strip: projects `DatastoreStatus` — last apply
11
- * outcome, per-collection materialization state, and record counts —
12
- * so the operator can confirm an apply landed without leaving the
13
- * console (the cutover choreography's verification surface, DD-009).
14
- *
15
- * All visual properties flow through `--stgm-*` design tokens.
16
- * Zero Console dependencies — safe for platform builder embedding.
17
- */
18
- export declare function DatastoreSyncReport({ status, className }: DatastoreSyncReportProps): import("react/jsx-runtime").JSX.Element;
19
- //# sourceMappingURL=DatastoreSyncReport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatastoreSyncReport.d.ts","sourceRoot":"","sources":["../../src/datastore/DatastoreSyncReport.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,2DAA2D,CAAC;AAInE,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,wBAAwB,2CA6ClF"}
@@ -1,45 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { timestampDate } from "@bufbuild/protobuf/wkt";
4
- import { CollectionMaterializationState, DatastoreSyncOutcome, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/status_pb";
5
- import { Section } from "../resource-detail/Section.js";
6
- import { StatusBadge } from "../resource-workbench/components/StatusBadge.js";
7
- /**
8
- * The Overview health strip: projects `DatastoreStatus` — last apply
9
- * outcome, per-collection materialization state, and record counts —
10
- * so the operator can confirm an apply landed without leaving the
11
- * console (the cutover choreography's verification surface, DD-009).
12
- *
13
- * All visual properties flow through `--stgm-*` design tokens.
14
- * Zero Console dependencies — safe for platform builder embedding.
15
- */
16
- export function DatastoreSyncReport({ status, className }) {
17
- const syncedAt = status.lastSyncedAt
18
- ? timestampDate(status.lastSyncedAt).toLocaleString()
19
- : null;
20
- return (_jsx(Section, { title: "Sync report", className: className, children: _jsxs("div", { className: "stg:flex stg:flex-col", children: [_jsxs("div", { className: "stg:flex stg:flex-wrap stg:items-center stg:gap-2 stg:border-b stg:border-border stg:px-3 stg:py-2", children: [_jsx(SyncOutcomeBadge, { outcome: status.lastSyncOutcome }), syncedAt && (_jsxs("span", { className: "stg:text-xs stg:text-muted-foreground", children: ["last synced ", syncedAt] }))] }), status.collections.length === 0 ? (_jsx("p", { className: "stg:px-3 stg:py-2 stg:text-xs stg:text-muted-foreground", children: "No collections have been synced yet." })) : (_jsxs("table", { className: "stg:w-full stg:text-left stg:text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "stg:border-b stg:border-border stg:text-muted-foreground", children: [_jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "Collection" }), _jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:font-medium", children: "State" }), _jsx("th", { scope: "col", className: "stg:px-3 stg:py-2 stg:text-right stg:font-medium", children: "Records" })] }) }), _jsx("tbody", { children: status.collections.map((coll) => (_jsxs("tr", { className: "stg:border-b stg:border-border stg:last:border-b-0", children: [_jsx("td", { className: "stg:px-3 stg:py-2 stg:font-mono stg:text-foreground", children: coll.name }), _jsx("td", { className: "stg:px-3 stg:py-2", children: _jsx(MaterializationBadge, { state: coll.state }) }), _jsx("td", { className: "stg:px-3 stg:py-2 stg:text-right stg:tabular-nums stg:text-foreground", children: String(coll.recordCount) })] }, coll.name))) })] }))] }) }));
21
- }
22
- function SyncOutcomeBadge({ outcome }) {
23
- switch (outcome) {
24
- case DatastoreSyncOutcome.synced:
25
- return _jsx(StatusBadge, { phase: "ready", label: "synced" });
26
- case DatastoreSyncOutcome.rejected:
27
- return _jsx(StatusBadge, { phase: "failed", label: "rejected" });
28
- default:
29
- return _jsx(StatusBadge, { phase: "draft", label: "never synced" });
30
- }
31
- }
32
- function MaterializationBadge({ state }) {
33
- switch (state) {
34
- case CollectionMaterializationState.active:
35
- return _jsx(StatusBadge, { phase: "ready", label: "active" });
36
- case CollectionMaterializationState.pending:
37
- return _jsx(StatusBadge, { phase: "pending", label: "pending" });
38
- case CollectionMaterializationState.removed:
39
- // Removed from the spec; data retained until datastore delete.
40
- return (_jsx(StatusBadge, { phase: "disabled", label: "removed", tooltip: "Removed from the spec \u2014 records retained until the datastore is deleted" }));
41
- default:
42
- return _jsx(StatusBadge, { phase: "draft", label: "unknown" });
43
- }
44
- }
45
- //# sourceMappingURL=DatastoreSyncReport.js.map