@stigmer/react 3.3.0 → 3.4.1

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 (344) hide show
  1. package/agent/useAgentCount.d.ts +2 -0
  2. package/agent/useAgentCount.d.ts.map +1 -1
  3. package/agent/useAgentCount.js.map +1 -1
  4. package/api-key/CreateApiKeyForm.d.ts +7 -1
  5. package/api-key/CreateApiKeyForm.d.ts.map +1 -1
  6. package/api-key/CreateApiKeyForm.js +2 -2
  7. package/api-key/CreateApiKeyForm.js.map +1 -1
  8. package/billing/index.d.ts +0 -18
  9. package/billing/index.d.ts.map +1 -1
  10. package/billing/index.js +4 -9
  11. package/billing/index.js.map +1 -1
  12. package/cursor-accounts/CursorAccountEditor.d.ts +7 -1
  13. package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -1
  14. package/cursor-accounts/CursorAccountEditor.js +21 -5
  15. package/cursor-accounts/CursorAccountEditor.js.map +1 -1
  16. package/cursor-accounts/CursorAccountsConsole.d.ts +9 -5
  17. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
  18. package/cursor-accounts/CursorAccountsConsole.js +34 -140
  19. package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
  20. package/cursor-accounts/MemberCoverageTable.d.ts +29 -0
  21. package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -0
  22. package/cursor-accounts/MemberCoverageTable.js +150 -0
  23. package/cursor-accounts/MemberCoverageTable.js.map +1 -0
  24. package/cursor-accounts/MemberKeysPanel.d.ts +25 -0
  25. package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -0
  26. package/cursor-accounts/MemberKeysPanel.js +115 -0
  27. package/cursor-accounts/MemberKeysPanel.js.map +1 -0
  28. package/cursor-accounts/badges.d.ts +9 -0
  29. package/cursor-accounts/badges.d.ts.map +1 -0
  30. package/cursor-accounts/badges.js +10 -0
  31. package/cursor-accounts/badges.js.map +1 -0
  32. package/cursor-accounts/cursor-account-coverage.d.ts +41 -0
  33. package/cursor-accounts/cursor-account-coverage.d.ts.map +1 -0
  34. package/cursor-accounts/cursor-account-coverage.js +26 -0
  35. package/cursor-accounts/cursor-account-coverage.js.map +1 -0
  36. package/cursor-accounts/cursor-account-format.d.ts +13 -0
  37. package/cursor-accounts/cursor-account-format.d.ts.map +1 -1
  38. package/cursor-accounts/cursor-account-format.js +16 -1
  39. package/cursor-accounts/cursor-account-format.js.map +1 -1
  40. package/datastore/CollectionRecordsBrowser.js +18 -4
  41. package/datastore/CollectionRecordsBrowser.js.map +1 -1
  42. package/datastore/RecordFilterBuilder.d.ts +8 -1
  43. package/datastore/RecordFilterBuilder.d.ts.map +1 -1
  44. package/datastore/RecordFilterBuilder.js +2 -2
  45. package/datastore/RecordFilterBuilder.js.map +1 -1
  46. package/datastore/recordFilter.d.ts +9 -1
  47. package/datastore/recordFilter.d.ts.map +1 -1
  48. package/datastore/recordFilter.js +12 -1
  49. package/datastore/recordFilter.js.map +1 -1
  50. package/datastore/useDatastoreCount.d.ts +2 -0
  51. package/datastore/useDatastoreCount.d.ts.map +1 -1
  52. package/datastore/useDatastoreCount.js.map +1 -1
  53. package/execution/ExecutionProgress.d.ts.map +1 -1
  54. package/execution/ExecutionProgress.js +13 -4
  55. package/execution/ExecutionProgress.js.map +1 -1
  56. package/execution/MessageThread.d.ts.map +1 -1
  57. package/execution/MessageThread.js +10 -2
  58. package/execution/MessageThread.js.map +1 -1
  59. package/execution/useCreateAgentExecution.d.ts +31 -1
  60. package/execution/useCreateAgentExecution.d.ts.map +1 -1
  61. package/execution/useCreateAgentExecution.js +2 -0
  62. package/execution/useCreateAgentExecution.js.map +1 -1
  63. package/index.d.ts +8 -6
  64. package/index.d.ts.map +1 -1
  65. package/index.js +8 -4
  66. package/index.js.map +1 -1
  67. package/internal/form-primitives.d.ts +10 -0
  68. package/internal/form-primitives.d.ts.map +1 -0
  69. package/{billing → internal}/form-primitives.js +5 -9
  70. package/internal/form-primitives.js.map +1 -0
  71. package/manifest/ApplyManifestDialog.d.ts +10 -5
  72. package/manifest/ApplyManifestDialog.d.ts.map +1 -1
  73. package/manifest/ApplyManifestDialog.js +30 -13
  74. package/manifest/ApplyManifestDialog.js.map +1 -1
  75. package/manifest/useApplyManifest.d.ts +6 -2
  76. package/manifest/useApplyManifest.d.ts.map +1 -1
  77. package/manifest/useApplyManifest.js +5 -5
  78. package/manifest/useApplyManifest.js.map +1 -1
  79. package/mcp-server/McpServerDetailView.d.ts +38 -2
  80. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  81. package/mcp-server/McpServerDetailView.js +21 -5
  82. package/mcp-server/McpServerDetailView.js.map +1 -1
  83. package/mcp-server/index.d.ts +7 -0
  84. package/mcp-server/index.d.ts.map +1 -1
  85. package/mcp-server/index.js +9 -0
  86. package/mcp-server/index.js.map +1 -1
  87. package/mcp-server/steps/EnvironmentAuthStep.d.ts +4 -0
  88. package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -1
  89. package/mcp-server/steps/EnvironmentAuthStep.js +4 -0
  90. package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -1
  91. package/mcp-server/steps/IdentityTransportStep.d.ts +6 -0
  92. package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -1
  93. package/mcp-server/steps/IdentityTransportStep.js +7 -1
  94. package/mcp-server/steps/IdentityTransportStep.js.map +1 -1
  95. package/mcp-server/steps/ReviewStep.d.ts +5 -0
  96. package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
  97. package/mcp-server/steps/ReviewStep.js +16 -2
  98. package/mcp-server/steps/ReviewStep.js.map +1 -1
  99. package/mcp-server/useMcpServerCount.d.ts +2 -0
  100. package/mcp-server/useMcpServerCount.d.ts.map +1 -1
  101. package/mcp-server/useMcpServerCount.js.map +1 -1
  102. package/package.json +4 -4
  103. package/pricing-governance/BaselineEditor.d.ts.map +1 -0
  104. package/{billing → pricing-governance}/BaselineEditor.js +19 -2
  105. package/pricing-governance/BaselineEditor.js.map +1 -0
  106. package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
  107. package/pricing-governance/ModelCatalogPanel.js.map +1 -0
  108. package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
  109. package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
  110. package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
  111. package/pricing-governance/OperatorAccessNotice.js.map +1 -0
  112. package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
  113. package/{billing → pricing-governance}/PricingGovernanceConsole.js +1 -1
  114. package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
  115. package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
  116. package/pricing-governance/PricingGovernancePanel.js.map +1 -0
  117. package/pricing-governance/RetireConfirm.d.ts.map +1 -0
  118. package/{billing → pricing-governance}/RetireConfirm.js +1 -1
  119. package/pricing-governance/RetireConfirm.js.map +1 -0
  120. package/pricing-governance/governance-primitives.d.ts.map +1 -0
  121. package/pricing-governance/governance-primitives.js.map +1 -0
  122. package/pricing-governance/index.d.ts +19 -0
  123. package/pricing-governance/index.d.ts.map +1 -0
  124. package/pricing-governance/index.js +20 -0
  125. package/pricing-governance/index.js.map +1 -0
  126. package/pricing-governance/pricing-format.d.ts.map +1 -0
  127. package/pricing-governance/pricing-format.js.map +1 -0
  128. package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
  129. package/pricing-governance/useDecidePricingOverride.js.map +1 -0
  130. package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
  131. package/pricing-governance/useModelGovernanceView.js.map +1 -0
  132. package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
  133. package/pricing-governance/useModelPricingBaselines.js.map +1 -0
  134. package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
  135. package/pricing-governance/usePricingGovernance.js.map +1 -0
  136. package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
  137. package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
  138. package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
  139. package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
  140. package/resource-creation/CreationPicker.d.ts.map +1 -1
  141. package/resource-creation/CreationPicker.js +3 -3
  142. package/resource-creation/CreationPicker.js.map +1 -1
  143. package/resource-creation/WizardNav.d.ts.map +1 -1
  144. package/resource-creation/WizardNav.js +1 -1
  145. package/resource-creation/WizardNav.js.map +1 -1
  146. package/resource-detail/Section.d.ts +8 -1
  147. package/resource-detail/Section.d.ts.map +1 -1
  148. package/resource-detail/Section.js +2 -2
  149. package/resource-detail/Section.js.map +1 -1
  150. package/resource-workbench/components/ResourceWorkbench.d.ts +9 -1
  151. package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -1
  152. package/resource-workbench/components/ResourceWorkbench.js +2 -1
  153. package/resource-workbench/components/ResourceWorkbench.js.map +1 -1
  154. package/resource-workbench/hooks/useResourceCollection.d.ts +9 -0
  155. package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -1
  156. package/resource-workbench/hooks/useResourceCollection.js +2 -2
  157. package/resource-workbench/hooks/useResourceCollection.js.map +1 -1
  158. package/search/useResourceCount.d.ts +7 -0
  159. package/search/useResourceCount.d.ts.map +1 -1
  160. package/search/useResourceCount.js +2 -1
  161. package/search/useResourceCount.js.map +1 -1
  162. package/session/NewSessionViewer.d.ts.map +1 -1
  163. package/session/NewSessionViewer.js +17 -3
  164. package/session/NewSessionViewer.js.map +1 -1
  165. package/session/SessionViewer.d.ts +2 -1
  166. package/session/SessionViewer.d.ts.map +1 -1
  167. package/session/SessionViewer.js +19 -11
  168. package/session/SessionViewer.js.map +1 -1
  169. package/session/SessionViewerLayout.d.ts +90 -0
  170. package/session/SessionViewerLayout.d.ts.map +1 -0
  171. package/session/SessionViewerLayout.js +32 -0
  172. package/session/SessionViewerLayout.js.map +1 -0
  173. package/session/index.d.ts +4 -0
  174. package/session/index.d.ts.map +1 -1
  175. package/session/index.js +10 -0
  176. package/session/index.js.map +1 -1
  177. package/session/useCreateSession.d.ts +28 -0
  178. package/session/useCreateSession.d.ts.map +1 -1
  179. package/session/useCreateSession.js +2 -1
  180. package/session/useCreateSession.js.map +1 -1
  181. package/session/useNewSessionFlow.d.ts +30 -0
  182. package/session/useNewSessionFlow.d.ts.map +1 -1
  183. package/session/useNewSessionFlow.js +7 -1
  184. package/session/useNewSessionFlow.js.map +1 -1
  185. package/session/useSessionRailViews.d.ts +2 -2
  186. package/session/useUpdateSession.d.ts +29 -10
  187. package/session/useUpdateSession.d.ts.map +1 -1
  188. package/session/useUpdateSession.js +29 -10
  189. package/session/useUpdateSession.js.map +1 -1
  190. package/skill/useSkillCount.d.ts +2 -0
  191. package/skill/useSkillCount.d.ts.map +1 -1
  192. package/skill/useSkillCount.js.map +1 -1
  193. package/src/agent/useAgentCount.ts +2 -0
  194. package/src/api-key/CreateApiKeyForm.tsx +8 -1
  195. package/src/api-key/__tests__/CreateApiKeyForm.test.tsx +58 -0
  196. package/src/billing/index.ts +5 -37
  197. package/src/cursor-accounts/CursorAccountEditor.tsx +61 -13
  198. package/src/cursor-accounts/CursorAccountsConsole.tsx +44 -400
  199. package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
  200. package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
  201. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +306 -10
  202. package/src/cursor-accounts/__tests__/cursor-account-coverage.test.ts +73 -0
  203. package/src/cursor-accounts/badges.tsx +26 -0
  204. package/src/cursor-accounts/cursor-account-coverage.ts +71 -0
  205. package/src/cursor-accounts/cursor-account-format.ts +17 -1
  206. package/src/datastore/CollectionRecordsBrowser.tsx +29 -3
  207. package/src/datastore/RecordFilterBuilder.tsx +12 -1
  208. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +38 -0
  209. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +14 -0
  210. package/src/datastore/__tests__/recordFilter.test.ts +13 -0
  211. package/src/datastore/recordFilter.ts +15 -1
  212. package/src/datastore/useDatastoreCount.ts +2 -0
  213. package/src/execution/ExecutionProgress.tsx +14 -4
  214. package/src/execution/MessageThread.tsx +10 -2
  215. package/src/execution/__tests__/ExecutionProgress.test.tsx +67 -0
  216. package/src/execution/__tests__/MessageThread.test.tsx +44 -0
  217. package/src/execution/__tests__/useCreateAgentExecution.test.tsx +86 -0
  218. package/src/execution/useCreateAgentExecution.ts +41 -6
  219. package/src/index.ts +43 -24
  220. package/src/{billing → internal}/form-primitives.tsx +4 -32
  221. package/src/manifest/ApplyManifestDialog.tsx +40 -16
  222. package/src/manifest/__tests__/ApplyManifestDialog.test.tsx +147 -0
  223. package/src/manifest/__tests__/useApplyManifest.test.tsx +6 -6
  224. package/src/manifest/useApplyManifest.ts +12 -8
  225. package/src/mcp-server/McpServerDetailView.tsx +52 -4
  226. package/src/mcp-server/__tests__/McpServerDetailView.test.tsx +345 -0
  227. package/src/mcp-server/index.ts +13 -0
  228. package/src/mcp-server/steps/EnvironmentAuthStep.tsx +4 -0
  229. package/src/mcp-server/steps/IdentityTransportStep.tsx +9 -1
  230. package/src/mcp-server/steps/ReviewStep.tsx +18 -1
  231. package/src/mcp-server/useMcpServerCount.ts +2 -0
  232. package/src/{billing → pricing-governance}/BaselineEditor.tsx +36 -3
  233. package/src/{billing → pricing-governance}/PricingGovernanceConsole.tsx +1 -1
  234. package/src/{billing → pricing-governance}/RetireConfirm.tsx +1 -1
  235. package/src/pricing-governance/index.ts +50 -0
  236. package/src/resource-creation/CreationPicker.tsx +7 -0
  237. package/src/resource-creation/WizardNav.tsx +1 -0
  238. package/src/resource-detail/Section.tsx +9 -1
  239. package/src/resource-workbench/components/ResourceWorkbench.tsx +13 -0
  240. package/src/resource-workbench/hooks/useResourceCollection.ts +11 -1
  241. package/src/search/useResourceCount.ts +9 -1
  242. package/src/session/NewSessionViewer.tsx +48 -61
  243. package/src/session/SessionViewer.tsx +71 -86
  244. package/src/session/SessionViewerLayout.tsx +131 -0
  245. package/src/session/__tests__/SessionViewerLayout.test.tsx +140 -0
  246. package/src/session/__tests__/useCreateSession.test.tsx +94 -0
  247. package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
  248. package/src/session/index.ts +14 -0
  249. package/src/session/useCreateSession.ts +30 -0
  250. package/src/session/useNewSessionFlow.ts +45 -1
  251. package/src/session/useSessionRailViews.tsx +2 -2
  252. package/src/session/useUpdateSession.ts +29 -10
  253. package/src/skill/useSkillCount.ts +2 -0
  254. package/src/test/__tests__/samples.test.ts +159 -2
  255. package/src/test/index.ts +1 -1
  256. package/src/test/samples.ts +109 -14
  257. package/src/workflow/useWorkflowCount.ts +2 -0
  258. package/styles.css +1 -1
  259. package/test/index.d.ts +1 -1
  260. package/test/index.d.ts.map +1 -1
  261. package/test/index.js +1 -1
  262. package/test/index.js.map +1 -1
  263. package/test/samples.d.ts +79 -7
  264. package/test/samples.d.ts.map +1 -1
  265. package/test/samples.js +101 -14
  266. package/test/samples.js.map +1 -1
  267. package/workflow/useWorkflowCount.d.ts +2 -0
  268. package/workflow/useWorkflowCount.d.ts.map +1 -1
  269. package/workflow/useWorkflowCount.js.map +1 -1
  270. package/billing/BaselineEditor.d.ts.map +0 -1
  271. package/billing/BaselineEditor.js.map +0 -1
  272. package/billing/ModelCatalogPanel.d.ts.map +0 -1
  273. package/billing/ModelCatalogPanel.js.map +0 -1
  274. package/billing/ModelGovernanceDetail.d.ts.map +0 -1
  275. package/billing/ModelGovernanceDetail.js.map +0 -1
  276. package/billing/OperatorAccessNotice.d.ts.map +0 -1
  277. package/billing/OperatorAccessNotice.js.map +0 -1
  278. package/billing/PricingGovernanceConsole.d.ts.map +0 -1
  279. package/billing/PricingGovernanceConsole.js.map +0 -1
  280. package/billing/PricingGovernancePanel.d.ts.map +0 -1
  281. package/billing/PricingGovernancePanel.js.map +0 -1
  282. package/billing/RetireConfirm.d.ts.map +0 -1
  283. package/billing/RetireConfirm.js.map +0 -1
  284. package/billing/form-primitives.d.ts +0 -18
  285. package/billing/form-primitives.d.ts.map +0 -1
  286. package/billing/form-primitives.js.map +0 -1
  287. package/billing/governance-primitives.d.ts.map +0 -1
  288. package/billing/governance-primitives.js.map +0 -1
  289. package/billing/pricing-format.d.ts.map +0 -1
  290. package/billing/pricing-format.js.map +0 -1
  291. package/billing/useDecidePricingOverride.d.ts.map +0 -1
  292. package/billing/useDecidePricingOverride.js.map +0 -1
  293. package/billing/useModelGovernanceView.d.ts.map +0 -1
  294. package/billing/useModelGovernanceView.js.map +0 -1
  295. package/billing/useModelPricingBaselines.d.ts.map +0 -1
  296. package/billing/useModelPricingBaselines.js.map +0 -1
  297. package/billing/usePricingGovernance.d.ts.map +0 -1
  298. package/billing/usePricingGovernance.js.map +0 -1
  299. package/billing/useRetireModelPricingBaseline.d.ts.map +0 -1
  300. package/billing/useRetireModelPricingBaseline.js.map +0 -1
  301. package/billing/useUpsertModelPricingBaseline.d.ts.map +0 -1
  302. package/billing/useUpsertModelPricingBaseline.js.map +0 -1
  303. /package/{billing → pricing-governance}/BaselineEditor.d.ts +0 -0
  304. /package/{billing → pricing-governance}/ModelCatalogPanel.d.ts +0 -0
  305. /package/{billing → pricing-governance}/ModelCatalogPanel.js +0 -0
  306. /package/{billing → pricing-governance}/ModelGovernanceDetail.d.ts +0 -0
  307. /package/{billing → pricing-governance}/ModelGovernanceDetail.js +0 -0
  308. /package/{billing → pricing-governance}/OperatorAccessNotice.d.ts +0 -0
  309. /package/{billing → pricing-governance}/OperatorAccessNotice.js +0 -0
  310. /package/{billing → pricing-governance}/PricingGovernanceConsole.d.ts +0 -0
  311. /package/{billing → pricing-governance}/PricingGovernancePanel.d.ts +0 -0
  312. /package/{billing → pricing-governance}/PricingGovernancePanel.js +0 -0
  313. /package/{billing → pricing-governance}/RetireConfirm.d.ts +0 -0
  314. /package/{billing → pricing-governance}/governance-primitives.d.ts +0 -0
  315. /package/{billing → pricing-governance}/governance-primitives.js +0 -0
  316. /package/{billing → pricing-governance}/pricing-format.d.ts +0 -0
  317. /package/{billing → pricing-governance}/pricing-format.js +0 -0
  318. /package/{billing → pricing-governance}/useDecidePricingOverride.d.ts +0 -0
  319. /package/{billing → pricing-governance}/useDecidePricingOverride.js +0 -0
  320. /package/{billing → pricing-governance}/useModelGovernanceView.d.ts +0 -0
  321. /package/{billing → pricing-governance}/useModelGovernanceView.js +0 -0
  322. /package/{billing → pricing-governance}/useModelPricingBaselines.d.ts +0 -0
  323. /package/{billing → pricing-governance}/useModelPricingBaselines.js +0 -0
  324. /package/{billing → pricing-governance}/usePricingGovernance.d.ts +0 -0
  325. /package/{billing → pricing-governance}/usePricingGovernance.js +0 -0
  326. /package/{billing → pricing-governance}/useRetireModelPricingBaseline.d.ts +0 -0
  327. /package/{billing → pricing-governance}/useRetireModelPricingBaseline.js +0 -0
  328. /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.d.ts +0 -0
  329. /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.js +0 -0
  330. /package/src/{billing → pricing-governance}/ModelCatalogPanel.tsx +0 -0
  331. /package/src/{billing → pricing-governance}/ModelGovernanceDetail.tsx +0 -0
  332. /package/src/{billing → pricing-governance}/OperatorAccessNotice.tsx +0 -0
  333. /package/src/{billing → pricing-governance}/PricingGovernancePanel.tsx +0 -0
  334. /package/src/{billing → pricing-governance}/__tests__/ModelCatalogPanel.test.tsx +0 -0
  335. /package/src/{billing → pricing-governance}/__tests__/PricingGovernanceConsole.test.tsx +0 -0
  336. /package/src/{billing → pricing-governance}/__tests__/useModelGovernanceView.test.tsx +0 -0
  337. /package/src/{billing → pricing-governance}/governance-primitives.tsx +0 -0
  338. /package/src/{billing → pricing-governance}/pricing-format.ts +0 -0
  339. /package/src/{billing → pricing-governance}/useDecidePricingOverride.ts +0 -0
  340. /package/src/{billing → pricing-governance}/useModelGovernanceView.ts +0 -0
  341. /package/src/{billing → pricing-governance}/useModelPricingBaselines.ts +0 -0
  342. /package/src/{billing → pricing-governance}/usePricingGovernance.ts +0 -0
  343. /package/src/{billing → pricing-governance}/useRetireModelPricingBaseline.ts +0 -0
  344. /package/src/{billing → pricing-governance}/useUpsertModelPricingBaseline.ts +0 -0
