@stigmer/react 3.2.2 → 3.3.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 (513) hide show
  1. package/agent/AgentDetailView.d.ts.map +1 -1
  2. package/agent/AgentDetailView.js +6 -3
  3. package/agent/AgentDetailView.js.map +1 -1
  4. package/agent/steps/ReviewStep.d.ts.map +1 -1
  5. package/agent/steps/ReviewStep.js +2 -3
  6. package/agent/steps/ReviewStep.js.map +1 -1
  7. package/billing/BaselineEditor.d.ts +9 -0
  8. package/billing/BaselineEditor.d.ts.map +1 -0
  9. package/billing/BaselineEditor.js +253 -0
  10. package/billing/BaselineEditor.js.map +1 -0
  11. package/billing/ModelCatalogPanel.d.ts +28 -0
  12. package/billing/ModelCatalogPanel.d.ts.map +1 -0
  13. package/billing/ModelCatalogPanel.js +102 -0
  14. package/billing/ModelCatalogPanel.js.map +1 -0
  15. package/billing/ModelGovernanceDetail.d.ts +8 -0
  16. package/billing/ModelGovernanceDetail.d.ts.map +1 -0
  17. package/billing/ModelGovernanceDetail.js +64 -0
  18. package/billing/ModelGovernanceDetail.js.map +1 -0
  19. package/billing/OperatorAccessNotice.d.ts +12 -0
  20. package/billing/OperatorAccessNotice.d.ts.map +1 -0
  21. package/billing/OperatorAccessNotice.js +15 -0
  22. package/billing/OperatorAccessNotice.js.map +1 -0
  23. package/billing/PricingGovernanceConsole.d.ts +57 -0
  24. package/billing/PricingGovernanceConsole.d.ts.map +1 -0
  25. package/billing/PricingGovernanceConsole.js +164 -0
  26. package/billing/PricingGovernanceConsole.js.map +1 -0
  27. package/billing/PricingGovernancePanel.d.ts +26 -0
  28. package/billing/PricingGovernancePanel.d.ts.map +1 -0
  29. package/billing/PricingGovernancePanel.js +64 -0
  30. package/billing/PricingGovernancePanel.js.map +1 -0
  31. package/billing/RetireConfirm.d.ts +9 -0
  32. package/billing/RetireConfirm.d.ts.map +1 -0
  33. package/billing/RetireConfirm.js +19 -0
  34. package/billing/RetireConfirm.js.map +1 -0
  35. package/billing/form-primitives.d.ts +18 -0
  36. package/billing/form-primitives.d.ts.map +1 -0
  37. package/billing/form-primitives.js +19 -0
  38. package/billing/form-primitives.js.map +1 -0
  39. package/billing/governance-primitives.d.ts +33 -0
  40. package/billing/governance-primitives.d.ts.map +1 -0
  41. package/billing/governance-primitives.js +43 -0
  42. package/billing/governance-primitives.js.map +1 -0
  43. package/billing/index.d.ts +18 -0
  44. package/billing/index.d.ts.map +1 -1
  45. package/billing/index.js +9 -0
  46. package/billing/index.js.map +1 -1
  47. package/billing/pricing-format.d.ts +12 -0
  48. package/billing/pricing-format.d.ts.map +1 -0
  49. package/billing/pricing-format.js +50 -0
  50. package/billing/pricing-format.js.map +1 -0
  51. package/billing/useDecidePricingOverride.d.ts +46 -0
  52. package/billing/useDecidePricingOverride.d.ts.map +1 -0
  53. package/billing/useDecidePricingOverride.js +44 -0
  54. package/billing/useDecidePricingOverride.js.map +1 -0
  55. package/billing/useModelGovernanceView.d.ts +103 -0
  56. package/billing/useModelGovernanceView.d.ts.map +1 -0
  57. package/billing/useModelGovernanceView.js +144 -0
  58. package/billing/useModelGovernanceView.js.map +1 -0
  59. package/billing/useModelPricingBaselines.d.ts +40 -0
  60. package/billing/useModelPricingBaselines.d.ts.map +1 -0
  61. package/billing/useModelPricingBaselines.js +32 -0
  62. package/billing/useModelPricingBaselines.js.map +1 -0
  63. package/billing/usePricingGovernance.d.ts +39 -0
  64. package/billing/usePricingGovernance.d.ts.map +1 -0
  65. package/billing/usePricingGovernance.js +31 -0
  66. package/billing/usePricingGovernance.js.map +1 -0
  67. package/billing/useRetireModelPricingBaseline.d.ts +31 -0
  68. package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
  69. package/billing/useRetireModelPricingBaseline.js +36 -0
  70. package/billing/useRetireModelPricingBaseline.js.map +1 -0
  71. package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
  72. package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
  73. package/billing/useUpsertModelPricingBaseline.js +37 -0
  74. package/billing/useUpsertModelPricingBaseline.js.map +1 -0
  75. package/channel/AgentChannelsPanel.d.ts.map +1 -1
  76. package/channel/AgentChannelsPanel.js +11 -5
  77. package/channel/AgentChannelsPanel.js.map +1 -1
  78. package/composer/SessionComposer.d.ts +1 -1
  79. package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
  80. package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
  81. package/cursor-accounts/CursorAccountEditor.js +51 -0
  82. package/cursor-accounts/CursorAccountEditor.js.map +1 -0
  83. package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
  84. package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
  85. package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
  86. package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
  87. package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
  88. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
  89. package/cursor-accounts/CursorAccountsConsole.js +275 -0
  90. package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
  91. package/cursor-accounts/cursor-account-format.d.ts +10 -0
  92. package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
  93. package/cursor-accounts/cursor-account-format.js +26 -0
  94. package/cursor-accounts/cursor-account-format.js.map +1 -0
  95. package/cursor-accounts/index.d.ts +18 -0
  96. package/cursor-accounts/index.d.ts.map +1 -0
  97. package/cursor-accounts/index.js +13 -0
  98. package/cursor-accounts/index.js.map +1 -0
  99. package/cursor-accounts/useCursorAccountView.d.ts +30 -0
  100. package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
  101. package/cursor-accounts/useCursorAccountView.js +25 -0
  102. package/cursor-accounts/useCursorAccountView.js.map +1 -0
  103. package/cursor-accounts/useCursorAccounts.d.ts +33 -0
  104. package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
  105. package/cursor-accounts/useCursorAccounts.js +25 -0
  106. package/cursor-accounts/useCursorAccounts.js.map +1 -0
  107. package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
  108. package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
  109. package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
  110. package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
  111. package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
  112. package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
  113. package/cursor-accounts/useDeleteCursorAccount.js +32 -0
  114. package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
  115. package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
  116. package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
  117. package/cursor-accounts/useSyncCursorAccount.js +31 -0
  118. package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
  119. package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
  120. package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
  121. package/cursor-accounts/useUpsertCursorAccount.js +34 -0
  122. package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
  123. package/datastore/CollectionRecordsBrowser.d.ts +34 -0
  124. package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
  125. package/datastore/CollectionRecordsBrowser.js +209 -0
  126. package/datastore/CollectionRecordsBrowser.js.map +1 -0
  127. package/datastore/CollectionSchemaView.d.ts +29 -0
  128. package/datastore/CollectionSchemaView.d.ts.map +1 -0
  129. package/datastore/CollectionSchemaView.js +93 -0
  130. package/datastore/CollectionSchemaView.js.map +1 -0
  131. package/datastore/DatastoreDetailView.d.ts +44 -0
  132. package/datastore/DatastoreDetailView.d.ts.map +1 -0
  133. package/datastore/DatastoreDetailView.js +76 -0
  134. package/datastore/DatastoreDetailView.js.map +1 -0
  135. package/datastore/DatastoreSyncReport.d.ts +19 -0
  136. package/datastore/DatastoreSyncReport.d.ts.map +1 -0
  137. package/datastore/DatastoreSyncReport.js +45 -0
  138. package/datastore/DatastoreSyncReport.js.map +1 -0
  139. package/datastore/DeleteDatastoreDialog.d.ts +35 -0
  140. package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
  141. package/datastore/DeleteDatastoreDialog.js +90 -0
  142. package/datastore/DeleteDatastoreDialog.js.map +1 -0
  143. package/datastore/FieldValueControl.d.ts +55 -0
  144. package/datastore/FieldValueControl.d.ts.map +1 -0
  145. package/datastore/FieldValueControl.js +138 -0
  146. package/datastore/FieldValueControl.js.map +1 -0
  147. package/datastore/RecordFilterBuilder.d.ts +30 -0
  148. package/datastore/RecordFilterBuilder.d.ts.map +1 -0
  149. package/datastore/RecordFilterBuilder.js +122 -0
  150. package/datastore/RecordFilterBuilder.js.map +1 -0
  151. package/datastore/RecordFormPanel.d.ts +45 -0
  152. package/datastore/RecordFormPanel.d.ts.map +1 -0
  153. package/datastore/RecordFormPanel.js +215 -0
  154. package/datastore/RecordFormPanel.js.map +1 -0
  155. package/datastore/index.d.ts +43 -0
  156. package/datastore/index.d.ts.map +1 -0
  157. package/datastore/index.js +22 -0
  158. package/datastore/index.js.map +1 -0
  159. package/datastore/recordFilter.d.ts +54 -0
  160. package/datastore/recordFilter.d.ts.map +1 -0
  161. package/datastore/recordFilter.js +93 -0
  162. package/datastore/recordFilter.js.map +1 -0
  163. package/datastore/recordValues.d.ts +85 -0
  164. package/datastore/recordValues.d.ts.map +1 -0
  165. package/datastore/recordValues.js +282 -0
  166. package/datastore/recordValues.js.map +1 -0
  167. package/datastore/useDatastore.d.ts +39 -0
  168. package/datastore/useDatastore.d.ts.map +1 -0
  169. package/datastore/useDatastore.js +44 -0
  170. package/datastore/useDatastore.js.map +1 -0
  171. package/datastore/useDatastoreCount.d.ts +48 -0
  172. package/datastore/useDatastoreCount.d.ts.map +1 -0
  173. package/datastore/useDatastoreCount.js +27 -0
  174. package/datastore/useDatastoreCount.js.map +1 -0
  175. package/datastore/useDatastoreDescription.d.ts +54 -0
  176. package/datastore/useDatastoreDescription.d.ts.map +1 -0
  177. package/datastore/useDatastoreDescription.js +50 -0
  178. package/datastore/useDatastoreDescription.js.map +1 -0
  179. package/datastore/useDatastoreList.d.ts +57 -0
  180. package/datastore/useDatastoreList.d.ts.map +1 -0
  181. package/datastore/useDatastoreList.js +29 -0
  182. package/datastore/useDatastoreList.js.map +1 -0
  183. package/datastore/useDatastoreSearch.d.ts +19 -0
  184. package/datastore/useDatastoreSearch.d.ts.map +1 -0
  185. package/datastore/useDatastoreSearch.js +22 -0
  186. package/datastore/useDatastoreSearch.js.map +1 -0
  187. package/datastore/useDeleteDatastore.d.ts +53 -0
  188. package/datastore/useDeleteDatastore.d.ts.map +1 -0
  189. package/datastore/useDeleteDatastore.js +40 -0
  190. package/datastore/useDeleteDatastore.js.map +1 -0
  191. package/datastore/useDeleteRecord.d.ts +34 -0
  192. package/datastore/useDeleteRecord.d.ts.map +1 -0
  193. package/datastore/useDeleteRecord.js +43 -0
  194. package/datastore/useDeleteRecord.js.map +1 -0
  195. package/datastore/useInsertRecord.d.ts +50 -0
  196. package/datastore/useInsertRecord.d.ts.map +1 -0
  197. package/datastore/useInsertRecord.js +55 -0
  198. package/datastore/useInsertRecord.js.map +1 -0
  199. package/datastore/useRecordCollection.d.ts +104 -0
  200. package/datastore/useRecordCollection.d.ts.map +1 -0
  201. package/datastore/useRecordCollection.js +136 -0
  202. package/datastore/useRecordCollection.js.map +1 -0
  203. package/datastore/useRecordList.d.ts +66 -0
  204. package/datastore/useRecordList.d.ts.map +1 -0
  205. package/datastore/useRecordList.js +58 -0
  206. package/datastore/useRecordList.js.map +1 -0
  207. package/datastore/useUpdateRecord.d.ts +52 -0
  208. package/datastore/useUpdateRecord.d.ts.map +1 -0
  209. package/datastore/useUpdateRecord.js +55 -0
  210. package/datastore/useUpdateRecord.js.map +1 -0
  211. package/environment/EnvironmentListPanel.d.ts.map +1 -1
  212. package/environment/EnvironmentListPanel.js +12 -7
  213. package/environment/EnvironmentListPanel.js.map +1 -1
  214. package/execution/index.d.ts +1 -2
  215. package/execution/index.d.ts.map +1 -1
  216. package/execution/index.js +0 -1
  217. package/execution/index.js.map +1 -1
  218. package/execution/useLiveAgentExecution.d.ts +17 -1
  219. package/execution/useLiveAgentExecution.d.ts.map +1 -1
  220. package/execution/useLiveAgentExecution.js +19 -4
  221. package/execution/useLiveAgentExecution.js.map +1 -1
  222. package/iam-policy/index.d.ts +1 -1
  223. package/iam-policy/index.d.ts.map +1 -1
  224. package/iam-policy/index.js.map +1 -1
  225. package/iam-policy/useCheckPermission.d.ts +32 -11
  226. package/iam-policy/useCheckPermission.d.ts.map +1 -1
  227. package/iam-policy/useCheckPermission.js +24 -19
  228. package/iam-policy/useCheckPermission.js.map +1 -1
  229. package/index.d.ts +16 -10
  230. package/index.d.ts.map +1 -1
  231. package/index.js +16 -5
  232. package/index.js.map +1 -1
  233. package/internal/useInViewport.d.ts +24 -0
  234. package/internal/useInViewport.d.ts.map +1 -0
  235. package/internal/useInViewport.js +49 -0
  236. package/internal/useInViewport.js.map +1 -0
  237. package/library/VisibilitySelector.d.ts +22 -6
  238. package/library/VisibilitySelector.d.ts.map +1 -1
  239. package/library/VisibilitySelector.js +12 -4
  240. package/library/VisibilitySelector.js.map +1 -1
  241. package/library/index.d.ts +1 -8
  242. package/library/index.d.ts.map +1 -1
  243. package/library/index.js +0 -4
  244. package/library/index.js.map +1 -1
  245. package/library/useApplyResource.d.ts +12 -12
  246. package/library/useApplyResource.d.ts.map +1 -1
  247. package/library/useApplyResource.js +16 -25
  248. package/library/useApplyResource.js.map +1 -1
  249. package/library/useExportResource.d.ts +13 -9
  250. package/library/useExportResource.d.ts.map +1 -1
  251. package/library/useExportResource.js +18 -36
  252. package/library/useExportResource.js.map +1 -1
  253. package/manifest/ApplyManifestDialog.d.ts +48 -0
  254. package/manifest/ApplyManifestDialog.d.ts.map +1 -0
  255. package/manifest/ApplyManifestDialog.js +135 -0
  256. package/manifest/ApplyManifestDialog.js.map +1 -0
  257. package/manifest/EditResourceYamlDialog.d.ts +51 -0
  258. package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
  259. package/manifest/EditResourceYamlDialog.js +104 -0
  260. package/manifest/EditResourceYamlDialog.js.map +1 -0
  261. package/manifest/RedactedSecretsNotice.d.ts +14 -0
  262. package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
  263. package/manifest/RedactedSecretsNotice.js +14 -0
  264. package/manifest/RedactedSecretsNotice.js.map +1 -0
  265. package/manifest/YamlEditor.d.ts +44 -0
  266. package/manifest/YamlEditor.d.ts.map +1 -0
  267. package/manifest/YamlEditor.js +216 -0
  268. package/manifest/YamlEditor.js.map +1 -0
  269. package/manifest/index.d.ts +13 -0
  270. package/manifest/index.d.ts.map +1 -0
  271. package/manifest/index.js +13 -0
  272. package/manifest/index.js.map +1 -0
  273. package/manifest/useApplyManifest.d.ts +82 -0
  274. package/manifest/useApplyManifest.d.ts.map +1 -0
  275. package/manifest/useApplyManifest.js +180 -0
  276. package/manifest/useApplyManifest.js.map +1 -0
  277. package/manifest/useEditResourceYaml.d.ts +106 -0
  278. package/manifest/useEditResourceYaml.d.ts.map +1 -0
  279. package/manifest/useEditResourceYaml.js +168 -0
  280. package/manifest/useEditResourceYaml.js.map +1 -0
  281. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  282. package/mcp-server/McpServerDetailView.js +4 -3
  283. package/mcp-server/McpServerDetailView.js.map +1 -1
  284. package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
  285. package/mcp-server/steps/ReviewStep.js +2 -3
  286. package/mcp-server/steps/ReviewStep.js.map +1 -1
  287. package/package.json +4 -4
  288. package/resource-creation/templates/workflow-templates.js +4 -4
  289. package/session/SessionViewer.js +8 -1
  290. package/session/SessionViewer.js.map +1 -1
  291. package/session/audience.d.ts +6 -1
  292. package/session/audience.d.ts.map +1 -1
  293. package/session/useEditSessionPrep.js +3 -3
  294. package/session/useEditSessionPrep.js.map +1 -1
  295. package/settings/index.d.ts +2 -1
  296. package/settings/index.d.ts.map +1 -1
  297. package/settings/index.js +2 -1
  298. package/settings/index.js.map +1 -1
  299. package/settings/settings-nav.d.ts +22 -0
  300. package/settings/settings-nav.d.ts.map +1 -1
  301. package/settings/settings-nav.js +32 -1
  302. package/settings/settings-nav.js.map +1 -1
  303. package/settings/useSettingsNavGroups.d.ts +29 -0
  304. package/settings/useSettingsNavGroups.d.ts.map +1 -0
  305. package/settings/useSettingsNavGroups.js +61 -0
  306. package/settings/useSettingsNavGroups.js.map +1 -0
  307. package/skill/SkillDetailView.d.ts.map +1 -1
  308. package/skill/SkillDetailView.js +4 -3
  309. package/skill/SkillDetailView.js.map +1 -1
  310. package/src/access/__tests__/useManageAccess.test.tsx +104 -0
  311. package/src/agent/AgentDetailView.tsx +9 -3
  312. package/src/agent/steps/ReviewStep.tsx +2 -3
  313. package/src/billing/BaselineEditor.tsx +619 -0
  314. package/src/billing/ModelCatalogPanel.tsx +283 -0
  315. package/src/billing/ModelGovernanceDetail.tsx +289 -0
  316. package/src/billing/OperatorAccessNotice.tsx +32 -0
  317. package/src/billing/PricingGovernanceConsole.tsx +465 -0
  318. package/src/billing/PricingGovernancePanel.tsx +166 -0
  319. package/src/billing/RetireConfirm.tsx +82 -0
  320. package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
  321. package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
  322. package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
  323. package/src/billing/form-primitives.tsx +68 -0
  324. package/src/billing/governance-primitives.tsx +133 -0
  325. package/src/billing/index.ts +37 -0
  326. package/src/billing/pricing-format.ts +53 -0
  327. package/src/billing/useDecidePricingOverride.ts +78 -0
  328. package/src/billing/useModelGovernanceView.ts +290 -0
  329. package/src/billing/useModelPricingBaselines.ts +69 -0
  330. package/src/billing/usePricingGovernance.ts +57 -0
  331. package/src/billing/useRetireModelPricingBaseline.ts +65 -0
  332. package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
  333. package/src/channel/AgentChannelsPanel.tsx +27 -1
  334. package/src/composer/SessionComposer.tsx +1 -1
  335. package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
  336. package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
  337. package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
  338. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
  339. package/src/cursor-accounts/cursor-account-format.ts +29 -0
  340. package/src/cursor-accounts/index.ts +29 -0
  341. package/src/cursor-accounts/useCursorAccountView.ts +49 -0
  342. package/src/cursor-accounts/useCursorAccounts.ts +49 -0
  343. package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
  344. package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
  345. package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
  346. package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
  347. package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
  348. package/src/datastore/CollectionSchemaView.tsx +247 -0
  349. package/src/datastore/DatastoreDetailView.tsx +201 -0
  350. package/src/datastore/DatastoreSyncReport.tsx +105 -0
  351. package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
  352. package/src/datastore/FieldValueControl.tsx +289 -0
  353. package/src/datastore/RecordFilterBuilder.tsx +411 -0
  354. package/src/datastore/RecordFormPanel.tsx +432 -0
  355. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
  356. package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
  357. package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
  358. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
  359. package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
  360. package/src/datastore/__tests__/recordFilter.test.ts +156 -0
  361. package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
  362. package/src/datastore/__tests__/recordValues.test.ts +359 -0
  363. package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
  364. package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
  365. package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
  366. package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
  367. package/src/datastore/index.ts +111 -0
  368. package/src/datastore/recordFilter.ts +140 -0
  369. package/src/datastore/recordValues.ts +327 -0
  370. package/src/datastore/useDatastore.ts +67 -0
  371. package/src/datastore/useDatastoreCount.ts +67 -0
  372. package/src/datastore/useDatastoreDescription.ts +90 -0
  373. package/src/datastore/useDatastoreList.ts +79 -0
  374. package/src/datastore/useDatastoreSearch.ts +39 -0
  375. package/src/datastore/useDeleteDatastore.ts +87 -0
  376. package/src/datastore/useDeleteRecord.ts +77 -0
  377. package/src/datastore/useInsertRecord.ts +92 -0
  378. package/src/datastore/useRecordCollection.ts +256 -0
  379. package/src/datastore/useRecordList.ts +131 -0
  380. package/src/datastore/useUpdateRecord.ts +95 -0
  381. package/src/environment/EnvironmentListPanel.tsx +24 -0
  382. package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
  383. package/src/execution/__tests__/useLiveAgentExecution.test.tsx +125 -0
  384. package/src/execution/index.ts +4 -7
  385. package/src/execution/useLiveAgentExecution.ts +41 -3
  386. package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
  387. package/src/iam-policy/index.ts +1 -0
  388. package/src/iam-policy/useCheckPermission.ts +45 -19
  389. package/src/index.ts +167 -18
  390. package/src/internal/__tests__/useInViewport.test.tsx +115 -0
  391. package/src/internal/useInViewport.ts +63 -0
  392. package/src/library/VisibilitySelector.tsx +50 -9
  393. package/src/library/__tests__/VisibilitySelector.test.tsx +38 -0
  394. package/src/library/index.ts +4 -21
  395. package/src/library/useApplyResource.ts +27 -34
  396. package/src/library/useExportResource.ts +21 -40
  397. package/src/manifest/ApplyManifestDialog.tsx +315 -0
  398. package/src/manifest/EditResourceYamlDialog.tsx +265 -0
  399. package/src/manifest/RedactedSecretsNotice.tsx +30 -0
  400. package/src/manifest/YamlEditor.tsx +272 -0
  401. package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
  402. package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
  403. package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
  404. package/src/manifest/index.ts +33 -0
  405. package/src/manifest/useApplyManifest.ts +270 -0
  406. package/src/manifest/useEditResourceYaml.ts +273 -0
  407. package/src/mcp-server/McpServerDetailView.tsx +7 -3
  408. package/src/mcp-server/steps/ReviewStep.tsx +2 -3
  409. package/src/resource-creation/templates/workflow-templates.ts +4 -4
  410. package/src/session/SessionViewer.tsx +7 -1
  411. package/src/session/__tests__/audienceWiring.test.tsx +31 -1
  412. package/src/session/audience.ts +6 -1
  413. package/src/session/useEditSessionPrep.ts +3 -3
  414. package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
  415. package/src/settings/index.ts +5 -1
  416. package/src/settings/settings-nav.ts +43 -0
  417. package/src/settings/useSettingsNavGroups.ts +81 -0
  418. package/src/skill/SkillDetailView.tsx +7 -3
  419. package/src/workflow/WorkflowAgentCallTranscript.tsx +279 -0
  420. package/src/workflow/WorkflowDetailView.tsx +7 -3
  421. package/src/workflow/WorkflowExecutionViewer.tsx +20 -77
  422. package/src/workflow/WorkflowTaskApprovalSummary.tsx +45 -8
  423. package/src/workflow/WorkflowYamlEditor.tsx +6 -270
  424. package/src/workflow/__tests__/WorkflowAgentCallTranscript.liveregion.test.tsx +124 -0
  425. package/src/workflow/__tests__/{WorkflowAgentExecutionDocument.test.tsx → WorkflowAgentCallTranscript.test.tsx} +146 -121
  426. package/src/workflow/__tests__/WorkflowExecutionViewer.approvals.test.tsx +81 -220
  427. package/src/workflow/__tests__/WorkflowExecutionViewer.reconciliation.test.tsx +17 -16
  428. package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +52 -2
  429. package/src/workflow/__tests__/WorkflowTaskThread.test.tsx +168 -185
  430. package/src/workflow/__tests__/agent-call-live-experience.test.ts +4 -4
  431. package/src/workflow/__tests__/task-approval.test.ts +119 -0
  432. package/src/workflow/__tests__/task-presentation.test.ts +35 -1
  433. package/src/workflow/__tests__/useWorkflowExecutionPanel.test.ts +0 -57
  434. package/src/workflow/index.ts +6 -3
  435. package/src/workflow/task-detail/index.ts +3 -0
  436. package/src/workflow/task-detail/task-approval.ts +95 -1
  437. package/src/workflow/thread/WorkflowTaskThread.tsx +96 -252
  438. package/src/workflow/thread/task-presentation.ts +8 -2
  439. package/src/workflow/useWorkflowExecutionPanel.ts +0 -47
  440. package/styles.css +1 -1
  441. package/workflow/CanvasTransitionEdge.d.ts +1 -1
  442. package/workflow/WorkflowAgentCallTranscript.d.ts +87 -0
  443. package/workflow/WorkflowAgentCallTranscript.d.ts.map +1 -0
  444. package/workflow/WorkflowAgentCallTranscript.js +98 -0
  445. package/workflow/WorkflowAgentCallTranscript.js.map +1 -0
  446. package/workflow/WorkflowDetailView.d.ts.map +1 -1
  447. package/workflow/WorkflowDetailView.js +4 -3
  448. package/workflow/WorkflowDetailView.js.map +1 -1
  449. package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
  450. package/workflow/WorkflowExecutionViewer.js +23 -52
  451. package/workflow/WorkflowExecutionViewer.js.map +1 -1
  452. package/workflow/WorkflowTaskApprovalSummary.d.ts +1 -1
  453. package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
  454. package/workflow/WorkflowTaskApprovalSummary.js +18 -1
  455. package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
  456. package/workflow/WorkflowYamlEditor.d.ts +2 -42
  457. package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
  458. package/workflow/WorkflowYamlEditor.js +5 -214
  459. package/workflow/WorkflowYamlEditor.js.map +1 -1
  460. package/workflow/index.d.ts +2 -2
  461. package/workflow/index.d.ts.map +1 -1
  462. package/workflow/index.js +2 -2
  463. package/workflow/index.js.map +1 -1
  464. package/workflow/task-detail/index.d.ts +1 -1
  465. package/workflow/task-detail/index.d.ts.map +1 -1
  466. package/workflow/task-detail/index.js +1 -1
  467. package/workflow/task-detail/index.js.map +1 -1
  468. package/workflow/task-detail/task-approval.d.ts +44 -1
  469. package/workflow/task-detail/task-approval.d.ts.map +1 -1
  470. package/workflow/task-detail/task-approval.js +47 -0
  471. package/workflow/task-detail/task-approval.js.map +1 -1
  472. package/workflow/thread/WorkflowTaskThread.d.ts +17 -25
  473. package/workflow/thread/WorkflowTaskThread.d.ts.map +1 -1
  474. package/workflow/thread/WorkflowTaskThread.js +60 -105
  475. package/workflow/thread/WorkflowTaskThread.js.map +1 -1
  476. package/workflow/thread/task-presentation.d.ts.map +1 -1
  477. package/workflow/thread/task-presentation.js +7 -2
  478. package/workflow/thread/task-presentation.js.map +1 -1
  479. package/workflow/useWorkflowExecutionPanel.d.ts +0 -12
  480. package/workflow/useWorkflowExecutionPanel.d.ts.map +1 -1
  481. package/workflow/useWorkflowExecutionPanel.js +0 -12
  482. package/workflow/useWorkflowExecutionPanel.js.map +1 -1
  483. package/execution/agent-execution-document.d.ts +0 -31
  484. package/execution/agent-execution-document.d.ts.map +0 -1
  485. package/execution/agent-execution-document.js +0 -48
  486. package/execution/agent-execution-document.js.map +0 -1
  487. package/library/ImportResourceDialog.d.ts +0 -43
  488. package/library/ImportResourceDialog.d.ts.map +0 -1
  489. package/library/ImportResourceDialog.js +0 -90
  490. package/library/ImportResourceDialog.js.map +0 -1
  491. package/library/parse-resource-yaml.d.ts +0 -63
  492. package/library/parse-resource-yaml.d.ts.map +0 -1
  493. package/library/parse-resource-yaml.js +0 -407
  494. package/library/parse-resource-yaml.js.map +0 -1
  495. package/library/serialize-resource-yaml.d.ts +0 -103
  496. package/library/serialize-resource-yaml.d.ts.map +0 -1
  497. package/library/serialize-resource-yaml.js +0 -565
  498. package/library/serialize-resource-yaml.js.map +0 -1
  499. package/library/useImportResource.d.ts +0 -84
  500. package/library/useImportResource.d.ts.map +0 -1
  501. package/library/useImportResource.js +0 -188
  502. package/library/useImportResource.js.map +0 -1
  503. package/src/execution/__tests__/agent-execution-document.test.ts +0 -45
  504. package/src/execution/agent-execution-document.ts +0 -54
  505. package/src/library/ImportResourceDialog.tsx +0 -227
  506. package/src/library/parse-resource-yaml.ts +0 -630
  507. package/src/library/serialize-resource-yaml.ts +0 -756
  508. package/src/library/useImportResource.ts +0 -253
  509. package/src/workflow/WorkflowAgentExecutionDocument.tsx +0 -283
  510. package/workflow/WorkflowAgentExecutionDocument.d.ts +0 -79
  511. package/workflow/WorkflowAgentExecutionDocument.d.ts.map +0 -1
  512. package/workflow/WorkflowAgentExecutionDocument.js +0 -87
  513. package/workflow/WorkflowAgentExecutionDocument.js.map +0 -1
