@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,270 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ import {
5
+ containsRedactedSecrets,
6
+ parseManifest,
7
+ type AppliedManifest,
8
+ type ManifestDocument,
9
+ } from "@stigmer/sdk";
10
+ import { useStigmer } from "../hooks.js";
11
+ import { toError } from "../internal/toError.js";
12
+
13
+ /** Per-document apply lifecycle within one manifest. */
14
+ export type ManifestEntryStatus =
15
+ | "pending"
16
+ | "applying"
17
+ | "applied"
18
+ | "failed"
19
+ /** A prior document failed; this one was not attempted. */
20
+ | "skipped";
21
+
22
+ /** One document of the manifest, with its preview and apply state. */
23
+ export interface ManifestPreviewEntry {
24
+ /** The parsed document (kind handler, message, name/slug/org). */
25
+ readonly document: ManifestDocument;
26
+ /** What applying will do, resolved against live server state. */
27
+ readonly action: "create" | "update" | "unknown";
28
+ /** Apply lifecycle status. */
29
+ readonly status: ManifestEntryStatus;
30
+ /** The applied resource, present when `status` is `"applied"`. */
31
+ readonly result?: AppliedManifest;
32
+ /** User-facing failure message, present when `status` is `"failed"`. */
33
+ readonly errorMessage?: string;
34
+ }
35
+
36
+ /** Return value of {@link useApplyManifest}. */
37
+ export interface UseApplyManifestReturn {
38
+ /** Current manifest text (paste target). */
39
+ readonly content: string;
40
+ /** Update the manifest text. Re-validates (debounced). */
41
+ readonly setContent: (value: string) => void;
42
+ /** Read a `.yaml`/`.yml`/`.json` file into `content`. */
43
+ readonly readFile: (file: File) => Promise<void>;
44
+ /**
45
+ * Validated per-document preview in dependency apply order, or `null`
46
+ * while the content is empty or invalid.
47
+ */
48
+ readonly entries: readonly ManifestPreviewEntry[] | null;
49
+ /** Validation error for the current content, or `null` when valid. */
50
+ readonly validationError: string | null;
51
+ /** `true` while the (debounced) validation + existence checks run. */
52
+ readonly isValidating: boolean;
53
+ /** `true` when the content contains `***REDACTED***` secret markers. */
54
+ readonly hasRedactedSecrets: boolean;
55
+ /**
56
+ * Apply all documents sequentially in dependency order. Entries update
57
+ * live. Stops at the first failure (later entries become `"skipped"`).
58
+ * Resolves `true` when every document applied.
59
+ */
60
+ readonly applyAll: () => Promise<boolean>;
61
+ /** `true` while applies are in flight. */
62
+ readonly isApplying: boolean;
63
+ /** Clear all state (content, preview, errors). */
64
+ readonly reset: () => void;
65
+ }
66
+
67
+ // Validation parses + resolves existence server-side; wait for a typing pause.
68
+ const VALIDATE_DEBOUNCE_MS = 500;
69
+
70
+ /**
71
+ * Headless "apply a YAML manifest" flow for any registry-supported kind —
72
+ * the console counterpart of `stigmer apply -f`.
73
+ *
74
+ * Orchestrates: paste or upload → strict parse against generated proto
75
+ * schemas ({@link parseManifest}) → per-document create-vs-update preview
76
+ * (server existence check) → sequential apply in dependency order with
77
+ * live per-document status.
78
+ *
79
+ * Accepts multi-document manifests (`---` separators) and JSON content
80
+ * (YAML is a superset). The target `org` is injected into documents that
81
+ * omit `metadata.org`; documents naming a *different* org are honored and
82
+ * apply there (matching `stigmer apply` semantics — the org-mismatch
83
+ * warning surfaces on the parsed document).
84
+ *
85
+ * @param org - Target organization slug for `metadata.org` injection.
86
+ *
87
+ * @example
88
+ * ```tsx
89
+ * const manifest = useApplyManifest(activeOrg);
90
+ *
91
+ * <textarea value={manifest.content}
92
+ * onChange={(e) => manifest.setContent(e.target.value)} />
93
+ * {manifest.entries?.map((e) => (
94
+ * <PreviewRow key={e.document.slug} entry={e} />
95
+ * ))}
96
+ * <button onClick={manifest.applyAll} disabled={!manifest.entries}>Apply</button>
97
+ * ```
98
+ *
99
+ * @see {@link ApplyManifestDialog} for the styled component composing this hook
100
+ * @see {@link useEditResourceYaml} for the edit-in-place counterpart
101
+ */
102
+ export function useApplyManifest(org: string): UseApplyManifestReturn {
103
+ const stigmer = useStigmer();
104
+
105
+ const [content, setContentState] = useState("");
106
+ const [entries, setEntries] = useState<readonly ManifestPreviewEntry[] | null>(null);
107
+ const [validationError, setValidationError] = useState<string | null>(null);
108
+ const [isValidating, setIsValidating] = useState(false);
109
+ const [isApplying, setIsApplying] = useState(false);
110
+
111
+ const orgRef = useRef(org);
112
+ orgRef.current = org;
113
+
114
+ const setContent = useCallback((value: string) => {
115
+ setContentState(value);
116
+ }, []);
117
+
118
+ const readFile = useCallback(async (file: File) => {
119
+ let text: string;
120
+ try {
121
+ text = await file.text();
122
+ } catch {
123
+ setContentState("");
124
+ setEntries(null);
125
+ setValidationError(`Failed to read ${file.name}.`);
126
+ return;
127
+ }
128
+ setContentState(text);
129
+ }, []);
130
+
131
+ const reset = useCallback(() => {
132
+ setContentState("");
133
+ setEntries(null);
134
+ setValidationError(null);
135
+ setIsValidating(false);
136
+ setIsApplying(false);
137
+ }, []);
138
+
139
+ // Debounced validation + existence resolution, cancellation-safe. Applies
140
+ // freeze the preview: entries carry live statuses the validator must not
141
+ // clobber mid-run.
142
+ const validateSeq = useRef(0);
143
+ useEffect(() => {
144
+ if (isApplying) return;
145
+
146
+ const seq = ++validateSeq.current;
147
+
148
+ if (!content.trim()) {
149
+ setEntries(null);
150
+ setValidationError(null);
151
+ setIsValidating(false);
152
+ return;
153
+ }
154
+
155
+ setIsValidating(true);
156
+
157
+ const timer = setTimeout(async () => {
158
+ let documents: ManifestDocument[];
159
+ try {
160
+ documents = parseManifest(content, { org: orgRef.current });
161
+ } catch (err) {
162
+ if (validateSeq.current === seq) {
163
+ setEntries(null);
164
+ setValidationError(toError(err).message);
165
+ setIsValidating(false);
166
+ }
167
+ return;
168
+ }
169
+
170
+ const resolved = await Promise.all(
171
+ documents.map(async (document): Promise<ManifestPreviewEntry> => {
172
+ let action: ManifestPreviewEntry["action"];
173
+ try {
174
+ const existing = await stigmer.manifest.getByReference(
175
+ document.handler.yamlKind,
176
+ document.org,
177
+ document.slug,
178
+ );
179
+ action = existing !== null ? "update" : "create";
180
+ } catch {
181
+ action = "unknown";
182
+ }
183
+ return { document, action, status: "pending" };
184
+ }),
185
+ );
186
+
187
+ if (validateSeq.current === seq) {
188
+ setEntries(resolved);
189
+ setValidationError(null);
190
+ setIsValidating(false);
191
+ }
192
+ }, VALIDATE_DEBOUNCE_MS);
193
+
194
+ return () => clearTimeout(timer);
195
+ }, [content, stigmer, isApplying]);
196
+
197
+ const applyAll = useCallback(async (): Promise<boolean> => {
198
+ if (!entries || entries.length === 0) return false;
199
+
200
+ // Invalidate any in-flight validation so it cannot clobber apply statuses.
201
+ validateSeq.current++;
202
+ setIsApplying(true);
203
+
204
+ // Local working copy — React state is updated per transition so the
205
+ // dialog renders progress live.
206
+ const working = entries.map((entry): ManifestPreviewEntry => ({ ...entry, status: "pending" }));
207
+ const commit = () => setEntries([...working]);
208
+
209
+ let allApplied = true;
210
+
211
+ for (let i = 0; i < working.length; i++) {
212
+ if (!allApplied) {
213
+ working[i] = { ...working[i], status: "skipped" };
214
+ continue;
215
+ }
216
+
217
+ working[i] = { ...working[i], status: "applying" };
218
+ commit();
219
+
220
+ try {
221
+ const result = await stigmer.manifest.apply(working[i].document);
222
+ working[i] = { ...working[i], status: "applied", result };
223
+ } catch (err) {
224
+ working[i] = {
225
+ ...working[i],
226
+ status: "failed",
227
+ errorMessage: toError(err).message,
228
+ };
229
+ allApplied = false;
230
+ }
231
+ commit();
232
+ }
233
+
234
+ commit();
235
+ setIsApplying(false);
236
+ return allApplied;
237
+ }, [entries, stigmer]);
238
+
239
+ const hasRedactedSecrets = useMemo(
240
+ () => containsRedactedSecrets(content),
241
+ [content],
242
+ );
243
+
244
+ return useMemo(
245
+ () => ({
246
+ content,
247
+ setContent,
248
+ readFile,
249
+ entries,
250
+ validationError,
251
+ isValidating,
252
+ hasRedactedSecrets,
253
+ applyAll,
254
+ isApplying,
255
+ reset,
256
+ }),
257
+ [
258
+ content,
259
+ setContent,
260
+ readFile,
261
+ entries,
262
+ validationError,
263
+ isValidating,
264
+ hasRedactedSecrets,
265
+ applyAll,
266
+ isApplying,
267
+ reset,
268
+ ],
269
+ );
270
+ }
@@ -0,0 +1,273 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ import type { Message } from "@bufbuild/protobuf";
5
+ import {
6
+ containsRedactedSecrets,
7
+ parseManifest,
8
+ serializeManifest,
9
+ type AppliedManifest,
10
+ type ManifestDocument,
11
+ } from "@stigmer/sdk";
12
+ import { useStigmer } from "../hooks.js";
13
+ import { toError } from "../internal/toError.js";
14
+
15
+ /**
16
+ * Result of validating the edited YAML against the source resource.
17
+ *
18
+ * Discriminated on `status` so consumers can render exactly one of:
19
+ * a disabled state (`empty`), an inline error (`invalid`), or the
20
+ * apply affordance (`valid`).
21
+ */
22
+ export type EditYamlValidation =
23
+ | { readonly status: "empty" }
24
+ | { readonly status: "invalid"; readonly message: string }
25
+ | { readonly status: "valid"; readonly document: ManifestDocument };
26
+
27
+ /**
28
+ * What applying the current content will do — resolved against live
29
+ * server state so renames surface as "create" before the user commits.
30
+ */
31
+ export type EditYamlTarget =
32
+ | { readonly action: "update"; readonly slug: string }
33
+ | { readonly action: "create"; readonly slug: string }
34
+ /** Existence lookup failed (offline, permissions) — wording degrades. */
35
+ | { readonly action: "unknown"; readonly slug: string };
36
+
37
+ /** Options for {@link useEditResourceYaml}. */
38
+ export interface UseEditResourceYamlOptions {
39
+ /**
40
+ * The resource to edit, as returned by the server (e.g. from `useAgent`
41
+ * or a list panel row). `null` while the resource is loading — the hook
42
+ * seeds the editor when it arrives.
43
+ */
44
+ readonly resource: Message | null;
45
+ }
46
+
47
+ /** Return value of {@link useEditResourceYaml}. */
48
+ export interface UseEditResourceYamlReturn {
49
+ /** Current editor content. */
50
+ readonly yaml: string;
51
+ /** Update the editor content (wire to the YAML editor's `onChange`). */
52
+ readonly setYaml: (value: string) => void;
53
+ /** `true` when the content differs from the seeded serialization. */
54
+ readonly isDirty: boolean;
55
+ /** Live validation of the current content. */
56
+ readonly validation: EditYamlValidation;
57
+ /**
58
+ * Create-vs-update preview for the current content, or `null` while
59
+ * validation fails or the existence check is in flight.
60
+ */
61
+ readonly target: EditYamlTarget | null;
62
+ /** `true` when the content contains `***REDACTED***` secret markers. */
63
+ readonly hasRedactedSecrets: boolean;
64
+ /**
65
+ * Apply the edited YAML. Resolves with the applied resource, or `null`
66
+ * when the content is not currently valid (check `validation`).
67
+ */
68
+ readonly apply: () => Promise<AppliedManifest | null>;
69
+ /** `true` while the apply RPC is in flight. */
70
+ readonly isApplying: boolean;
71
+ /** Error from the last failed apply, or `null` when healthy. */
72
+ readonly error: Error | null;
73
+ /** Clear the apply error (e.g. when the user edits again). */
74
+ readonly clearError: () => void;
75
+ /** Discard edits and reseed from the resource. */
76
+ readonly reset: () => void;
77
+ }
78
+
79
+ // Existence checks run against live server state; wait for a typing pause.
80
+ const TARGET_CHECK_DEBOUNCE_MS = 400;
81
+
82
+ /**
83
+ * Behavior hook for editing an existing resource as YAML and applying the
84
+ * result — the console's kind-agnostic "Edit YAML" flow.
85
+ *
86
+ * Seeds the editor from {@link serializeManifest} (full fidelity minus
87
+ * system-managed state), validates every edit against the kind's generated
88
+ * proto schema via {@link parseManifest} (strict — unknown fields fail
89
+ * loudly), previews create-vs-update by resolving the edited document's
90
+ * reference against the server, and applies through
91
+ * `stigmer.manifest.apply()`.
92
+ *
93
+ * Guardrails beyond the raw engine:
94
+ * - the edited document must stay the same kind as the source resource
95
+ * (pasting an Environment into an Agent editor is an error, not an apply)
96
+ * - the edited manifest must contain exactly one document
97
+ *
98
+ * @example
99
+ * ```tsx
100
+ * const edit = useEditResourceYaml({ resource: agent });
101
+ *
102
+ * <YamlEditor value={edit.yaml} onChange={edit.setYaml} />
103
+ * {edit.validation.status === "invalid" && <p>{edit.validation.message}</p>}
104
+ * <button disabled={edit.validation.status !== "valid"} onClick={edit.apply}>
105
+ * {edit.target?.action === "create" ? "Create" : "Apply changes"}
106
+ * </button>
107
+ * ```
108
+ *
109
+ * @see {@link EditResourceYamlDialog} for the styled component composing this hook
110
+ * @see {@link useApplyManifest} for the paste/upload counterpart
111
+ */
112
+ export function useEditResourceYaml({
113
+ resource,
114
+ }: UseEditResourceYamlOptions): UseEditResourceYamlReturn {
115
+ const stigmer = useStigmer();
116
+
117
+ // The serialized source of truth. Recomputed when the resource changes;
118
+ // only reseeds the editor while the user hasn't started editing.
119
+ const seeded = useMemo(
120
+ () => (resource ? serializeManifest(resource) : ""),
121
+ [resource],
122
+ );
123
+
124
+ const [yaml, setYamlState] = useState(seeded);
125
+ const [isDirty, setIsDirty] = useState(false);
126
+ const [isApplying, setIsApplying] = useState(false);
127
+ const [error, setError] = useState<Error | null>(null);
128
+ const [target, setTarget] = useState<EditYamlTarget | null>(null);
129
+
130
+ useEffect(() => {
131
+ if (!isDirty) setYamlState(seeded);
132
+ }, [seeded, isDirty]);
133
+
134
+ const setYaml = useCallback(
135
+ (value: string) => {
136
+ setYamlState(value);
137
+ setIsDirty(value !== seeded);
138
+ },
139
+ [seeded],
140
+ );
141
+
142
+ const reset = useCallback(() => {
143
+ setYamlState(seeded);
144
+ setIsDirty(false);
145
+ setError(null);
146
+ }, [seeded]);
147
+
148
+ const clearError = useCallback(() => setError(null), []);
149
+
150
+ const sourceKind = useMemo(() => {
151
+ if (!resource) return null;
152
+ // The seeded YAML's kind is authoritative for the source resource; a
153
+ // parse of our own serialization cannot fail.
154
+ return seeded ? parseManifest(seeded)[0].handler.yamlKind : null;
155
+ }, [resource, seeded]);
156
+
157
+ const validation = useMemo<EditYamlValidation>(() => {
158
+ if (!yaml.trim()) return { status: "empty" };
159
+
160
+ let documents: ManifestDocument[];
161
+ try {
162
+ documents = parseManifest(yaml);
163
+ } catch (err) {
164
+ return { status: "invalid", message: toError(err).message };
165
+ }
166
+
167
+ if (documents.length > 1) {
168
+ return {
169
+ status: "invalid",
170
+ message:
171
+ "This editor applies a single resource. Remove the extra " +
172
+ "documents, or use Apply YAML in the Library for multi-document manifests.",
173
+ };
174
+ }
175
+
176
+ const document = documents[0];
177
+ if (sourceKind !== null && document.handler.yamlKind !== sourceKind) {
178
+ return {
179
+ status: "invalid",
180
+ message:
181
+ `The document's kind changed from ${sourceKind} to ` +
182
+ `${document.handler.yamlKind}. To apply a different resource kind, ` +
183
+ "use Apply YAML in the Library instead.",
184
+ };
185
+ }
186
+
187
+ return { status: "valid", document };
188
+ }, [yaml, sourceKind]);
189
+
190
+ // Resolve create-vs-update against live state whenever the content
191
+ // becomes valid, debounced across keystrokes and cancellation-safe.
192
+ const checkSeq = useRef(0);
193
+ useEffect(() => {
194
+ if (validation.status !== "valid") {
195
+ setTarget(null);
196
+ return;
197
+ }
198
+
199
+ const { document } = validation;
200
+ const seq = ++checkSeq.current;
201
+ setTarget(null);
202
+
203
+ const timer = setTimeout(async () => {
204
+ let action: EditYamlTarget["action"];
205
+ try {
206
+ const existing = await stigmer.manifest.getByReference(
207
+ document.handler.yamlKind,
208
+ document.org,
209
+ document.slug,
210
+ );
211
+ action = existing !== null ? "update" : "create";
212
+ } catch {
213
+ action = "unknown";
214
+ }
215
+ if (checkSeq.current === seq) {
216
+ setTarget({ action, slug: document.slug });
217
+ }
218
+ }, TARGET_CHECK_DEBOUNCE_MS);
219
+
220
+ return () => clearTimeout(timer);
221
+ }, [validation, stigmer]);
222
+
223
+ const apply = useCallback(async (): Promise<AppliedManifest | null> => {
224
+ if (validation.status !== "valid") return null;
225
+
226
+ setIsApplying(true);
227
+ setError(null);
228
+ try {
229
+ const applied = await stigmer.manifest.apply(validation.document);
230
+ setIsDirty(false);
231
+ return applied;
232
+ } catch (err) {
233
+ setError(toError(err));
234
+ throw err;
235
+ } finally {
236
+ setIsApplying(false);
237
+ }
238
+ }, [validation, stigmer]);
239
+
240
+ const hasRedactedSecrets = useMemo(
241
+ () => containsRedactedSecrets(yaml),
242
+ [yaml],
243
+ );
244
+
245
+ return useMemo(
246
+ () => ({
247
+ yaml,
248
+ setYaml,
249
+ isDirty,
250
+ validation,
251
+ target,
252
+ hasRedactedSecrets,
253
+ apply,
254
+ isApplying,
255
+ error,
256
+ clearError,
257
+ reset,
258
+ }),
259
+ [
260
+ yaml,
261
+ setYaml,
262
+ isDirty,
263
+ validation,
264
+ target,
265
+ hasRedactedSecrets,
266
+ apply,
267
+ isApplying,
268
+ error,
269
+ clearError,
270
+ reset,
271
+ ],
272
+ );
273
+ }
@@ -407,10 +407,14 @@ export function McpServerDetailView({
407
407
  updatedAt: specAudit?.updatedAt ? timestampDate(specAudit.updatedAt) : null,
408
408
  };
409
409
 
410
- // Inline visibility is read-only (at-a-glance); editing lives in the
411
- // Manage access dialog, the single writer for both access axes.
410
+ // Inline visibility is at-a-glance AND a shortcut into the Manage access
411
+ // dialog the single writer for both access axes. The chip is navigation
412
+ // only; it stays a static badge for users who cannot view access.
412
413
  const visibilityControl = meta ? (
413
- <VisibilityBadge visibility={meta.visibility} />
414
+ <VisibilityBadge
415
+ visibility={meta.visibility}
416
+ onClick={access.action ? access.open : undefined}
417
+ />
414
418
  ) : undefined;
415
419
 
416
420
  const mergedActions = access.action
@@ -2,9 +2,8 @@
2
2
 
3
3
  import { useMemo } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
- import { getUserMessage } from "@stigmer/sdk";
5
+ import { buildMcpServerProto, getUserMessage, serializeManifest } from "@stigmer/sdk";
6
6
  import type { McpServerInput } from "@stigmer/sdk";
7
- import { serializeMcpServerInputYaml } from "../../library/serialize-resource-yaml.js";
8
7
  import type { McpServerWizardData } from "./types.js";
9
8
 
10
9
  /** Props for {@link ReviewStep}. */
@@ -33,7 +32,7 @@ export function ReviewStep({
33
32
  [org, data],
34
33
  );
35
34
  const yamlPreview = useMemo(
36
- () => serializeMcpServerInputYaml(mcpServerInput),
35
+ () => serializeManifest(buildMcpServerProto(mcpServerInput)),
37
36
  [mcpServerInput],
38
37
  );
39
38
 
@@ -122,7 +122,7 @@ spec:
122
122
  - name: extract_findings
123
123
  kind: llm_call
124
124
  task_config:
125
- model: "gpt-4o-mini"
125
+ model: "claude-haiku-4.5"
126
126
  system_prompt: "Extract structured key findings from the analysis."
127
127
  prompt: >
128
128
  Extract the key findings from this analysis as structured data:
@@ -280,7 +280,7 @@ spec:
280
280
  - name: classify_ticket
281
281
  kind: llm_call
282
282
  task_config:
283
- model: "gpt-4o-mini"
283
+ model: "claude-haiku-4.5"
284
284
  system_prompt: >
285
285
  You are a support ticket classifier. Analyze the ticket and classify
286
286
  it by severity and category. Be conservative with critical/high
@@ -923,7 +923,7 @@ spec:
923
923
  - name: diagnose_error
924
924
  kind: llm_call
925
925
  task_config:
926
- model: "gpt-4o-mini"
926
+ model: "claude-haiku-4.5"
927
927
  system_prompt: >
928
928
  You are an API integration specialist. Given an error from
929
929
  an HTTP call, provide a brief, actionable diagnosis.
@@ -1010,7 +1010,7 @@ spec:
1010
1010
  description: "Comma-separated list of topics the response should cover"
1011
1011
  optional: true
1012
1012
  MODEL_UNDER_TEST:
1013
- description: "Model to evaluate (default: gpt-4o-mini)"
1013
+ description: "Model to evaluate (default: claude-haiku-4.5)"
1014
1014
  optional: true
1015
1015
  budget:
1016
1016
  max_cost_micros: 2000000
@@ -817,7 +817,13 @@ const ConversationColumn = memo(function ConversationColumn({
817
817
  // a plan read-only in the panel remains — reading is the point.
818
818
  onRetrySend={isObserver ? undefined : conv.retryLastSend}
819
819
  onRetryExecution={isObserver ? undefined : onRetryExecution}
820
- onApprovalSubmit={isObserver ? undefined : flow.submitApproval}
820
+ // Approval mechanics are an OPERATOR surface, never a guest's
821
+ // (DD-014): the HITL gate protects the org's tools, and an anonymous
822
+ // visitor is not its trustee. Guest executions run unattended
823
+ // (gated tools auto-skip server-side), so nothing is ever pending on
824
+ // a new execution — withholding the callback is the belt-and-braces
825
+ // for pre-existing sessions and embedders composing the SDK directly.
826
+ onApprovalSubmit={isObserver || isGuest ? undefined : flow.submitApproval}
821
827
  submittingApprovalIds={conv.submittingApprovalIds}
822
828
  approvalErrors={conv.approvalErrors}
823
829
  showFileReviewRecords
@@ -35,8 +35,12 @@ vi.mock("../facets/SetupTab", () => ({
35
35
  },
36
36
  }));
37
37
 
38
+ const threadProps: CapturedProps[] = [];
38
39
  vi.mock("../../execution/MessageThread", () => ({
39
- MessageThread: () => <div data-testid="thread-probe" />,
40
+ MessageThread: (props: CapturedProps) => {
41
+ threadProps.push(props);
42
+ return <div data-testid="thread-probe" />;
43
+ },
40
44
  }));
41
45
 
42
46
  // ---------------------------------------------------------------------------
@@ -93,6 +97,7 @@ const stubConv = {
93
97
  isSending: false,
94
98
  sendError: null,
95
99
  clearSendError: vi.fn(),
100
+ retryLastSend: vi.fn(),
96
101
  pendingUserMessage: null,
97
102
  workspaceEntries: [],
98
103
  mcpServerUsages: [],
@@ -159,6 +164,11 @@ function lastComposerProps(): CapturedProps {
159
164
  return composerProps.at(-1)!;
160
165
  }
161
166
 
167
+ function lastThreadProps(): CapturedProps {
168
+ expect(threadProps.length).toBeGreaterThan(0);
169
+ return threadProps.at(-1)!;
170
+ }
171
+
162
172
  /**
163
173
  * Reach the Config facet through the unified panel: expand it via the
164
174
  * top-right chip, pick Config in the rail, and return the props the (mocked)
@@ -174,6 +184,7 @@ function openedConfigFacet(): { mutations?: unknown } {
174
184
  beforeEach(() => {
175
185
  composerProps.length = 0;
176
186
  setupTabProps.length = 0;
187
+ threadProps.length = 0;
177
188
  stubSessionPageFlow.submitError = null;
178
189
  });
179
190
 
@@ -375,6 +386,25 @@ describe("SessionViewer — audience wiring", () => {
375
386
  );
376
387
  });
377
388
 
389
+ it("guest: approval mechanics are withheld from the thread (DD-014)", () => {
390
+ // The HITL gate protects the ORG's tools; an anonymous visitor is not
391
+ // its trustee. Guest executions run unattended server-side, so nothing
392
+ // is ever pending on a new execution — withholding the callback is the
393
+ // belt-and-braces for pre-existing sessions and direct SDK embedders.
394
+ render(<SessionViewer sessionId="ses_1" org="acme" audience="guest" />);
395
+
396
+ const props = lastThreadProps();
397
+ expect(props.onApprovalSubmit).toBeUndefined();
398
+ // Chat interaction survives — a guest owns their own conversation.
399
+ expect(props.onRetrySend).toBeDefined();
400
+ });
401
+
402
+ it("integrator: approvals stay wired on the thread", () => {
403
+ render(<SessionViewer sessionId="ses_1" org="acme" />);
404
+
405
+ expect(lastThreadProps().onApprovalSubmit).toBeDefined();
406
+ });
407
+
378
408
  it("forwards getRuntimeEnv to the flow", () => {
379
409
  const getRuntimeEnv = vi.fn();
380
410
  render(