@@ -4,17 +4,14 @@ import { useCallback, useState } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
5
  import { getUserMessage, isPermissionDenied } from "@stigmer/sdk";
6
6
  import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
7
- import {
8
- CursorMemberKeyState,
9
- type CursorAccountSummary,
10
- type CursorMemberKeyView,
11
- } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
7
+ import type { CursorAccountSummary } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
12
8
  import { Button } from "../button/index.js";
13
- import { INPUT_CLASSES } from "../billing/form-primitives.js";
14
- import { toError } from "../internal/toError.js";
9
+ import { StateBadge } from "./badges.js";
15
10
  import { CursorAccountEditor } from "./CursorAccountEditor.js";
16
11
  import { CursorAccountsAccessNotice } from "./CursorAccountsAccessNotice.js";
17
- import { formatSpendMicros, formatSyncTime } from "./cursor-account-format.js";
12
+ import { deriveCoverage } from "./cursor-account-coverage.js";
13
+ import { formatSyncTime } from "./cursor-account-format.js";
14
+ import { MemberKeysPanel } from "./MemberKeysPanel.js";
18
15
  import { useCursorAccounts } from "./useCursorAccounts.js";
19
16
  import { useCursorAccountView } from "./useCursorAccountView.js";
20
17
  import { useCursorMemberKeyActions } from "./useCursorMemberKeyActions.js";