@@ -0,0 +1,209 @@
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("px-3 py-6 text-center text-sm 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("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: ["Collection", _jsx("select", { className: cn(FIELD_INPUT_CLASSES, "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: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: ["Partition", _jsx("select", { className: cn(FIELD_INPUT_CLASSES, "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
+ const scope = { org, datastore: datastoreSlug, collection: collection.name, partition };
88
+ const filter = useMemo(() => buildRecordFilter(conditions), [conditions]);
89
+ const columns = useMemo(() => buildRecordColumns(collection), [collection]);
90
+ // Fetch only once read access is confirmed — the denied panel is the
91
+ // primary render for deny-by-default, not a failed query.
92
+ const records = useRecordCollection({
93
+ org: describeLoaded && canRead ? org : null,
94
+ datastore: datastoreSlug,
95
+ collection: collection.name,
96
+ partition,
97
+ filter,
98
+ page,
99
+ pageSize: PAGE_SIZE,
100
+ sort,
101
+ onSortChange,
102
+ columns,
103
+ });
104
+ // Row actions and write panel state.
105
+ const [formOpen, setFormOpen] = useState(false);
106
+ const [editing, setEditing] = useState(null);
107
+ const { confirmState, confirm, handleConfirm, handleCancel } = useConfirmAction();
108
+ const deleteRecord = useDeleteRecord();
109
+ const openInsert = useCallback(() => {
110
+ setEditing(null);
111
+ setFormOpen(true);
112
+ }, []);
113
+ const openEdit = useCallback((record) => {
114
+ setEditing(record);
115
+ setFormOpen(true);
116
+ }, []);
117
+ // Deps narrowed to the specific stable callbacks used (DD-010).
118
+ const deleteRecordFn = deleteRecord.deleteRecord;
119
+ const refetchRecords = records.refetch;
120
+ const collectionName = collection.name;
121
+ const handleDelete = useCallback(async (record) => {
122
+ const ok = await confirm({
123
+ title: "Delete record?",
124
+ description: `Record ${record.id} will be permanently deleted.`,
125
+ confirmLabel: "Delete",
126
+ variant: "destructive",
127
+ });
128
+ if (!ok)
129
+ return;
130
+ try {
131
+ await deleteRecordFn({
132
+ org,
133
+ datastore: datastoreSlug,
134
+ collection: collectionName,
135
+ partition,
136
+ id: record.id,
137
+ });
138
+ toast.success("Record deleted");
139
+ refetchRecords();
140
+ }
141
+ catch (err) {
142
+ toast.error(getUserMessage(err));
143
+ }
144
+ }, [confirm, deleteRecordFn, refetchRecords, org, datastoreSlug, collectionName, partition]);
145
+ // --- Denied states (DD-008 SD-3): first-class renders ---------------------
146
+ if (describeError && isPermissionDenied(describeError)) {
147
+ return _jsx(DeniedPanel, { message: getUserMessage(describeError) });
148
+ }
149
+ if (describeLoaded && !canRead) {
150
+ return (_jsx(DeniedPanel, { message: `You do not have record access to “${collection.name}”.` }));
151
+ }
152
+ if (records.error && isPermissionDenied(records.error)) {
153
+ return _jsx(DeniedPanel, { message: getUserMessage(records.error) });
154
+ }
155
+ const totalPages = Math.max(records.totalPages, 1);
156
+ return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(RecordFilterBuilder, { collection: collection, conditions: conditions, onChange: onConditionsChange, className: "min-w-0 flex-1" }), canInsert && (_jsx("button", { type: "button", onClick: openInsert, className: cn("shrink-0 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground", "hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Insert record" }))] }), records.error ? (_jsx("div", { role: "alert", className: "rounded-md border border-destructive bg-card px-3 py-2 text-sm text-destructive", children: getUserMessage(records.error) })) : records.isLoading ? (_jsx("div", { className: "rounded-lg border border-border px-3 py-6 text-center text-sm text-muted-foreground", children: "Loading records\u2026" })) : records.records.length === 0 ? (_jsx("div", { className: "rounded-lg border border-border px-3 py-6 text-center text-sm text-muted-foreground", children: conditions.length > 0
157
+ ? "No records match the current filters."
158
+ : `No records in “${collection.name}” yet.` })) : (records.table && (_jsx("div", { className: "overflow-x-auto rounded-lg border border-border", children: _jsx(ResourceTable, { table: records.table, "aria-label": `Records in ${collection.name}`, renderRowAction: canUpdate || canDelete
159
+ ? (record) => (_jsx(RowActions, { record: record, canUpdate: canUpdate, canDelete: canDelete, onEdit: openEdit, onDelete: handleDelete }))
160
+ : undefined }) }))), _jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [_jsxs("span", { children: [records.total, " record", records.total === 1 ? "" : "s"] }), _jsxs("div", { className: "flex items-center 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 })] }));
161
+ }
162
+ const paginationButtonClass = cn("rounded-md border border-input bg-background px-2 py-1 text-xs font-medium text-foreground", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50");
163
+ // ---------------------------------------------------------------------------
164
+ // Denied panel — an explanation, never an empty grid
165
+ // ---------------------------------------------------------------------------
166
+ function DeniedPanel({ message }) {
167
+ return (_jsxs("div", { role: "status", className: "flex flex-col items-center gap-2 rounded-lg border border-border bg-muted px-4 py-8 text-center", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: message }), _jsxs("p", { className: "max-w-md text-xs 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: "font-mono", children: "default_role" }), " in the datastore YAML, with the verbs you need granted on this collection."] })] }));
168
+ }
169
+ // ---------------------------------------------------------------------------
170
+ // Columns: typed cells from FieldDeclaration + system columns
171
+ // ---------------------------------------------------------------------------
172
+ /**
173
+ * Grid columns for a collection: declared fields with typed cells, then
174
+ * `created_at` (visible by default). The remaining system columns
175
+ * (`id`, `updated_at`, `created_by`) stay out of the default grid —
176
+ * they are shown in the record form's read-only summary; a column
177
+ * toggle is recorded growth.
178
+ */
179
+ function buildRecordColumns(collection) {
180
+ const fieldColumns = collection.fields.map((field) => ({
181
+ id: field.name,
182
+ header: field.name,
183
+ sortable: isSortableField(field),
184
+ 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 })),
185
+ }));
186
+ return [
187
+ ...fieldColumns,
188
+ {
189
+ id: "created_at",
190
+ header: "created_at",
191
+ sortable: true,
192
+ cell: (record) => (_jsx(TypedCell, { value: record.createdAt
193
+ ? formatSystemTimestamp(timestampDate(record.createdAt).toISOString())
194
+ : "", mono: true })),
195
+ },
196
+ ];
197
+ }
198
+ function TypedCell({ value, numeric, mono, }) {
199
+ const truncated = value.length > 80 ? `${value.slice(0, 79)}…` : value;
200
+ return (_jsx("span", { title: value.length > 80 ? value : undefined, className: cn("block max-w-xs truncate", numeric && "text-right tabular-nums", mono && "font-mono"), children: truncated }));
201
+ }
202
+ // ---------------------------------------------------------------------------
203
+ // Row actions
204
+ // ---------------------------------------------------------------------------
205
+ function RowActions({ record, canUpdate, canDelete, onEdit, onDelete, }) {
206
+ return (_jsxs("div", { className: "flex items-center 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, "text-destructive hover:text-destructive"), children: "Delete" }))] }));
207
+ }
208
+ const rowActionClass = cn("rounded-md px-1.5 py-0.5 text-xs font-medium text-muted-foreground", "hover:bg-accent hover:text-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring");
209
+ //# sourceMappingURL=CollectionRecordsBrowser.js.map
@@ -0,0 +1 @@
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,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,aAAa,EACb,SAAS,GAGV,MAAM,yDAAyD,CAAC;AAKjE,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAA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,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IACvE,OAAO,CACL,eACE,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAC5C,SAAS,EAAE,EAAE,CACX,yBAAyB,EACzB,OAAO,IAAI,yBAAyB,EACpC,IAAI,IAAI,WAAW,CACpB,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,yBAAyB,aACrC,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,yCAAyC,CAAC,uBAGjE,CACV,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,EAAE,CACvB,oEAAoE,EACpE,uCAAuC,EACvC,yEAAyE,CAC1E,CAAC"}
@@ -0,0 +1,29 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,93 @@
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("flex flex-col 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: "flex flex-col gap-3 p-3 text-sm", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Roles" }), roles.length === 0 ? (_jsx("span", { className: "text-xs text-muted-foreground", children: "none declared" })) : (roles.map((r) => (_jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-foreground", children: r.name }, r.name))))] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Default role" }), defaultRole ? (_jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-foreground", children: defaultRole })) : (_jsx("span", { className: "text-xs text-muted-foreground", children: "none \u2014 unbound callers are denied" }))] }), bindings.length > 0 && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: ["Bindings (", bindings.length, ")"] }), _jsx("ul", { className: "flex flex-col gap-0.5", children: bindings.map((b, i) => (_jsxs("li", { className: "text-xs text-foreground", children: [_jsx("code", { className: "font-mono", children: formatSubject(b.subject) }), _jsx("span", { className: "text-muted-foreground", children: " \u2192 " }), b.role] }, i))) })] })), timezone && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Timezone" }), _jsx("span", { className: "text-xs 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: "flex flex-col", children: [collection.description && (_jsx("p", { className: "border-b border-border px-3 py-2 text-xs text-muted-foreground", children: collection.description })), _jsxs("table", { className: "w-full text-left text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-border text-muted-foreground", children: [_jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Field" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Type" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Required" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Default" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Description" })] }) }), _jsx("tbody", { children: collection.fields.map((f) => (_jsxs("tr", { className: "border-b border-border last:border-b-0", children: [_jsx("td", { className: "px-3 py-2 font-mono text-foreground", children: f.name }), _jsxs("td", { className: "px-3 py-2 text-foreground", children: [FieldType[f.type], f.enumValues.length > 0 && (_jsxs("span", { className: "text-muted-foreground", children: [" ", "(", f.enumValues.join(" | "), ")"] }))] }), _jsx("td", { className: "px-3 py-2 text-muted-foreground", children: f.required ? "yes" : "" }), _jsx("td", { className: "px-3 py-2 font-mono text-muted-foreground", children: f.default !== undefined
90
+ ? formatFieldValue(f.type, toJson(ValueSchema, f.default))
91
+ : "" }), _jsx("td", { className: "px-3 py-2 text-muted-foreground", children: f.description })] }, f.name))) })] }), constraints.length > 0 && (_jsxs("div", { className: "border-t border-border", children: [_jsx("h4", { className: "px-3 pt-2 text-xs font-medium uppercase tracking-wider text-muted-foreground", children: "Constraints" }), _jsx("ul", { className: "flex flex-col gap-1 p-3", children: constraints.map((c) => (_jsxs("li", { className: "flex flex-wrap items-baseline gap-2 text-xs", children: [_jsx("span", { className: "rounded bg-muted px-1.5 py-0.5 font-medium text-muted-foreground", children: c.kind }), _jsx("code", { className: "font-mono text-foreground", children: c.name }), c.fields && _jsxs("span", { className: "text-muted-foreground", children: ["(", c.fields, ")"] }), c.message && (_jsxs("span", { className: "text-muted-foreground", children: ["\u2014 \u201C", c.message, "\u201D"] }))] }, `${c.kind}:${c.name}`))) })] }))] }) }));
92
+ }
93
+ //# sourceMappingURL=CollectionSchemaView.js.map
@@ -0,0 +1 @@
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,qBAAqB,EAAE,SAAS,CAAC,aAClD,KAAC,oBAAoB,IAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,EACnF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC9B,KAAC,gBAAgB,IAAiB,UAAU,EA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AC,WAAW,GAAM,KAjB7D,CAAC,CAAC,IAAI,CAkBV,CACN,CAAC,GACI,IACF,EAEP,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CACzB,eAAK,SAAS,EAAC,wBAAwB,aACrC,aAAI,SAAS,EAAC,8EAA8E,4BAEvF,EACL,aAAI,SAAS,EAAC,yBAAyB,YACpC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACtB,cAAgC,SAAS,EAAC,6CAA6C,aACrF,eAAM,SAAS,EAAC,kEAAkE,YAC/E,CAAC,CAAC,IAAI,GACF,EACP,eAAM,SAAS,EAAC,2BAA2B,YAAE,CAAC,CAAC,IAAI,GAAQ,EAC1D,CAAC,CAAC,MAAM,IAAI,gBAAM,SAAS,EAAC,uBAAuB,kBAAG,CAAC,CAAC,MAAM,SAAS,EACvE,CAAC,CAAC,OAAO,IAAI,CACZ,gBAAM,SAAS,EAAC,uBAAuB,8BAAK,CAAC,CAAC,OAAO,cAAS,CAC/D,KARM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CASzB,CACN,CAAC,GACC,IACD,CACP,IACG,GACE,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,44 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,76 @@
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: "size-6 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: "flex flex-col 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("flex flex-col gap-6", className), "aria-busy": "true", "aria-label": "Loading datastore details", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "mt-1 size-6 shrink-0 animate-pulse rounded bg-muted" }), _jsxs("div", { className: "flex-1 space-y-2", children: [_jsx("div", { className: "h-5 w-48 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-3 w-64 animate-pulse rounded bg-muted" })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { className: "h-3 w-28 animate-pulse rounded bg-muted" }), _jsx("div", { className: "animate-pulse rounded-lg border border-border bg-muted-faint", style: { height: "160px" } })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { className: "h-3 w-20 animate-pulse rounded bg-muted" }), _jsx("div", { className: "animate-pulse rounded-lg border border-border bg-muted-faint", style: { height: "240px" } })] })] }));
65
+ }
66
+ function NotFoundState({ className }) {
67
+ return (_jsxs("div", { role: "status", className: cn("flex flex-col items-center gap-2 py-12 text-center", className), children: [_jsx(DatastoreIcon, { className: "size-10 text-muted-foreground-faint" }), _jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Datastore not found" }), _jsx("p", { className: "text-xs 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
@@ -0,0 +1 @@
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;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA2BjD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EACH,IAAI,EACJ,aAAa,EACb,OAAO,EACP,cAAc,EACd,UAAU,GAAG,UAAU,EACvB,SAAS,EACT,WAAW,EACX,SAAS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AAE,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"}
@@ -0,0 +1,19 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,45 @@
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: "flex flex-col", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: [_jsx(SyncOutcomeBadge, { outcome: status.lastSyncOutcome }), syncedAt && (_jsxs("span", { className: "text-xs text-muted-foreground", children: ["last synced ", syncedAt] }))] }), status.collections.length === 0 ? (_jsx("p", { className: "px-3 py-2 text-xs text-muted-foreground", children: "No collections have been synced yet." })) : (_jsxs("table", { className: "w-full text-left text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-border text-muted-foreground", children: [_jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Collection" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "State" }), _jsx("th", { scope: "col", className: "px-3 py-2 text-right font-medium", children: "Records" })] }) }), _jsx("tbody", { children: status.collections.map((coll) => (_jsxs("tr", { className: "border-b border-border last:border-b-0", children: [_jsx("td", { className: "px-3 py-2 font-mono text-foreground", children: coll.name }), _jsx("td", { className: "px-3 py-2", children: _jsx(MaterializationBadge, { state: coll.state }) }), _jsx("td", { className: "px-3 py-2 text-right tabular-nums 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatastoreSyncReport.js","sourceRoot":"","sources":["../../src/datastore/DatastoreSyncReport.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,GAErB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAU9E;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,SAAS,EAA4B;IACjF,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY;QAClC,CAAC,CAAC,aAAa,CAAC,MAAM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