@stigmer/react 3.2.3 → 3.4.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 (460) hide show
  1. package/agent/steps/ReviewStep.d.ts.map +1 -1
  2. package/agent/steps/ReviewStep.js +2 -3
  3. package/agent/steps/ReviewStep.js.map +1 -1
  4. package/billing/index.d.ts.map +1 -1
  5. package/billing/index.js +4 -0
  6. package/billing/index.js.map +1 -1
  7. package/channel/AgentChannelsPanel.d.ts.map +1 -1
  8. package/channel/AgentChannelsPanel.js +11 -5
  9. package/channel/AgentChannelsPanel.js.map +1 -1
  10. package/composer/SessionComposer.d.ts +1 -1
  11. package/cursor-accounts/CursorAccountEditor.d.ts +34 -0
  12. package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
  13. package/cursor-accounts/CursorAccountEditor.js +67 -0
  14. package/cursor-accounts/CursorAccountEditor.js.map +1 -0
  15. package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
  16. package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
  17. package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
  18. package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
  19. package/cursor-accounts/CursorAccountsConsole.d.ts +32 -0
  20. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
  21. package/cursor-accounts/CursorAccountsConsole.js +169 -0
  22. package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
  23. package/cursor-accounts/MemberCoverageTable.d.ts +29 -0
  24. package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -0
  25. package/cursor-accounts/MemberCoverageTable.js +150 -0
  26. package/cursor-accounts/MemberCoverageTable.js.map +1 -0
  27. package/cursor-accounts/MemberKeysPanel.d.ts +25 -0
  28. package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -0
  29. package/cursor-accounts/MemberKeysPanel.js +115 -0
  30. package/cursor-accounts/MemberKeysPanel.js.map +1 -0
  31. package/cursor-accounts/badges.d.ts +9 -0
  32. package/cursor-accounts/badges.d.ts.map +1 -0
  33. package/cursor-accounts/badges.js +10 -0
  34. package/cursor-accounts/badges.js.map +1 -0
  35. package/cursor-accounts/cursor-account-coverage.d.ts +41 -0
  36. package/cursor-accounts/cursor-account-coverage.d.ts.map +1 -0
  37. package/cursor-accounts/cursor-account-coverage.js +26 -0
  38. package/cursor-accounts/cursor-account-coverage.js.map +1 -0
  39. package/cursor-accounts/cursor-account-format.d.ts +23 -0
  40. package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
  41. package/cursor-accounts/cursor-account-format.js +41 -0
  42. package/cursor-accounts/cursor-account-format.js.map +1 -0
  43. package/cursor-accounts/index.d.ts +18 -0
  44. package/cursor-accounts/index.d.ts.map +1 -0
  45. package/cursor-accounts/index.js +13 -0
  46. package/cursor-accounts/index.js.map +1 -0
  47. package/cursor-accounts/useCursorAccountView.d.ts +30 -0
  48. package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
  49. package/cursor-accounts/useCursorAccountView.js +25 -0
  50. package/cursor-accounts/useCursorAccountView.js.map +1 -0
  51. package/cursor-accounts/useCursorAccounts.d.ts +33 -0
  52. package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
  53. package/cursor-accounts/useCursorAccounts.js +25 -0
  54. package/cursor-accounts/useCursorAccounts.js.map +1 -0
  55. package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
  56. package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
  57. package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
  58. package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
  59. package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
  60. package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
  61. package/cursor-accounts/useDeleteCursorAccount.js +32 -0
  62. package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
  63. package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
  64. package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
  65. package/cursor-accounts/useSyncCursorAccount.js +31 -0
  66. package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
  67. package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
  68. package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
  69. package/cursor-accounts/useUpsertCursorAccount.js +34 -0
  70. package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
  71. package/datastore/CollectionRecordsBrowser.d.ts +34 -0
  72. package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
  73. package/datastore/CollectionRecordsBrowser.js +223 -0
  74. package/datastore/CollectionRecordsBrowser.js.map +1 -0
  75. package/datastore/CollectionSchemaView.d.ts +29 -0
  76. package/datastore/CollectionSchemaView.d.ts.map +1 -0
  77. package/datastore/CollectionSchemaView.js +93 -0
  78. package/datastore/CollectionSchemaView.js.map +1 -0
  79. package/datastore/DatastoreDetailView.d.ts +44 -0
  80. package/datastore/DatastoreDetailView.d.ts.map +1 -0
  81. package/datastore/DatastoreDetailView.js +76 -0
  82. package/datastore/DatastoreDetailView.js.map +1 -0
  83. package/datastore/DatastoreSyncReport.d.ts +19 -0
  84. package/datastore/DatastoreSyncReport.d.ts.map +1 -0
  85. package/datastore/DatastoreSyncReport.js +45 -0
  86. package/datastore/DatastoreSyncReport.js.map +1 -0
  87. package/datastore/DeleteDatastoreDialog.d.ts +35 -0
  88. package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
  89. package/datastore/DeleteDatastoreDialog.js +90 -0
  90. package/datastore/DeleteDatastoreDialog.js.map +1 -0
  91. package/datastore/FieldValueControl.d.ts +55 -0
  92. package/datastore/FieldValueControl.d.ts.map +1 -0
  93. package/datastore/FieldValueControl.js +138 -0
  94. package/datastore/FieldValueControl.js.map +1 -0
  95. package/datastore/RecordFilterBuilder.d.ts +37 -0
  96. package/datastore/RecordFilterBuilder.d.ts.map +1 -0
  97. package/datastore/RecordFilterBuilder.js +122 -0
  98. package/datastore/RecordFilterBuilder.js.map +1 -0
  99. package/datastore/RecordFormPanel.d.ts +45 -0
  100. package/datastore/RecordFormPanel.d.ts.map +1 -0
  101. package/datastore/RecordFormPanel.js +215 -0
  102. package/datastore/RecordFormPanel.js.map +1 -0
  103. package/datastore/index.d.ts +43 -0
  104. package/datastore/index.d.ts.map +1 -0
  105. package/datastore/index.js +22 -0
  106. package/datastore/index.js.map +1 -0
  107. package/datastore/recordFilter.d.ts +62 -0
  108. package/datastore/recordFilter.d.ts.map +1 -0
  109. package/datastore/recordFilter.js +104 -0
  110. package/datastore/recordFilter.js.map +1 -0
  111. package/datastore/recordValues.d.ts +85 -0
  112. package/datastore/recordValues.d.ts.map +1 -0
  113. package/datastore/recordValues.js +282 -0
  114. package/datastore/recordValues.js.map +1 -0
  115. package/datastore/useDatastore.d.ts +39 -0
  116. package/datastore/useDatastore.d.ts.map +1 -0
  117. package/datastore/useDatastore.js +44 -0
  118. package/datastore/useDatastore.js.map +1 -0
  119. package/datastore/useDatastoreCount.d.ts +48 -0
  120. package/datastore/useDatastoreCount.d.ts.map +1 -0
  121. package/datastore/useDatastoreCount.js +27 -0
  122. package/datastore/useDatastoreCount.js.map +1 -0
  123. package/datastore/useDatastoreDescription.d.ts +54 -0
  124. package/datastore/useDatastoreDescription.d.ts.map +1 -0
  125. package/datastore/useDatastoreDescription.js +50 -0
  126. package/datastore/useDatastoreDescription.js.map +1 -0
  127. package/datastore/useDatastoreList.d.ts +57 -0
  128. package/datastore/useDatastoreList.d.ts.map +1 -0
  129. package/datastore/useDatastoreList.js +29 -0
  130. package/datastore/useDatastoreList.js.map +1 -0
  131. package/datastore/useDatastoreSearch.d.ts +19 -0
  132. package/datastore/useDatastoreSearch.d.ts.map +1 -0
  133. package/datastore/useDatastoreSearch.js +22 -0
  134. package/datastore/useDatastoreSearch.js.map +1 -0
  135. package/datastore/useDeleteDatastore.d.ts +53 -0
  136. package/datastore/useDeleteDatastore.d.ts.map +1 -0
  137. package/datastore/useDeleteDatastore.js +40 -0
  138. package/datastore/useDeleteDatastore.js.map +1 -0
  139. package/datastore/useDeleteRecord.d.ts +34 -0
  140. package/datastore/useDeleteRecord.d.ts.map +1 -0
  141. package/datastore/useDeleteRecord.js +43 -0
  142. package/datastore/useDeleteRecord.js.map +1 -0
  143. package/datastore/useInsertRecord.d.ts +50 -0
  144. package/datastore/useInsertRecord.d.ts.map +1 -0
  145. package/datastore/useInsertRecord.js +55 -0
  146. package/datastore/useInsertRecord.js.map +1 -0
  147. package/datastore/useRecordCollection.d.ts +104 -0
  148. package/datastore/useRecordCollection.d.ts.map +1 -0
  149. package/datastore/useRecordCollection.js +136 -0
  150. package/datastore/useRecordCollection.js.map +1 -0
  151. package/datastore/useRecordList.d.ts +66 -0
  152. package/datastore/useRecordList.d.ts.map +1 -0
  153. package/datastore/useRecordList.js +58 -0
  154. package/datastore/useRecordList.js.map +1 -0
  155. package/datastore/useUpdateRecord.d.ts +52 -0
  156. package/datastore/useUpdateRecord.d.ts.map +1 -0
  157. package/datastore/useUpdateRecord.js +55 -0
  158. package/datastore/useUpdateRecord.js.map +1 -0
  159. package/environment/EnvironmentListPanel.d.ts.map +1 -1
  160. package/environment/EnvironmentListPanel.js +12 -7
  161. package/environment/EnvironmentListPanel.js.map +1 -1
  162. package/execution/ExecutionProgress.d.ts.map +1 -1
  163. package/execution/ExecutionProgress.js +13 -4
  164. package/execution/ExecutionProgress.js.map +1 -1
  165. package/execution/MessageThread.d.ts.map +1 -1
  166. package/execution/MessageThread.js +10 -2
  167. package/execution/MessageThread.js.map +1 -1
  168. package/execution/useCreateAgentExecution.d.ts +31 -1
  169. package/execution/useCreateAgentExecution.d.ts.map +1 -1
  170. package/execution/useCreateAgentExecution.js +2 -0
  171. package/execution/useCreateAgentExecution.js.map +1 -1
  172. package/iam-policy/index.d.ts +1 -1
  173. package/iam-policy/index.d.ts.map +1 -1
  174. package/iam-policy/index.js.map +1 -1
  175. package/iam-policy/useCheckPermission.d.ts +32 -11
  176. package/iam-policy/useCheckPermission.d.ts.map +1 -1
  177. package/iam-policy/useCheckPermission.js +24 -19
  178. package/iam-policy/useCheckPermission.js.map +1 -1
  179. package/index.d.ts +12 -4
  180. package/index.d.ts.map +1 -1
  181. package/index.js +18 -3
  182. package/index.js.map +1 -1
  183. package/internal/form-primitives.d.ts +10 -0
  184. package/internal/form-primitives.d.ts.map +1 -0
  185. package/internal/form-primitives.js +15 -0
  186. package/internal/form-primitives.js.map +1 -0
  187. package/library/index.d.ts +0 -7
  188. package/library/index.d.ts.map +1 -1
  189. package/library/index.js +0 -4
  190. package/library/index.js.map +1 -1
  191. package/library/useApplyResource.d.ts +12 -12
  192. package/library/useApplyResource.d.ts.map +1 -1
  193. package/library/useApplyResource.js +16 -25
  194. package/library/useApplyResource.js.map +1 -1
  195. package/library/useExportResource.d.ts +13 -9
  196. package/library/useExportResource.d.ts.map +1 -1
  197. package/library/useExportResource.js +18 -36
  198. package/library/useExportResource.js.map +1 -1
  199. package/manifest/ApplyManifestDialog.d.ts +48 -0
  200. package/manifest/ApplyManifestDialog.d.ts.map +1 -0
  201. package/manifest/ApplyManifestDialog.js +135 -0
  202. package/manifest/ApplyManifestDialog.js.map +1 -0
  203. package/manifest/EditResourceYamlDialog.d.ts +51 -0
  204. package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
  205. package/manifest/EditResourceYamlDialog.js +104 -0
  206. package/manifest/EditResourceYamlDialog.js.map +1 -0
  207. package/manifest/RedactedSecretsNotice.d.ts +14 -0
  208. package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
  209. package/manifest/RedactedSecretsNotice.js +14 -0
  210. package/manifest/RedactedSecretsNotice.js.map +1 -0
  211. package/manifest/YamlEditor.d.ts +44 -0
  212. package/manifest/YamlEditor.d.ts.map +1 -0
  213. package/manifest/YamlEditor.js +216 -0
  214. package/manifest/YamlEditor.js.map +1 -0
  215. package/manifest/index.d.ts +13 -0
  216. package/manifest/index.d.ts.map +1 -0
  217. package/manifest/index.js +13 -0
  218. package/manifest/index.js.map +1 -0
  219. package/manifest/useApplyManifest.d.ts +82 -0
  220. package/manifest/useApplyManifest.d.ts.map +1 -0
  221. package/manifest/useApplyManifest.js +180 -0
  222. package/manifest/useApplyManifest.js.map +1 -0
  223. package/manifest/useEditResourceYaml.d.ts +106 -0
  224. package/manifest/useEditResourceYaml.d.ts.map +1 -0
  225. package/manifest/useEditResourceYaml.js +168 -0
  226. package/manifest/useEditResourceYaml.js.map +1 -0
  227. package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
  228. package/mcp-server/steps/ReviewStep.js +2 -3
  229. package/mcp-server/steps/ReviewStep.js.map +1 -1
  230. package/package.json +4 -4
  231. package/pricing-governance/BaselineEditor.d.ts +9 -0
  232. package/pricing-governance/BaselineEditor.d.ts.map +1 -0
  233. package/pricing-governance/BaselineEditor.js +270 -0
  234. package/pricing-governance/BaselineEditor.js.map +1 -0
  235. package/pricing-governance/ModelCatalogPanel.d.ts +28 -0
  236. package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
  237. package/pricing-governance/ModelCatalogPanel.js +102 -0
  238. package/pricing-governance/ModelCatalogPanel.js.map +1 -0
  239. package/pricing-governance/ModelGovernanceDetail.d.ts +8 -0
  240. package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
  241. package/pricing-governance/ModelGovernanceDetail.js +64 -0
  242. package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
  243. package/pricing-governance/OperatorAccessNotice.d.ts +12 -0
  244. package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
  245. package/pricing-governance/OperatorAccessNotice.js +15 -0
  246. package/pricing-governance/OperatorAccessNotice.js.map +1 -0
  247. package/pricing-governance/PricingGovernanceConsole.d.ts +57 -0
  248. package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
  249. package/pricing-governance/PricingGovernanceConsole.js +164 -0
  250. package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
  251. package/pricing-governance/PricingGovernancePanel.d.ts +26 -0
  252. package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
  253. package/pricing-governance/PricingGovernancePanel.js +64 -0
  254. package/pricing-governance/PricingGovernancePanel.js.map +1 -0
  255. package/pricing-governance/RetireConfirm.d.ts +9 -0
  256. package/pricing-governance/RetireConfirm.d.ts.map +1 -0
  257. package/pricing-governance/RetireConfirm.js +19 -0
  258. package/pricing-governance/RetireConfirm.js.map +1 -0
  259. package/pricing-governance/governance-primitives.d.ts +33 -0
  260. package/pricing-governance/governance-primitives.d.ts.map +1 -0
  261. package/pricing-governance/governance-primitives.js +43 -0
  262. package/pricing-governance/governance-primitives.js.map +1 -0
  263. package/pricing-governance/index.d.ts +19 -0
  264. package/pricing-governance/index.d.ts.map +1 -0
  265. package/pricing-governance/index.js +20 -0
  266. package/pricing-governance/index.js.map +1 -0
  267. package/pricing-governance/pricing-format.d.ts +12 -0
  268. package/pricing-governance/pricing-format.d.ts.map +1 -0
  269. package/pricing-governance/pricing-format.js +50 -0
  270. package/pricing-governance/pricing-format.js.map +1 -0
  271. package/pricing-governance/useDecidePricingOverride.d.ts +46 -0
  272. package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
  273. package/pricing-governance/useDecidePricingOverride.js +44 -0
  274. package/pricing-governance/useDecidePricingOverride.js.map +1 -0
  275. package/pricing-governance/useModelGovernanceView.d.ts +103 -0
  276. package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
  277. package/pricing-governance/useModelGovernanceView.js +144 -0
  278. package/pricing-governance/useModelGovernanceView.js.map +1 -0
  279. package/pricing-governance/useModelPricingBaselines.d.ts +40 -0
  280. package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
  281. package/pricing-governance/useModelPricingBaselines.js +32 -0
  282. package/pricing-governance/useModelPricingBaselines.js.map +1 -0
  283. package/pricing-governance/usePricingGovernance.d.ts +39 -0
  284. package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
  285. package/pricing-governance/usePricingGovernance.js +31 -0
  286. package/pricing-governance/usePricingGovernance.js.map +1 -0
  287. package/pricing-governance/useRetireModelPricingBaseline.d.ts +31 -0
  288. package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
  289. package/pricing-governance/useRetireModelPricingBaseline.js +36 -0
  290. package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
  291. package/pricing-governance/useUpsertModelPricingBaseline.d.ts +38 -0
  292. package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
  293. package/pricing-governance/useUpsertModelPricingBaseline.js +37 -0
  294. package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
  295. package/resource-creation/templates/workflow-templates.js +4 -4
  296. package/session/useCreateSession.d.ts +28 -0
  297. package/session/useCreateSession.d.ts.map +1 -1
  298. package/session/useCreateSession.js +2 -1
  299. package/session/useCreateSession.js.map +1 -1
  300. package/session/useEditSessionPrep.js +3 -3
  301. package/session/useEditSessionPrep.js.map +1 -1
  302. package/session/useNewSessionFlow.d.ts +30 -0
  303. package/session/useNewSessionFlow.d.ts.map +1 -1
  304. package/session/useNewSessionFlow.js +7 -1
  305. package/session/useNewSessionFlow.js.map +1 -1
  306. package/session/useUpdateSession.d.ts +29 -10
  307. package/session/useUpdateSession.d.ts.map +1 -1
  308. package/session/useUpdateSession.js +29 -10
  309. package/session/useUpdateSession.js.map +1 -1
  310. package/settings/index.d.ts +2 -1
  311. package/settings/index.d.ts.map +1 -1
  312. package/settings/index.js +2 -1
  313. package/settings/index.js.map +1 -1
  314. package/settings/settings-nav.d.ts +22 -0
  315. package/settings/settings-nav.d.ts.map +1 -1
  316. package/settings/settings-nav.js +32 -1
  317. package/settings/settings-nav.js.map +1 -1
  318. package/settings/useSettingsNavGroups.d.ts +29 -0
  319. package/settings/useSettingsNavGroups.d.ts.map +1 -0
  320. package/settings/useSettingsNavGroups.js +61 -0
  321. package/settings/useSettingsNavGroups.js.map +1 -0
  322. package/src/agent/steps/ReviewStep.tsx +2 -3
  323. package/src/billing/index.ts +5 -0
  324. package/src/channel/AgentChannelsPanel.tsx +27 -1
  325. package/src/composer/SessionComposer.tsx +1 -1
  326. package/src/cursor-accounts/CursorAccountEditor.tsx +229 -0
  327. package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
  328. package/src/cursor-accounts/CursorAccountsConsole.tsx +454 -0
  329. package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
  330. package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
  331. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +680 -0
  332. package/src/cursor-accounts/__tests__/cursor-account-coverage.test.ts +73 -0
  333. package/src/cursor-accounts/badges.tsx +26 -0
  334. package/src/cursor-accounts/cursor-account-coverage.ts +71 -0
  335. package/src/cursor-accounts/cursor-account-format.ts +45 -0
  336. package/src/cursor-accounts/index.ts +29 -0
  337. package/src/cursor-accounts/useCursorAccountView.ts +49 -0
  338. package/src/cursor-accounts/useCursorAccounts.ts +49 -0
  339. package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
  340. package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
  341. package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
  342. package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
  343. package/src/datastore/CollectionRecordsBrowser.tsx +570 -0
  344. package/src/datastore/CollectionSchemaView.tsx +247 -0
  345. package/src/datastore/DatastoreDetailView.tsx +201 -0
  346. package/src/datastore/DatastoreSyncReport.tsx +105 -0
  347. package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
  348. package/src/datastore/FieldValueControl.tsx +289 -0
  349. package/src/datastore/RecordFilterBuilder.tsx +422 -0
  350. package/src/datastore/RecordFormPanel.tsx +432 -0
  351. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +245 -0
  352. package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
  353. package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
  354. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +155 -0
  355. package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
  356. package/src/datastore/__tests__/recordFilter.test.ts +169 -0
  357. package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
  358. package/src/datastore/__tests__/recordValues.test.ts +359 -0
  359. package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
  360. package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
  361. package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
  362. package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
  363. package/src/datastore/index.ts +111 -0
  364. package/src/datastore/recordFilter.ts +154 -0
  365. package/src/datastore/recordValues.ts +327 -0
  366. package/src/datastore/useDatastore.ts +67 -0
  367. package/src/datastore/useDatastoreCount.ts +67 -0
  368. package/src/datastore/useDatastoreDescription.ts +90 -0
  369. package/src/datastore/useDatastoreList.ts +79 -0
  370. package/src/datastore/useDatastoreSearch.ts +39 -0
  371. package/src/datastore/useDeleteDatastore.ts +87 -0
  372. package/src/datastore/useDeleteRecord.ts +77 -0
  373. package/src/datastore/useInsertRecord.ts +92 -0
  374. package/src/datastore/useRecordCollection.ts +256 -0
  375. package/src/datastore/useRecordList.ts +131 -0
  376. package/src/datastore/useUpdateRecord.ts +95 -0
  377. package/src/environment/EnvironmentListPanel.tsx +24 -0
  378. package/src/execution/ExecutionProgress.tsx +14 -4
  379. package/src/execution/MessageThread.tsx +10 -2
  380. package/src/execution/__tests__/ExecutionProgress.test.tsx +67 -0
  381. package/src/execution/__tests__/MessageThread.test.tsx +44 -0
  382. package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
  383. package/src/execution/__tests__/useCreateAgentExecution.test.tsx +86 -0
  384. package/src/execution/useCreateAgentExecution.ts +41 -6
  385. package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
  386. package/src/iam-policy/index.ts +1 -0
  387. package/src/iam-policy/useCheckPermission.ts +45 -19
  388. package/src/index.ts +172 -14
  389. package/src/internal/form-primitives.tsx +40 -0
  390. package/src/library/index.ts +0 -20
  391. package/src/library/useApplyResource.ts +27 -34
  392. package/src/library/useExportResource.ts +21 -40
  393. package/src/manifest/ApplyManifestDialog.tsx +315 -0
  394. package/src/manifest/EditResourceYamlDialog.tsx +265 -0
  395. package/src/manifest/RedactedSecretsNotice.tsx +30 -0
  396. package/src/manifest/YamlEditor.tsx +272 -0
  397. package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
  398. package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
  399. package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
  400. package/src/manifest/index.ts +33 -0
  401. package/src/manifest/useApplyManifest.ts +270 -0
  402. package/src/manifest/useEditResourceYaml.ts +273 -0
  403. package/src/mcp-server/steps/ReviewStep.tsx +2 -3
  404. package/src/pricing-governance/BaselineEditor.tsx +652 -0
  405. package/src/pricing-governance/ModelCatalogPanel.tsx +283 -0
  406. package/src/pricing-governance/ModelGovernanceDetail.tsx +289 -0
  407. package/src/pricing-governance/OperatorAccessNotice.tsx +32 -0
  408. package/src/pricing-governance/PricingGovernanceConsole.tsx +465 -0
  409. package/src/pricing-governance/PricingGovernancePanel.tsx +166 -0
  410. package/src/pricing-governance/RetireConfirm.tsx +82 -0
  411. package/src/pricing-governance/__tests__/ModelCatalogPanel.test.tsx +253 -0
  412. package/src/pricing-governance/__tests__/PricingGovernanceConsole.test.tsx +410 -0
  413. package/src/pricing-governance/__tests__/useModelGovernanceView.test.tsx +308 -0
  414. package/src/pricing-governance/governance-primitives.tsx +133 -0
  415. package/src/pricing-governance/index.ts +50 -0
  416. package/src/pricing-governance/pricing-format.ts +53 -0
  417. package/src/pricing-governance/useDecidePricingOverride.ts +78 -0
  418. package/src/pricing-governance/useModelGovernanceView.ts +290 -0
  419. package/src/pricing-governance/useModelPricingBaselines.ts +69 -0
  420. package/src/pricing-governance/usePricingGovernance.ts +57 -0
  421. package/src/pricing-governance/useRetireModelPricingBaseline.ts +65 -0
  422. package/src/pricing-governance/useUpsertModelPricingBaseline.ts +72 -0
  423. package/src/resource-creation/templates/workflow-templates.ts +4 -4
  424. package/src/session/__tests__/useCreateSession.test.tsx +94 -0
  425. package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
  426. package/src/session/useCreateSession.ts +30 -0
  427. package/src/session/useEditSessionPrep.ts +3 -3
  428. package/src/session/useNewSessionFlow.ts +45 -1
  429. package/src/session/useUpdateSession.ts +29 -10
  430. package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
  431. package/src/settings/index.ts +5 -1
  432. package/src/settings/settings-nav.ts +43 -0
  433. package/src/settings/useSettingsNavGroups.ts +81 -0
  434. package/src/workflow/WorkflowYamlEditor.tsx +6 -270
  435. package/styles.css +1 -1
  436. package/workflow/CanvasTransitionEdge.d.ts +1 -1
  437. package/workflow/WorkflowYamlEditor.d.ts +2 -42
  438. package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
  439. package/workflow/WorkflowYamlEditor.js +5 -214
  440. package/workflow/WorkflowYamlEditor.js.map +1 -1
  441. package/library/ImportResourceDialog.d.ts +0 -43
  442. package/library/ImportResourceDialog.d.ts.map +0 -1
  443. package/library/ImportResourceDialog.js +0 -90
  444. package/library/ImportResourceDialog.js.map +0 -1
  445. package/library/parse-resource-yaml.d.ts +0 -63
  446. package/library/parse-resource-yaml.d.ts.map +0 -1
  447. package/library/parse-resource-yaml.js +0 -407
  448. package/library/parse-resource-yaml.js.map +0 -1
  449. package/library/serialize-resource-yaml.d.ts +0 -103
  450. package/library/serialize-resource-yaml.d.ts.map +0 -1
  451. package/library/serialize-resource-yaml.js +0 -565
  452. package/library/serialize-resource-yaml.js.map +0 -1
  453. package/library/useImportResource.d.ts +0 -84
  454. package/library/useImportResource.d.ts.map +0 -1
  455. package/library/useImportResource.js +0 -188
  456. package/library/useImportResource.js.map +0 -1
  457. package/src/library/ImportResourceDialog.tsx +0 -227
  458. package/src/library/parse-resource-yaml.ts +0 -630
  459. package/src/library/serialize-resource-yaml.ts +0 -756
  460. package/src/library/useImportResource.ts +0 -253