@@ -36,14 +33,18 @@ type Flow =
36
33
  /**
37
34
  * The platform-operator console for managed Cursor accounts: the Cursor
38
35
  * teams (admin keys, member execution keys, org assignments) that back
39
- * the cursor harness, with roster coverage and per-member cycle spend
40
- * from the hourly sync.
36
+ * the cursor harness, with roster coverage and per-member usage from
37
+ * the hourly sync.
41
38
  *
42
39
  * - **List** — every account with routability at a glance (an account
43
40
  * with zero enabled member keys cannot serve executions).
44
- * - **Detail** — org assignments, the member-key panel (add / disable /
45
- * remove, each key joined with its owner's roster state and spend),
46
- * coverage gaps (active members without keys), and "Sync now".
41
+ * - **Detail** — org assignments, "Sync now", and the team-coverage
42
+ * table: every member and stored key classified into three explicit
43
+ * categories (on team with key / on team without key / key held but
44
+ * not on team), each row carrying Cursor's pool-usage percentages
45
+ * (first-party / API) and cycle spend dollars (included / on-demand).
46
+ * Off-team rows offer one-click copy of the account's Cursor team
47
+ * invite link when the operator has configured one.
47
48
  *
48
49
  * Requires `can_manage_cursor_accounts` on `platform:stigmer` —
49
50
  * non-operators see the designed access notice. Key material never
@@ -194,9 +195,11 @@ function AccountRow({
194
195
  <span className="block truncate font-medium text-foreground">
195
196
  {account.displayName}
196
197
  </span>
197
- {account.isPlatformDefault && (
198
+ {/* Account class is DERIVED from org_ids (DD-008): no org
199
+ assignment means the account belongs to the shared pool. */}
200
+ {account.orgIds.length === 0 && (
198
201
  <span className="block text-[11px] text-muted-foreground">
199
- platform default
202
+ shared pool
200
203
  </span>
201
204
  )}
202
205
  </span>
@@ -322,6 +325,19 @@ function AccountDetail({
322
325
 
323
326
  const view = detail.view;
324
327
  const account = view.account as CursorAccount;
328
+ // Derived once here: the panel's table consumes the groups, the header
329
+ // line the member counts (active roster = covered + uncovered members —
330
+ // server-computed facts only, no role-string parsing in the client).
331
+ // The covered count is exactly one row per member because the server
332
+ // rejects a second key for an already-bound email, so the removed-seat
333
+ // count is plain list arithmetic: roster entries minus active members.
334
+ // It answers "where did my N members go?" when Cursor marks departed
335
+ // seats role:"removed" in place instead of dropping them.
336
+ const coverage = deriveCoverage(view);
337
+ const activeMemberCount =
338
+ coverage.onTeamWithKey.length + coverage.onTeamWithoutKey.length;
339
+ const removedSeatCount =
340
+ (view.snapshot?.members.length ?? 0) - activeMemberCount;
325
341
 
326
342
  if (editing) {
327
343
  return (
@@ -356,14 +372,21 @@ function AccountDetail({
356
372
  </h3>
357
373
  <p className="text-[11px] text-muted-foreground">
358
374
  {account.orgIds.length > 0
359
- ? `Serves ${account.orgIds.length} org(s): ${account.orgIds.join(", ")}`
360
- : account.isPlatformDefault
361
- ? "Platform default — serves all unassigned orgs"
362
- : "No org assignments"}
375
+ ? `Dedicated to ${account.orgIds.length} org(s): ${account.orgIds.join(", ")}`
376
+ : "Shared pool — serves every org with no dedicated account"}
363
377
  {" · "}
364
378
  {account.enabled ? "enabled" : "disabled"}
379
+ {account.onDemandUsageDisabled
380
+ ? " · on-demand usage off (usage guard active)"
381
+ : ""}
365
382
  {" · synced "}
366
383
  {formatSyncTime(view.snapshot?.syncedAt)}
384
+ {coverage.hasRoster
385
+ ? ` · ${activeMemberCount} ${activeMemberCount === 1 ? "member" : "members"}`
386
+ : ""}
387
+ {coverage.hasRoster && removedSeatCount > 0
388
+ ? ` · ${removedSeatCount} removed ${removedSeatCount === 1 ? "seat" : "seats"}`
389
+ : ""}
367
390
  </p>
368
391
  </div>
369
392
  <div className="flex gap-2">
@@ -419,392 +442,13 @@ function AccountDetail({
419
442
 
420
443
  <MemberKeysPanel
421
444
  accountId={accountId}
422
- keyViews={view.keyViews}
445
+ view={view}
446
+ coverage={coverage}
423
447
  actions={keyActions}
424
448
  onChanged={refreshAll}
425
449
  onImported={syncAfterImport}
426
450
  />
427
-
428
- {view.membersWithoutKeys.length > 0 && (
429
- <section className="space-y-1">
430
- <h4 className="text-xs font-semibold text-foreground">
431
- Members without execution keys
432
- </h4>
433
- <p className="text-[11px] text-muted-foreground">
434
- Active team members Stigmer holds no key for — sessions can never
435
- run under their identity or included quota.
436
- </p>
437
- <ul role="list" className="m-0 list-none space-y-0.5 p-0 text-xs text-muted-foreground">
438
- {view.membersWithoutKeys.map((member) => (
439
- <li key={member.email}>
440
- {member.name || member.email} · {member.email}
441
- </li>
442
- ))}
443
- </ul>
444
- </section>
445
- )}
446
451
  </div>
447
452
  );
448
453
  }
449
454
 
450
- // ---------------------------------------------------------------------------
451
- // Member keys panel (internal)
452
- // ---------------------------------------------------------------------------
453
-
454
- /** One line's outcome from a bulk key import. */
455
- interface ImportLineResult {
456
- /** Masked identification of the key (never the full material). */
457
- readonly keyPreview: string;
458
- readonly ok: boolean;
459
- /** Bound email on success; the server/Cursor error on failure. */
460
- readonly message: string;
461
- }
462
-
463
- /** Parse bulk-import text: one key per line, trimmed, deduped. */
464
- function parseImportKeys(text: string): string[] {
465
- return [...new Set(text.split(/\r?\n/).map((s) => s.trim()).filter((s) => s !== ""))];
466
- }
467
-
468
- function maskKey(key: string, index: number): string {
469
- return key.length >= 8 ? `key ${index + 1} (…${key.slice(-4)})` : `key ${index + 1}`;
470
- }
471
-
472
- function MemberKeysPanel({
473
- accountId,
474
- keyViews,
475
- actions,
476
- onChanged,
477
- onImported,
478
- }: {
479
- readonly accountId: string;
480
- readonly keyViews: readonly CursorMemberKeyView[];
481
- readonly actions: ReturnType<typeof useCursorMemberKeyActions>;
482
- readonly onChanged: () => void;
483
- /** Called after a bulk import added at least one key (triggers sync). */
484
- readonly onImported: () => void;
485
- }) {
486
- const [newKey, setNewKey] = useState("");
487
- const [newLabel, setNewLabel] = useState("");
488
- const [showImport, setShowImport] = useState(false);
489
- const [importText, setImportText] = useState("");
490
- const [isImporting, setIsImporting] = useState(false);
491
- const [importProgress, setImportProgress] = useState<
492
- { readonly done: number; readonly total: number } | null
493
- >(null);
494
- const [importResults, setImportResults] = useState<readonly ImportLineResult[] | null>(
495
- null,
496
- );
497
-
498
- const submitNewKey = (e: React.FormEvent) => {
499
- e.preventDefault();
500
- if (newKey.trim() === "" || actions.isSubmitting) return;
501
- void actions
502
- .addKey({ accountId, apiKey: newKey.trim(), label: newLabel.trim() || undefined })
503
- .then(() => {
504
- setNewKey("");
505
- setNewLabel("");
506
- onChanged();
507
- }, () => {
508
- // Surfaced via actions.error (incl. Cursor's own key-class 401 text).
509
- });
510
- };
511
-
512
- const importKeyCount = parseImportKeys(importText).length;
513
-
514
- const submitImport = async (e: React.FormEvent) => {
515
- e.preventDefault();
516
- const keys = parseImportKeys(importText);
517
- if (keys.length === 0 || isImporting) return;
518
-
519
- setIsImporting(true);
520
- setImportResults(null);
521
-
522
- // Sequential on purpose: each key is validated live against Cursor's
523
- // /v1/me, and per-key errors (wrong key class, revoked, duplicate)
524
- // must be attributable to their line.
525
- const knownKeyIds = new Set(
526
- keyViews.map((kv) => kv.key?.keyId).filter((id): id is string => !!id),
527
- );
528
- const results: ImportLineResult[] = [];
529
- const failedKeys: string[] = [];
530
- for (const [i, key] of keys.entries()) {
531
- setImportProgress({ done: i, total: keys.length });
532
- try {
533
- const account = await actions.addKey({ accountId, apiKey: key });
534
- const addedKey = account.memberKeys.find((mk) => !knownKeyIds.has(mk.keyId));
535
- if (addedKey) knownKeyIds.add(addedKey.keyId);
536
- results.push({
537
- keyPreview: maskKey(key, i),
538
- ok: true,
539
- message: addedKey?.boundEmail
540
- ? `added — bound to ${addedKey.boundEmail}`
541
- : "added",
542
- });
543
- } catch (err) {
544
- actions.clearError();
545
- failedKeys.push(key);
546
- results.push({
547
- keyPreview: maskKey(key, i),
548
- ok: false,
549
- message: getUserMessage(toError(err)),
550
- });
551
- }
552
- }
553
-
554
- setImportProgress(null);
555
- setImportResults(results);
556
- // Failed lines stay in the box so the operator can fix and retry.
557
- setImportText(failedKeys.join("\n"));
558
- setIsImporting(false);
559
- if (failedKeys.length < keys.length) onImported();
560
- };
561
-
562
- return (
563
- <section className="space-y-2">
564
- <h4 className="text-xs font-semibold text-foreground">Member execution keys</h4>
565
-
566
- {keyViews.length === 0 ? (
567
- <p className="text-xs text-muted-foreground" role="status">
568
- No execution keys — this account is <strong>not routable</strong>.
569
- Add a member's user-scoped API key below.
570
- </p>
571
- ) : (
572
- <ul role="list" aria-label="Member keys" className="m-0 list-none space-y-1 p-0">
573
- {keyViews.map((keyView) => (
574
- <MemberKeyRow
575
- key={keyView.key?.keyId}
576
- accountId={accountId}
577
- keyView={keyView}
578
- actions={actions}
579
- onChanged={onChanged}
580
- />
581
- ))}
582
- </ul>
583
- )}
584
-
585
- {actions.error && (
586
- <p className="text-destructive text-xs" role="alert">
587
- {getUserMessage(actions.error)}
588
- </p>
589
- )}
590
-
591
- <form className="flex flex-wrap items-end gap-2" onSubmit={submitNewKey}>
592
- <label className="block min-w-56 flex-1 space-y-1">
593
- <span className="text-[11px] font-medium text-muted-foreground">
594
- User-scoped API key
595
- </span>
596
- <input
597
- className={INPUT_CLASSES}
598
- type="password"
599
- value={newKey}
600
- onChange={(e) => setNewKey(e.target.value)}
601
- placeholder="the member's personal Cursor API key"
602
- disabled={actions.isSubmitting}
603
- autoComplete="off"
604
- />
605
- </label>
606
- <label className="block min-w-40 space-y-1">
607
- <span className="text-[11px] font-medium text-muted-foreground">
608
- Label (optional)
609
- </span>
610
- <input
611
- className={INPUT_CLASSES}
612
- value={newLabel}
613
- onChange={(e) => setNewLabel(e.target.value)}
614
- placeholder="e.g. zane — prod"
615
- disabled={actions.isSubmitting}
616
- />
617
- </label>
618
- <Button type="submit" size="sm" disabled={newKey.trim() === "" || actions.isSubmitting}>
619
- {actions.isSubmitting ? "Verifying…" : "Add key"}
620
- </Button>
621
- <Button
622
- type="button"
623
- size="sm"
624
- variant="outline"
625
- disabled={isImporting}
626
- onClick={() => {
627
- setShowImport((v) => !v);
628
- setImportResults(null);
629
- }}
630
- >
631
- {showImport ? "Hide import" : "Import keys"}
632
- </Button>
633
- </form>
634
-
635
- {showImport && (
636
- <form className="space-y-2 rounded-md border border-border bg-card p-3" onSubmit={submitImport}>
637
- <label className="block space-y-1">
638
- <span className="text-[11px] font-medium text-muted-foreground">
639
- Bulk import — one user-scoped API key per line
640
- </span>
641
- <textarea
642
- className={cn(INPUT_CLASSES, "min-h-24 font-mono")}
643
- value={importText}
644
- onChange={(e) => setImportText(e.target.value)}
645
- placeholder={"key_...\nkey_...\nkey_..."}
646
- disabled={isImporting}
647
- autoComplete="off"
648
- spellCheck={false}
649
- />
650
- </label>
651
- <p className="text-[11px] text-muted-foreground">
652
- Each key is verified against Cursor and bound to its owning team
653
- member, one at a time. Lines that fail stay in the box so you can
654
- fix and retry them. A roster sync runs automatically afterwards,
655
- so the key badges reflect current team membership.
656
- </p>
657
- <div className="flex items-center gap-2">
658
- <Button type="submit" size="sm" disabled={importKeyCount === 0 || isImporting}>
659
- {isImporting && importProgress
660
- ? `Importing ${importProgress.done + 1} of ${importProgress.total}…`
661
- : importKeyCount > 0
662
- ? `Import ${importKeyCount} ${importKeyCount === 1 ? "key" : "keys"}`
663
- : "Import keys"}
664
- </Button>
665
- <Button
666
- type="button"
667
- size="sm"
668
- variant="outline"
669
- disabled={isImporting}
670
- onClick={() => {
671
- setShowImport(false);
672
- setImportText("");
673
- setImportResults(null);
674
- }}
675
- >
676
- Close
677
- </Button>
678
- </div>
679
- {importResults && (
680
- <ul
681
- role="list"
682
- aria-label="Import results"
683
- className="m-0 list-none space-y-0.5 p-0 text-[11px]"
684
- >
685
- {importResults.map((result) => (
686
- <li
687
- key={result.keyPreview}
688
- className={result.ok ? "text-muted-foreground" : "text-destructive"}
689
- >
690
- {result.keyPreview}: {result.message}
691
- </li>
692
- ))}
693
- </ul>
694
- )}
695
- </form>
696
- )}
697
- </section>
698
- );
699
- }
700
-
701
- function MemberKeyRow({
702
- accountId,
703
- keyView,
704
- actions,
705
- onChanged,
706
- }: {
707
- readonly accountId: string;
708
- readonly keyView: CursorMemberKeyView;
709
- readonly actions: ReturnType<typeof useCursorMemberKeyActions>;
710
- readonly onChanged: () => void;
711
- }) {
712
- const key = keyView.key;
713
- if (!key) return null;
714
-
715
- return (
716
- <li className="flex flex-wrap items-center justify-between gap-2 rounded-md border border-border bg-card px-3 py-2">
717
- <span className="min-w-0">
718
- <span className="block truncate text-xs font-medium text-foreground">
719
- {key.boundEmail}
720
- {key.label ? ` · ${key.label}` : ""}
721
- </span>
722
- <span className="block text-[11px] text-muted-foreground">
723
- {key.cursorKeyName || "unnamed key"}
724
- {keyView.spend
725
- ? ` · ${formatSpendMicros(
726
- keyView.spend.includedSpendUsdMicros + keyView.spend.overageSpendUsdMicros,
727
- )} this cycle`
728
- : ""}
729
- </span>
730
- </span>
731
- <span className="flex items-center gap-2">
732
- <KeyStateBadge state={keyView.state} enabled={key.enabled} />
733
- <Button
734
- size="sm"
735
- variant="outline"
736
- disabled={actions.isSubmitting}
737
- onClick={() => {
738
- void actions
739
- .setKeyEnabled(accountId, key.keyId, !key.enabled)
740
- .then(onChanged, () => {
741
- // Surfaced via actions.error.
742
- });
743
- }}
744
- >
745
- {key.enabled ? "Disable" : "Enable"}
746
- </Button>
747
- <Button
748
- size="sm"
749
- variant="destructive"
750
- disabled={actions.isSubmitting}
751
- onClick={() => {
752
- void actions
753
- .removeKey({ accountId, keyId: key.keyId })
754
- .then(onChanged, () => {
755
- // Surfaced via actions.error (incl. the live-pin guard's
756
- // "disable instead, or force" message).
757
- });
758
- }}
759
- >
760
- Remove
761
- </Button>
762
- </span>
763
- </li>
764
- );
765
- }
766
-
767
- // ---------------------------------------------------------------------------
768
- // Badges (internal)
769
- // ---------------------------------------------------------------------------
770
-
771
- function StateBadge({
772
- tone,
773
- label,
774
- }: {
775
- readonly tone: "ok" | "warn" | "muted";
776
- readonly label: string;
777
- }) {
778
- return (
779
- <span
780
- className={cn(
781
- "inline-block rounded px-1.5 py-0.5 text-[10px] font-medium",
782
- tone === "ok" && "bg-accent text-primary",
783
- tone === "warn" && "bg-muted-subtle text-destructive",
784
- tone === "muted" && "bg-muted-subtle text-muted-foreground",
785
- )}
786
- >
787
- {label}
788
- </span>
789
- );
790
- }
791
-
792
- function KeyStateBadge({
793
- state,
794
- enabled,
795
- }: {
796
- readonly state: CursorMemberKeyState;
797
- readonly enabled: boolean;
798
- }) {
799
- if (state === CursorMemberKeyState.member_key_owner_removed) {
800
- return <StateBadge tone="warn" label="Owner left team" />;
801
- }
802
- if (state === CursorMemberKeyState.member_key_owner_unknown) {
803
- return <StateBadge tone="muted" label="Owner unknown" />;
804
- }
805
- return enabled ? (
806
- <StateBadge tone="ok" label="Active" />
807
- ) : (
808
- <StateBadge tone="muted" label="Disabled" />
809
- );
810
- }