@@ -0,0 +1,290 @@
1
+ "use client";
2
+
3
+ import { useCallback, useMemo, useState } from "react";
4
+ import {
5
+ ModelPricingBaselineStatus,
6
+ type ModelPricingBaseline,
7
+ } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
8
+ import type { ModelPricingGovernanceEntry } from "@stigmer/protos/ai/stigmer/billing/v1/io_pb";
9
+ import type { ModelPricingOverride } from "@stigmer/protos/ai/stigmer/billing/v1/pricing_override_pb";
10
+ import { useModelPricingBaselines } from "./useModelPricingBaselines.js";
11
+ import { usePricingGovernance } from "./usePricingGovernance.js";
12
+
13
+ /**
14
+ * One model in the unified governance view: the ACTIVE catalog baseline
15
+ * joined with its effective-registry governance state and its
16
+ * append-only revision history.
17
+ */
18
+ export interface ModelGovernanceRow {
19
+ /** Stable identity: `modelId|provider|harness` (the catalog key). */
20
+ readonly key: string;
21
+ /** The ACTIVE baseline revision (catalog fields + list rates). */
22
+ readonly baseline: ModelPricingBaseline;
23
+ /**
24
+ * The base-variant governance entry (baseline vs effective rates,
25
+ * active overrides, ledger reconcilability), or `null` when the
26
+ * governance view has no entry for this key — the row then renders
27
+ * baseline rates with no governance state.
28
+ */
29
+ readonly governance: ModelPricingGovernanceEntry | null;
30
+ /** Governance entries for this model's named pricing variants. */
31
+ readonly variantGovernance: readonly ModelPricingGovernanceEntry[];
32
+ /** SUPERSEDED / RETIRED revisions, newest first as served. */
33
+ readonly history: readonly ModelPricingBaseline[];
34
+ }
35
+
36
+ /**
37
+ * Where the operator is in the console: browsing the model list,
38
+ * creating a new catalog entry, or focused on one model (viewing,
39
+ * editing, or retiring it).
40
+ */
41
+ export type GovernanceFlow =
42
+ | { readonly phase: "list" }
43
+ | { readonly phase: "create" }
44
+ | {
45
+ readonly phase: "detail";
46
+ readonly modelKey: string;
47
+ readonly mode: "view" | "edit" | "retire";
48
+ };
49
+
50
+ /** Return value of {@link useModelGovernanceView}. */
51
+ export interface UseModelGovernanceViewReturn {
52
+ /** Unified model rows, filtered by {@link modelQuery}, sorted by display name. */
53
+ readonly models: readonly ModelGovernanceRow[];
54
+ /** PENDING_SIGNOFF overrides, filtered by {@link signOffQuery}, oldest first as served. */
55
+ readonly pendingOverrides: readonly ModelPricingOverride[];
56
+ /** Unfiltered pending-override count (for the Sign-Offs tab badge). */
57
+ readonly pendingCount: number;
58
+ /** Current search text over the model list. */
59
+ readonly modelQuery: string;
60
+ /** Set the model-list search text. */
61
+ readonly setModelQuery: (query: string) => void;
62
+ /** Current search text over the sign-off queue. */
63
+ readonly signOffQuery: string;
64
+ /** Set the sign-off search text. */
65
+ readonly setSignOffQuery: (query: string) => void;
66
+ /** Current console flow state. */
67
+ readonly flow: GovernanceFlow;
68
+ /** The focused model when {@link flow} is in the detail phase, else `null`. */
69
+ readonly selected: ModelGovernanceRow | null;
70
+ /** Focus one model (read-only detail). */
71
+ readonly openDetail: (modelKey: string) => void;
72
+ /** Open the add-model editor. */
73
+ readonly openCreate: () => void;
74
+ /** Switch the focused model into the edit form. */
75
+ readonly openEdit: () => void;
76
+ /** Switch the focused model into the retire confirmation. */
77
+ readonly openRetire: () => void;
78
+ /** Leave edit/retire back to the read-only detail. */
79
+ readonly backToDetail: () => void;
80
+ /** Return to the model list. */
81
+ readonly backToList: () => void;
82
+ /** `true` while either underlying fetch is in its initial load. */
83
+ readonly isLoading: boolean;
84
+ /** First error from the underlying fetches, or `null` when healthy. */
85
+ readonly error: Error | null;
86
+ /** Re-fetch both the catalog and the governance view. */
87
+ readonly refetch: () => void;
88
+ }
89
+
90
+ /** The catalog identity key shared by both data sources. */
91
+ function modelKey(entry: {
92
+ readonly modelId: string;
93
+ readonly provider: string;
94
+ readonly harness: string;
95
+ }): string {
96
+ return `${entry.modelId}|${entry.provider}|${entry.harness}`;
97
+ }
98
+
99
+ function matchesQuery(query: string, ...fields: readonly string[]): boolean {
100
+ const q = query.trim().toLowerCase();
101
+ if (q === "") return true;
102
+ return fields.some((field) => field.toLowerCase().includes(q));
103
+ }
104
+
105
+ /**
106
+ * Behavior hook backing the pricing-governance console: joins the model
107
+ * registry baseline catalog ({@link useModelPricingBaselines}, with
108
+ * history) and the governance view ({@link usePricingGovernance}) into
109
+ * one row per catalog key, and owns the console's search and
110
+ * list/create/detail flow state.
111
+ *
112
+ * The two RPCs describe the same models from different angles — the
113
+ * catalog is what operators author, governance is what the pricing
114
+ * feedback loop composed on top — so the console renders them as one
115
+ * surface instead of two parallel tables. Per-variant governance
116
+ * entries fold into their model's row rather than appearing as
117
+ * top-level rows.
118
+ *
119
+ * Platform-operator surface: the caller needs `can_manage_model_pricing`
120
+ * on `platform:stigmer`; rates are raw provider prices (pre-markup).
121
+ *
122
+ * @example
123
+ * ```tsx
124
+ * const view = useModelGovernanceView();
125
+ * return view.models.map((row) => <ModelRow key={row.key} row={row} />);
126
+ * ```
127
+ */
128
+ export function useModelGovernanceView(): UseModelGovernanceViewReturn {
129
+ // History is always fetched so opening a detail view never triggers a
130
+ // second round-trip; the catalog is small (dozens of models) and this
131
+ // is an operator-only surface.
132
+ const baselinesFetch = useModelPricingBaselines({ includeHistory: true });
133
+ const governanceFetch = usePricingGovernance();
134
+
135
+ const [modelQuery, setModelQuery] = useState("");
136
+ const [signOffQuery, setSignOffQuery] = useState("");
137
+ const [flow, setFlow] = useState<GovernanceFlow>({ phase: "list" });
138
+
139
+ const rows = useMemo<readonly ModelGovernanceRow[]>(() => {
140
+ const baselines = baselinesFetch.baselines ?? [];
141
+ const entries = governanceFetch.governance?.entries ?? [];
142
+
143
+ const baseByKey = new Map<string, ModelPricingGovernanceEntry>();
144
+ const variantsByKey = new Map<string, ModelPricingGovernanceEntry[]>();
145
+ for (const entry of entries) {
146
+ const key = modelKey(entry);
147
+ if (entry.variant === "") {
148
+ baseByKey.set(key, entry);
149
+ } else {
150
+ variantsByKey.set(key, [...(variantsByKey.get(key) ?? []), entry]);
151
+ }
152
+ }
153
+
154
+ const historyByKey = new Map<string, ModelPricingBaseline[]>();
155
+ for (const baseline of baselines) {
156
+ if (baseline.status === ModelPricingBaselineStatus.pricing_baseline_active) continue;
157
+ const key = modelKey(baseline);
158
+ historyByKey.set(key, [...(historyByKey.get(key) ?? []), baseline]);
159
+ }
160
+
161
+ return baselines
162
+ .filter((b) => b.status === ModelPricingBaselineStatus.pricing_baseline_active)
163
+ .map((baseline) => {
164
+ const key = modelKey(baseline);
165
+ return {
166
+ key,
167
+ baseline,
168
+ governance: baseByKey.get(key) ?? null,
169
+ variantGovernance: variantsByKey.get(key) ?? [],
170
+ history: historyByKey.get(key) ?? [],
171
+ };
172
+ })
173
+ .sort((a, b) =>
174
+ (a.baseline.displayName || a.baseline.modelId).localeCompare(
175
+ b.baseline.displayName || b.baseline.modelId,
176
+ ),
177
+ );
178
+ }, [baselinesFetch.baselines, governanceFetch.governance]);
179
+
180
+ const models = useMemo(
181
+ () =>
182
+ rows.filter((row) =>
183
+ matchesQuery(
184
+ modelQuery,
185
+ row.baseline.modelId,
186
+ row.baseline.displayName,
187
+ row.baseline.provider,
188
+ row.baseline.harness,
189
+ ),
190
+ ),
191
+ [rows, modelQuery],
192
+ );
193
+
194
+ const allPending = useMemo(
195
+ () => governanceFetch.governance?.pendingOverrides ?? [],
196
+ [governanceFetch.governance],
197
+ );
198
+ const pendingOverrides = useMemo(
199
+ () =>
200
+ allPending.filter((override) =>
201
+ matchesQuery(signOffQuery, override.modelId, override.variant),
202
+ ),
203
+ [allPending, signOffQuery],
204
+ );
205
+
206
+ // Resolve the focused row fresh each render so a refetch (e.g. after an
207
+ // edit) is reflected in the open detail; a retired model resolves to
208
+ // null and the console falls back to the list.
209
+ const selected = useMemo(() => {
210
+ if (flow.phase !== "detail") return null;
211
+ return rows.find((row) => row.key === flow.modelKey) ?? null;
212
+ }, [flow, rows]);
213
+
214
+ const openDetail = useCallback(
215
+ (key: string) => setFlow({ phase: "detail", modelKey: key, mode: "view" }),
216
+ [],
217
+ );
218
+ const openCreate = useCallback(() => setFlow({ phase: "create" }), []);
219
+ const openEdit = useCallback(
220
+ () =>
221
+ setFlow((f) =>
222
+ f.phase === "detail" ? { ...f, mode: "edit" } : f,
223
+ ),
224
+ [],
225
+ );
226
+ const openRetire = useCallback(
227
+ () =>
228
+ setFlow((f) =>
229
+ f.phase === "detail" ? { ...f, mode: "retire" } : f,
230
+ ),
231
+ [],
232
+ );
233
+ const backToDetail = useCallback(
234
+ () =>
235
+ setFlow((f) =>
236
+ f.phase === "detail" ? { ...f, mode: "view" } : f,
237
+ ),
238
+ [],
239
+ );
240
+ const backToList = useCallback(() => setFlow({ phase: "list" }), []);
241
+
242
+ const refetch = useCallback(() => {
243
+ baselinesFetch.refetch();
244
+ governanceFetch.refetch();
245
+ }, [baselinesFetch.refetch, governanceFetch.refetch]);
246
+
247
+ const isLoading = baselinesFetch.isLoading || governanceFetch.isLoading;
248
+ const error = baselinesFetch.error ?? governanceFetch.error;
249
+
250
+ return useMemo(
251
+ () => ({
252
+ models,
253
+ pendingOverrides,
254
+ pendingCount: allPending.length,
255
+ modelQuery,
256
+ setModelQuery,
257
+ signOffQuery,
258
+ setSignOffQuery,
259
+ flow,
260
+ selected,
261
+ openDetail,
262
+ openCreate,
263
+ openEdit,
264
+ openRetire,
265
+ backToDetail,
266
+ backToList,
267
+ isLoading,
268
+ error,
269
+ refetch,
270
+ }),
271
+ [
272
+ models,
273
+ pendingOverrides,
274
+ allPending.length,
275
+ modelQuery,
276
+ signOffQuery,
277
+ flow,
278
+ selected,
279
+ openDetail,
280
+ openCreate,
281
+ openEdit,
282
+ openRetire,
283
+ backToDetail,
284
+ backToList,
285
+ isLoading,
286
+ error,
287
+ refetch,
288
+ ],
289
+ );
290
+ }
@@ -0,0 +1,69 @@
1
+ "use client";
2
+
3
+ import type {
4
+ ModelPricingBaseline,
5
+ } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
6
+ import { useStigmer } from "../hooks.js";
7
+ import { useFetch } from "../internal/useFetch.js";
8
+
9
+ /** Options for {@link useModelPricingBaselines}. */
10
+ export interface UseModelPricingBaselinesOptions {
11
+ /**
12
+ * When `true`, includes SUPERSEDED and RETIRED revisions (the full
13
+ * append-only audit history). Default: ACTIVE entries only.
14
+ */
15
+ readonly includeHistory?: boolean;
16
+ /** Pass `false` to skip fetching (stable no-op). */
17
+ readonly enabled?: boolean;
18
+ }
19
+
20
+ /** Return value of {@link useModelPricingBaselines}. */
21
+ export interface UseModelPricingBaselinesReturn {
22
+ /** The catalog entries, or `null` before the first successful fetch. */
23
+ readonly baselines: readonly ModelPricingBaseline[] | null;
24
+ /** `true` while the initial fetch is in flight. */
25
+ readonly isLoading: boolean;
26
+ /** `true` while a background refetch is in flight and stale data is shown. */
27
+ readonly isRefetching: boolean;
28
+ /** Error from the last failed request, or `null` when healthy. */
29
+ readonly error: Error | null;
30
+ /** Discard cached data and re-fetch from the server. */
31
+ readonly refetch: () => void;
32
+ }
33
+
34
+ /**
35
+ * Data hook that fetches the model registry baseline catalog: the
36
+ * operator-governed catalog entries and list prices that (composed with
37
+ * any ledger-derived overrides) form the effective registry.
38
+ *
39
+ * Platform-operator surface: the caller needs `can_manage_model_pricing`
40
+ * on `platform:stigmer`, and the rates are raw provider prices
41
+ * (pre-markup) — never render them as customer prices.
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * const { baselines, isLoading, refetch } = useModelPricingBaselines();
46
+ * ```
47
+ */
48
+ export function useModelPricingBaselines(
49
+ options?: UseModelPricingBaselinesOptions,
50
+ ): UseModelPricingBaselinesReturn {
51
+ const stigmer = useStigmer();
52
+ const enabled = options?.enabled ?? true;
53
+ const includeHistory = options?.includeHistory ?? false;
54
+
55
+ const { data, isLoading, isRefetching, error, refetch } = useFetch(
56
+ enabled
57
+ ? async () => {
58
+ const response = await stigmer.billing.listModelPricingBaselines({
59
+ includeHistory,
60
+ });
61
+ return response.baselines;
62
+ }
63
+ : null,
64
+ [enabled, includeHistory, stigmer],
65
+ null as readonly ModelPricingBaseline[] | null,
66
+ );
67
+
68
+ return { baselines: data, isLoading, isRefetching, error, refetch };
69
+ }
@@ -0,0 +1,57 @@
1
+ "use client";
2
+
3
+ import type {
4
+ ModelPricingGovernanceResponse,
5
+ } from "@stigmer/protos/ai/stigmer/billing/v1/io_pb";
6
+ import { useStigmer } from "../hooks.js";
7
+ import { useFetch } from "../internal/useFetch.js";
8
+
9
+ /** Return value of {@link usePricingGovernance}. */
10
+ export interface UsePricingGovernanceReturn {
11
+ /** The governance view, or `null` before the first successful fetch. */
12
+ readonly governance: ModelPricingGovernanceResponse | null;
13
+ /** `true` while the initial fetch is in flight. */
14
+ readonly isLoading: boolean;
15
+ /** `true` while a background refetch is in flight and stale data is shown. */
16
+ readonly isRefetching: boolean;
17
+ /** Error from the last failed request, or `null` when healthy. */
18
+ readonly error: Error | null;
19
+ /** Discard cached data and re-fetch from the server. */
20
+ readonly refetch: () => void;
21
+ }
22
+
23
+ /**
24
+ * Data hook that fetches the platform pricing governance view: every
25
+ * model's baseline vs effective rates, the ACTIVE pricing overrides
26
+ * composed into them (with full ledger provenance), and the
27
+ * PENDING_SIGNOFF proposals awaiting an operator decision.
28
+ *
29
+ * Platform-operator surface: the caller needs `can_manage_model_pricing`
30
+ * on `platform:stigmer`, and the rates are raw provider prices
31
+ * (pre-markup) — never render them as customer prices.
32
+ *
33
+ * Pass `enabled: false` to skip fetching (stable no-op) — e.g. while the
34
+ * caller's operator capability is still resolving.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * const { governance, isLoading, refetch } = usePricingGovernance();
39
+ *
40
+ * if (isLoading) return <Skeleton />;
41
+ * return <PricingGovernancePanel />;
42
+ * ```
43
+ */
44
+ export function usePricingGovernance(
45
+ options?: { readonly enabled?: boolean },
46
+ ): UsePricingGovernanceReturn {
47
+ const stigmer = useStigmer();
48
+ const enabled = options?.enabled ?? true;
49
+
50
+ const { data: governance, isLoading, isRefetching, error, refetch } = useFetch(
51
+ enabled ? () => stigmer.billing.getModelPricingGovernance() : null,
52
+ [enabled, stigmer],
53
+ null as ModelPricingGovernanceResponse | null,
54
+ );
55
+
56
+ return { governance, isLoading, isRefetching, error, refetch };
57
+ }
@@ -0,0 +1,65 @@
1
+ "use client";
2
+
3
+ import { useCallback, useState } from "react";
4
+ import type {
5
+ ModelPricingBaseline,
6
+ } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
7
+ import { useStigmer } from "../hooks.js";
8
+ import { toError } from "../internal/toError.js";
9
+
10
+ /** Input for {@link useRetireModelPricingBaseline}. */
11
+ export interface RetireModelPricingBaselineInput {
12
+ readonly modelId: string;
13
+ readonly provider: string;
14
+ readonly harness: string;
15
+ /** Optional operator note recorded on the retirement. */
16
+ readonly revisionNote?: string;
17
+ }
18
+
19
+ /** Return value of {@link useRetireModelPricingBaseline}. */
20
+ export interface UseRetireModelPricingBaselineReturn {
21
+ /** Retire a model from the catalog. Returns the RETIRED document. */
22
+ readonly retire: (input: RetireModelPricingBaselineInput) => Promise<ModelPricingBaseline>;
23
+ /** `true` while a retirement is being recorded. */
24
+ readonly isSubmitting: boolean;
25
+ /** Error from the last failed attempt, or `null` when healthy. */
26
+ readonly error: Error | null;
27
+ /** Reset `error` to `null`. */
28
+ readonly clearError: () => void;
29
+ }
30
+
31
+ /**
32
+ * Behavior hook for retiring models from the registry catalog.
33
+ *
34
+ * Wraps `billing.retireModelPricingBaseline` with loading and error
35
+ * state. Retirement removes the model from every price surface on the
36
+ * next composition pass; the document is kept for audit and the key can
37
+ * be revived by a subsequent upsert. The parent should refetch its
38
+ * catalog view after a successful retirement.
39
+ */
40
+ export function useRetireModelPricingBaseline(): UseRetireModelPricingBaselineReturn {
41
+ const stigmer = useStigmer();
42
+ const [isSubmitting, setIsSubmitting] = useState(false);
43
+ const [error, setError] = useState<Error | null>(null);
44
+
45
+ const retire = useCallback(
46
+ async (input: RetireModelPricingBaselineInput): Promise<ModelPricingBaseline> => {
47
+ setIsSubmitting(true);
48
+ setError(null);
49
+ try {
50
+ return await stigmer.billing.retireModelPricingBaseline(input);
51
+ } catch (e) {
52
+ const err = toError(e);
53
+ setError(err);
54
+ throw err;
55
+ } finally {
56
+ setIsSubmitting(false);
57
+ }
58
+ },
59
+ [stigmer.billing],
60
+ );
61
+
62
+ const clearError = useCallback(() => setError(null), []);
63
+
64
+ return { retire, isSubmitting, error, clearError };
65
+ }
@@ -0,0 +1,72 @@
1
+ "use client";
2
+
3
+ import { useCallback, useState } from "react";
4
+ import type {
5
+ ModelPricingBaseline,
6
+ } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
7
+ import { useStigmer } from "../hooks.js";
8
+ import { toError } from "../internal/toError.js";
9
+
10
+ /** Input for {@link useUpsertModelPricingBaseline}. */
11
+ export interface UpsertModelPricingBaselineInput {
12
+ /**
13
+ * The baseline entry to create or revise, keyed by
14
+ * (modelId, provider, harness). Lifecycle fields (baselineId, status,
15
+ * decision stamps, pricing effectiveAt) are server-owned and ignored.
16
+ */
17
+ readonly baseline: ModelPricingBaseline;
18
+ /** Optional operator note recorded on the revision for the audit trail. */
19
+ readonly revisionNote?: string;
20
+ }
21
+
22
+ /** Return value of {@link useUpsertModelPricingBaseline}. */
23
+ export interface UseUpsertModelPricingBaselineReturn {
24
+ /**
25
+ * Create or revise a baseline entry. Returns the new revision with
26
+ * server-stamped lifecycle fields.
27
+ */
28
+ readonly upsert: (input: UpsertModelPricingBaselineInput) => Promise<ModelPricingBaseline>;
29
+ /** `true` while a revision is being written. */
30
+ readonly isSubmitting: boolean;
31
+ /** Error from the last failed attempt, or `null` when healthy. */
32
+ readonly error: Error | null;
33
+ /** Reset `error` to `null`. */
34
+ readonly clearError: () => void;
35
+ }
36
+
37
+ /**
38
+ * Behavior hook for creating or revising model registry baseline entries.
39
+ *
40
+ * Wraps `billing.upsertModelPricingBaseline` with loading and error
41
+ * state. The platform recomposes the effective registry immediately, so
42
+ * the parent should refetch its catalog view after a successful upsert.
43
+ *
44
+ * A concurrent-edit conflict surfaces as an ABORTED error telling the
45
+ * operator to reload and re-apply — render it, don't retry silently.
46
+ */
47
+ export function useUpsertModelPricingBaseline(): UseUpsertModelPricingBaselineReturn {
48
+ const stigmer = useStigmer();
49
+ const [isSubmitting, setIsSubmitting] = useState(false);
50
+ const [error, setError] = useState<Error | null>(null);
51
+
52
+ const upsert = useCallback(
53
+ async (input: UpsertModelPricingBaselineInput): Promise<ModelPricingBaseline> => {
54
+ setIsSubmitting(true);
55
+ setError(null);
56
+ try {
57
+ return await stigmer.billing.upsertModelPricingBaseline(input);
58
+ } catch (e) {
59
+ const err = toError(e);
60
+ setError(err);
61
+ throw err;
62
+ } finally {
63
+ setIsSubmitting(false);
64
+ }
65
+ },
66
+ [stigmer.billing],
67
+ );
68
+
69
+ const clearError = useCallback(() => setError(null), []);
70
+
71
+ return { upsert, isSubmitting, error, clearError };
72
+ }
@@ -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
@@ -193,6 +193,100 @@ describe("useCreateSession", () => {
193
193
  expect(callArg.executionTarget).toBeUndefined();
194
194
  });
195
195
 
196
+ describe("session metadata and sessionContext", () => {
197
+ it("passes the metadata map through to stigmer.session.create()", async () => {
198
+ const create = vi.fn().mockResolvedValue({ metadata: { id: "ses-md" } });
199
+ const client = createMockStigmer({ create });
200
+
201
+ const { result } = renderHook(() => useCreateSession(), {
202
+ wrapper: wrapper(client),
203
+ });
204
+
205
+ await act(async () => {
206
+ await result.current.create({
207
+ org: "acme",
208
+ agentInstanceId: "ain-123",
209
+ metadata: { "acme/tenant": "t-1" },
210
+ });
211
+ });
212
+
213
+ expect(create).toHaveBeenCalledWith(
214
+ expect.objectContaining({
215
+ metadata: { "acme/tenant": "t-1" },
216
+ }),
217
+ );
218
+ });
219
+
220
+ it("maps the typed sessionContext onto the reserved metadata key", async () => {
221
+ const create = vi.fn().mockResolvedValue({ metadata: { id: "ses-sc" } });
222
+ const client = createMockStigmer({ create });
223
+
224
+ const { result } = renderHook(() => useCreateSession(), {
225
+ wrapper: wrapper(client),
226
+ });
227
+
228
+ await act(async () => {
229
+ await result.current.create({
230
+ org: "acme",
231
+ agentInstanceId: "ain-123",
232
+ sessionContext: "Role: platform admin",
233
+ });
234
+ });
235
+
236
+ expect(create).toHaveBeenCalledWith(
237
+ expect.objectContaining({
238
+ metadata: { "stigmer.ai/session-context": "Role: platform admin" },
239
+ }),
240
+ );
241
+ });
242
+
243
+ it("lets the typed sessionContext win over a raw entry under the reserved key", async () => {
244
+ const create = vi.fn().mockResolvedValue({ metadata: { id: "ses-both" } });
245
+ const client = createMockStigmer({ create });
246
+
247
+ const { result } = renderHook(() => useCreateSession(), {
248
+ wrapper: wrapper(client),
249
+ });
250
+
251
+ await act(async () => {
252
+ await result.current.create({
253
+ org: "acme",
254
+ agentInstanceId: "ain-123",
255
+ metadata: {
256
+ "acme/tenant": "t-1",
257
+ "stigmer.ai/session-context": "stale raw value",
258
+ },
259
+ sessionContext: "typed value",
260
+ });
261
+ });
262
+
263
+ expect(create).toHaveBeenCalledWith(
264
+ expect.objectContaining({
265
+ metadata: {
266
+ "acme/tenant": "t-1",
267
+ "stigmer.ai/session-context": "typed value",
268
+ },
269
+ }),
270
+ );
271
+ });
272
+
273
+ it("omits metadata entirely when neither field is provided", async () => {
274
+ const create = vi.fn().mockResolvedValue({ metadata: { id: "ses-none" } });
275
+ const client = createMockStigmer({ create });
276
+
277
+ const { result } = renderHook(() => useCreateSession(), {
278
+ wrapper: wrapper(client),
279
+ });
280
+
281
+ await act(async () => {
282
+ await result.current.create({ org: "acme", agentInstanceId: "ain-123" });
283
+ });
284
+
285
+ const callArg = create.mock.calls[0][0];
286
+ expect(callArg.metadata).toBeUndefined();
287
+ });
288
+ });
289
+
196
290
  it("clearError resets the error state", async () => {
197
291
  const create = vi.fn().mockRejectedValue(new Error("fail"));
198
292
  const client = createMockStigmer({ create });