@stigmer/react 3.12.3 → 3.12.5

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 (493) hide show
  1. package/agent/steps/IdentityStep.d.ts.map +1 -1
  2. package/agent/steps/IdentityStep.js +2 -1
  3. package/agent/steps/IdentityStep.js.map +1 -1
  4. package/agent-instance/AgentInstanceDetailPanel.d.ts.map +1 -1
  5. package/agent-instance/AgentInstanceDetailPanel.js +2 -1
  6. package/agent-instance/AgentInstanceDetailPanel.js.map +1 -1
  7. package/api-key/CreateApiKeyForm.d.ts.map +1 -1
  8. package/api-key/CreateApiKeyForm.js +2 -1
  9. package/api-key/CreateApiKeyForm.js.map +1 -1
  10. package/attachment/AttachmentChipList.js +16 -6
  11. package/attachment/AttachmentChipList.js.map +1 -1
  12. package/attachment/index.d.ts +1 -1
  13. package/attachment/index.d.ts.map +1 -1
  14. package/attachment/index.js.map +1 -1
  15. package/attachment/useAttachments.d.ts +51 -8
  16. package/attachment/useAttachments.d.ts.map +1 -1
  17. package/attachment/useAttachments.js +74 -3
  18. package/attachment/useAttachments.js.map +1 -1
  19. package/channel/ChannelConversationsDialog.d.ts.map +1 -1
  20. package/channel/ChannelConversationsDialog.js +2 -1
  21. package/channel/ChannelConversationsDialog.js.map +1 -1
  22. package/channel/ChannelTemplatesDialog.d.ts.map +1 -1
  23. package/channel/ChannelTemplatesDialog.js +2 -1
  24. package/channel/ChannelTemplatesDialog.js.map +1 -1
  25. package/channel/ConnectSlackDialog.d.ts.map +1 -1
  26. package/channel/ConnectSlackDialog.js +2 -1
  27. package/channel/ConnectSlackDialog.js.map +1 -1
  28. package/channel/connect/ServingAppSection.d.ts.map +1 -1
  29. package/channel/connect/ServingAppSection.js +2 -1
  30. package/channel/connect/ServingAppSection.js.map +1 -1
  31. package/channel-app/CreateChannelAppForm.d.ts.map +1 -1
  32. package/channel-app/CreateChannelAppForm.js +2 -1
  33. package/channel-app/CreateChannelAppForm.js.map +1 -1
  34. package/composer/SessionComposer.d.ts.map +1 -1
  35. package/composer/SessionComposer.js +17 -10
  36. package/composer/SessionComposer.js.map +1 -1
  37. package/conversation/ConversationComposer.d.ts +19 -3
  38. package/conversation/ConversationComposer.d.ts.map +1 -1
  39. package/conversation/ConversationComposer.js +4 -4
  40. package/conversation/ConversationComposer.js.map +1 -1
  41. package/conversation/ConversationListPane.d.ts.map +1 -1
  42. package/conversation/ConversationListPane.js +2 -1
  43. package/conversation/ConversationListPane.js.map +1 -1
  44. package/conversation/ConversationTemplatePickerDialog.d.ts +63 -0
  45. package/conversation/ConversationTemplatePickerDialog.d.ts.map +1 -0
  46. package/conversation/ConversationTemplatePickerDialog.js +151 -0
  47. package/conversation/ConversationTemplatePickerDialog.js.map +1 -0
  48. package/conversation/ConversationTimelineView.d.ts.map +1 -1
  49. package/conversation/ConversationTimelineView.js +2 -1
  50. package/conversation/ConversationTimelineView.js.map +1 -1
  51. package/conversation/ConversationsWorkbench.d.ts.map +1 -1
  52. package/conversation/ConversationsWorkbench.js +16 -5
  53. package/conversation/ConversationsWorkbench.js.map +1 -1
  54. package/conversation/index.d.ts +3 -1
  55. package/conversation/index.d.ts.map +1 -1
  56. package/conversation/index.js +1 -0
  57. package/conversation/index.js.map +1 -1
  58. package/conversation/useConversationParticipation.d.ts +41 -4
  59. package/conversation/useConversationParticipation.d.ts.map +1 -1
  60. package/conversation/useConversationParticipation.js +13 -2
  61. package/conversation/useConversationParticipation.js.map +1 -1
  62. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
  63. package/cursor-accounts/CursorAccountsConsole.js +2 -1
  64. package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
  65. package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -1
  66. package/cursor-accounts/MemberKeysPanel.js +2 -1
  67. package/cursor-accounts/MemberKeysPanel.js.map +1 -1
  68. package/dashboard/DashboardFailedRuns.d.ts.map +1 -1
  69. package/dashboard/DashboardFailedRuns.js +2 -1
  70. package/dashboard/DashboardFailedRuns.js.map +1 -1
  71. package/dependency-graph/DependencyGraph.d.ts.map +1 -1
  72. package/dependency-graph/DependencyGraph.js +2 -1
  73. package/dependency-graph/DependencyGraph.js.map +1 -1
  74. package/dependency-graph/DependencyTreeNode.d.ts.map +1 -1
  75. package/dependency-graph/DependencyTreeNode.js +2 -1
  76. package/dependency-graph/DependencyTreeNode.js.map +1 -1
  77. package/environment/EnvironmentPicker.d.ts.map +1 -1
  78. package/environment/EnvironmentPicker.js +2 -1
  79. package/environment/EnvironmentPicker.js.map +1 -1
  80. package/error/SecretFlowErrorGuide.d.ts.map +1 -1
  81. package/error/SecretFlowErrorGuide.js +2 -1
  82. package/error/SecretFlowErrorGuide.js.map +1 -1
  83. package/execution/ArtifactContentBody.d.ts.map +1 -1
  84. package/execution/ArtifactContentBody.js +2 -1
  85. package/execution/ArtifactContentBody.js.map +1 -1
  86. package/execution/ArtifactsWidget.d.ts.map +1 -1
  87. package/execution/ArtifactsWidget.js +2 -1
  88. package/execution/ArtifactsWidget.js.map +1 -1
  89. package/execution/FileChangeProgressBar.d.ts.map +1 -1
  90. package/execution/FileChangeProgressBar.js +2 -1
  91. package/execution/FileChangeProgressBar.js.map +1 -1
  92. package/execution/TodoList.d.ts.map +1 -1
  93. package/execution/TodoList.js +2 -1
  94. package/execution/TodoList.js.map +1 -1
  95. package/execution/WriteBacksWidget.d.ts.map +1 -1
  96. package/execution/WriteBacksWidget.js +2 -1
  97. package/execution/WriteBacksWidget.js.map +1 -1
  98. package/execution/tool-categories.d.ts +5 -22
  99. package/execution/tool-categories.d.ts.map +1 -1
  100. package/execution/tool-categories.js +8 -38
  101. package/execution/tool-categories.js.map +1 -1
  102. package/iam-policy/PeopleWithAccess.d.ts.map +1 -1
  103. package/iam-policy/PeopleWithAccess.js +2 -1
  104. package/iam-policy/PeopleWithAccess.js.map +1 -1
  105. package/iam-policy/PrincipalPicker.d.ts.map +1 -1
  106. package/iam-policy/PrincipalPicker.js +2 -1
  107. package/iam-policy/PrincipalPicker.js.map +1 -1
  108. package/iam-policy/RoleSelector.d.ts.map +1 -1
  109. package/iam-policy/RoleSelector.js +2 -1
  110. package/iam-policy/RoleSelector.js.map +1 -1
  111. package/identity-account/AccountPreferencesPanel.d.ts +35 -0
  112. package/identity-account/AccountPreferencesPanel.d.ts.map +1 -0
  113. package/identity-account/AccountPreferencesPanel.js +187 -0
  114. package/identity-account/AccountPreferencesPanel.js.map +1 -0
  115. package/identity-account/index.d.ts +8 -0
  116. package/identity-account/index.d.ts.map +1 -1
  117. package/identity-account/index.js +4 -0
  118. package/identity-account/index.js.map +1 -1
  119. package/identity-account/useAccountExecutionDefaults.d.ts +36 -0
  120. package/identity-account/useAccountExecutionDefaults.d.ts.map +1 -0
  121. package/identity-account/useAccountExecutionDefaults.js +46 -0
  122. package/identity-account/useAccountExecutionDefaults.js.map +1 -0
  123. package/identity-account/useMyIdentityAccount.d.ts +55 -0
  124. package/identity-account/useMyIdentityAccount.d.ts.map +1 -0
  125. package/identity-account/useMyIdentityAccount.js +37 -0
  126. package/identity-account/useMyIdentityAccount.js.map +1 -0
  127. package/identity-account/useUpdateIdentityAccount.d.ts +42 -0
  128. package/identity-account/useUpdateIdentityAccount.d.ts.map +1 -0
  129. package/identity-account/useUpdateIdentityAccount.js +53 -0
  130. package/identity-account/useUpdateIdentityAccount.js.map +1 -0
  131. package/identity-provider/CreateIdentityProviderForm.d.ts.map +1 -1
  132. package/identity-provider/CreateIdentityProviderForm.js +2 -1
  133. package/identity-provider/CreateIdentityProviderForm.js.map +1 -1
  134. package/identity-provider/IdentityProviderDetailPanel.d.ts.map +1 -1
  135. package/identity-provider/IdentityProviderDetailPanel.js +2 -1
  136. package/identity-provider/IdentityProviderDetailPanel.js.map +1 -1
  137. package/identity-provider/IdentityProviderWizard.d.ts.map +1 -1
  138. package/identity-provider/IdentityProviderWizard.js +2 -1
  139. package/identity-provider/IdentityProviderWizard.js.map +1 -1
  140. package/index.d.ts +14 -10
  141. package/index.d.ts.map +1 -1
  142. package/index.js +11 -5
  143. package/index.js.map +1 -1
  144. package/internal/StandingContextField.d.ts +37 -0
  145. package/internal/StandingContextField.d.ts.map +1 -0
  146. package/internal/StandingContextField.js +24 -0
  147. package/internal/StandingContextField.js.map +1 -0
  148. package/internal/element-resets.d.ts +17 -0
  149. package/internal/element-resets.d.ts.map +1 -0
  150. package/internal/element-resets.js +32 -0
  151. package/internal/element-resets.js.map +1 -0
  152. package/internal/file-tree/FileTreeNode.d.ts.map +1 -1
  153. package/internal/file-tree/FileTreeNode.js +2 -1
  154. package/internal/file-tree/FileTreeNode.js.map +1 -1
  155. package/internal/markdown-components.d.ts +7 -0
  156. package/internal/markdown-components.d.ts.map +1 -1
  157. package/internal/markdown-components.js +15 -5
  158. package/internal/markdown-components.js.map +1 -1
  159. package/invitation/InvitationManager.d.ts.map +1 -1
  160. package/invitation/InvitationManager.js +2 -1
  161. package/invitation/InvitationManager.js.map +1 -1
  162. package/library/InstanceVisibilitySelector.d.ts.map +1 -1
  163. package/library/InstanceVisibilitySelector.js +9 -2
  164. package/library/InstanceVisibilitySelector.js.map +1 -1
  165. package/library/ResourceVisibilityControl.d.ts +13 -3
  166. package/library/ResourceVisibilityControl.d.ts.map +1 -1
  167. package/library/ResourceVisibilityControl.js +33 -5
  168. package/library/ResourceVisibilityControl.js.map +1 -1
  169. package/library/VisibilityOptionRow.d.ts +6 -0
  170. package/library/VisibilityOptionRow.d.ts.map +1 -1
  171. package/library/VisibilityOptionRow.js +11 -1
  172. package/library/VisibilityOptionRow.js.map +1 -1
  173. package/library/VisibilitySelector.d.ts.map +1 -1
  174. package/library/VisibilitySelector.js +14 -2
  175. package/library/VisibilitySelector.js.map +1 -1
  176. package/library/index.d.ts +4 -2
  177. package/library/index.d.ts.map +1 -1
  178. package/library/index.js +2 -1
  179. package/library/index.js.map +1 -1
  180. package/library/useCanSetPublicVisibility.d.ts +30 -0
  181. package/library/useCanSetPublicVisibility.d.ts.map +1 -0
  182. package/library/useCanSetPublicVisibility.js +41 -0
  183. package/library/useCanSetPublicVisibility.js.map +1 -0
  184. package/library/visibilityLevels.d.ts +32 -1
  185. package/library/visibilityLevels.d.ts.map +1 -1
  186. package/library/visibilityLevels.js +34 -14
  187. package/library/visibilityLevels.js.map +1 -1
  188. package/manifest/ApplyManifestDialog.d.ts.map +1 -1
  189. package/manifest/ApplyManifestDialog.js +2 -1
  190. package/manifest/ApplyManifestDialog.js.map +1 -1
  191. package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -1
  192. package/mcp-server/steps/IdentityTransportStep.js +2 -1
  193. package/mcp-server/steps/IdentityTransportStep.js.map +1 -1
  194. package/mcp-server/useMcpServerConnect.d.ts +8 -5
  195. package/mcp-server/useMcpServerConnect.d.ts.map +1 -1
  196. package/mcp-server/useMcpServerConnect.js +2 -1
  197. package/mcp-server/useMcpServerConnect.js.map +1 -1
  198. package/mcp-server/useMcpServerOAuthConnect.d.ts.map +1 -1
  199. package/mcp-server/useMcpServerOAuthConnect.js +7 -2
  200. package/mcp-server/useMcpServerOAuthConnect.js.map +1 -1
  201. package/oauth-app/CreateOAuthAppForm.d.ts +2 -2
  202. package/oauth-app/CreateOAuthAppForm.d.ts.map +1 -1
  203. package/oauth-app/CreateOAuthAppForm.js +13 -4
  204. package/oauth-app/CreateOAuthAppForm.js.map +1 -1
  205. package/oauth-app/OAuthAppDetailPanel.d.ts.map +1 -1
  206. package/oauth-app/OAuthAppDetailPanel.js +32 -5
  207. package/oauth-app/OAuthAppDetailPanel.js.map +1 -1
  208. package/organization/OrgPreferencesPanel.d.ts +32 -0
  209. package/organization/OrgPreferencesPanel.d.ts.map +1 -0
  210. package/organization/OrgPreferencesPanel.js +90 -0
  211. package/organization/OrgPreferencesPanel.js.map +1 -0
  212. package/organization/OrgProfilePanel.d.ts.map +1 -1
  213. package/organization/OrgProfilePanel.js +5 -4
  214. package/organization/OrgProfilePanel.js.map +1 -1
  215. package/organization/index.d.ts +2 -0
  216. package/organization/index.d.ts.map +1 -1
  217. package/organization/index.js +1 -0
  218. package/organization/index.js.map +1 -1
  219. package/package.json +4 -4
  220. package/platform-client/CreatePlatformClientForm.d.ts.map +1 -1
  221. package/platform-client/CreatePlatformClientForm.js +2 -1
  222. package/platform-client/CreatePlatformClientForm.js.map +1 -1
  223. package/platform-client/PlatformClientDetailPanel.d.ts.map +1 -1
  224. package/platform-client/PlatformClientDetailPanel.js +2 -1
  225. package/platform-client/PlatformClientDetailPanel.js.map +1 -1
  226. package/pricing-governance/BaselineEditor.d.ts.map +1 -1
  227. package/pricing-governance/BaselineEditor.js +2 -1
  228. package/pricing-governance/BaselineEditor.js.map +1 -1
  229. package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -1
  230. package/pricing-governance/PricingGovernanceConsole.js +2 -1
  231. package/pricing-governance/PricingGovernanceConsole.js.map +1 -1
  232. package/provider-standing/ProviderStandingAccessNotice.d.ts +11 -0
  233. package/provider-standing/ProviderStandingAccessNotice.d.ts.map +1 -0
  234. package/provider-standing/ProviderStandingAccessNotice.js +14 -0
  235. package/provider-standing/ProviderStandingAccessNotice.js.map +1 -0
  236. package/provider-standing/ProviderStandingConsole.d.ts +24 -0
  237. package/provider-standing/ProviderStandingConsole.d.ts.map +1 -0
  238. package/provider-standing/ProviderStandingConsole.js +98 -0
  239. package/provider-standing/ProviderStandingConsole.js.map +1 -0
  240. package/provider-standing/index.d.ts +6 -0
  241. package/provider-standing/index.d.ts.map +1 -0
  242. package/provider-standing/index.js +6 -0
  243. package/provider-standing/index.js.map +1 -0
  244. package/provider-standing/useProviderStanding.d.ts +34 -0
  245. package/provider-standing/useProviderStanding.d.ts.map +1 -0
  246. package/provider-standing/useProviderStanding.js +26 -0
  247. package/provider-standing/useProviderStanding.js.map +1 -0
  248. package/provider.d.ts +12 -0
  249. package/provider.d.ts.map +1 -1
  250. package/provider.js +12 -0
  251. package/provider.js.map +1 -1
  252. package/resource-creation/StepIndicator.d.ts.map +1 -1
  253. package/resource-creation/StepIndicator.js +2 -1
  254. package/resource-creation/StepIndicator.js.map +1 -1
  255. package/schedule/ScheduleDetailView.d.ts.map +1 -1
  256. package/schedule/ScheduleDetailView.js +3 -2
  257. package/schedule/ScheduleDetailView.js.map +1 -1
  258. package/schedule/ScheduleRunsTable.d.ts.map +1 -1
  259. package/schedule/ScheduleRunsTable.js +2 -1
  260. package/schedule/ScheduleRunsTable.js.map +1 -1
  261. package/session/NewSessionViewer.d.ts +10 -1
  262. package/session/NewSessionViewer.d.ts.map +1 -1
  263. package/session/NewSessionViewer.js +2 -1
  264. package/session/NewSessionViewer.js.map +1 -1
  265. package/session/facets/ArtifactsTab.d.ts.map +1 -1
  266. package/session/facets/ArtifactsTab.js +2 -1
  267. package/session/facets/ArtifactsTab.js.map +1 -1
  268. package/session/facets/ChangesTab.d.ts.map +1 -1
  269. package/session/facets/ChangesTab.js +2 -1
  270. package/session/facets/ChangesTab.js.map +1 -1
  271. package/session/facets/UsageTab.d.ts +10 -3
  272. package/session/facets/UsageTab.d.ts.map +1 -1
  273. package/session/facets/UsageTab.js +42 -6
  274. package/session/facets/UsageTab.js.map +1 -1
  275. package/session/index.d.ts +1 -1
  276. package/session/index.d.ts.map +1 -1
  277. package/session/index.js.map +1 -1
  278. package/session/useNewSessionFlow.d.ts +27 -1
  279. package/session/useNewSessionFlow.d.ts.map +1 -1
  280. package/session/useNewSessionFlow.js +45 -8
  281. package/session/useNewSessionFlow.js.map +1 -1
  282. package/session/useSessionUsage.d.ts +25 -0
  283. package/session/useSessionUsage.d.ts.map +1 -1
  284. package/session/useSessionUsage.js +11 -0
  285. package/session/useSessionUsage.js.map +1 -1
  286. package/settings/AccountPreferencesSection.d.ts +3 -0
  287. package/settings/AccountPreferencesSection.d.ts.map +1 -0
  288. package/settings/AccountPreferencesSection.js +10 -0
  289. package/settings/AccountPreferencesSection.js.map +1 -0
  290. package/settings/OrgPreferencesSection.d.ts +3 -0
  291. package/settings/OrgPreferencesSection.d.ts.map +1 -0
  292. package/settings/OrgPreferencesSection.js +13 -0
  293. package/settings/OrgPreferencesSection.js.map +1 -0
  294. package/settings/index.d.ts +2 -0
  295. package/settings/index.d.ts.map +1 -1
  296. package/settings/index.js +2 -0
  297. package/settings/index.js.map +1 -1
  298. package/settings/settings-nav.d.ts.map +1 -1
  299. package/settings/settings-nav.js +23 -1
  300. package/settings/settings-nav.js.map +1 -1
  301. package/settings/useSettingsNavGroups.d.ts.map +1 -1
  302. package/settings/useSettingsNavGroups.js +4 -1
  303. package/settings/useSettingsNavGroups.js.map +1 -1
  304. package/sharing/ShareAgentDialog.d.ts.map +1 -1
  305. package/sharing/ShareAgentDialog.js +2 -1
  306. package/sharing/ShareAgentDialog.js.map +1 -1
  307. package/sidebar/WorkspaceSidebar.d.ts.map +1 -1
  308. package/sidebar/WorkspaceSidebar.js +2 -1
  309. package/sidebar/WorkspaceSidebar.js.map +1 -1
  310. package/skill/SkillFileBrowser.d.ts.map +1 -1
  311. package/skill/SkillFileBrowser.js +2 -1
  312. package/skill/SkillFileBrowser.js.map +1 -1
  313. package/skill/internal/fetchAndUnpackArtifact.d.ts +1 -1
  314. package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -1
  315. package/skill/internal/fetchAndUnpackArtifact.js +47 -3
  316. package/skill/internal/fetchAndUnpackArtifact.js.map +1 -1
  317. package/skill/useSkillDiff.d.ts.map +1 -1
  318. package/skill/useSkillDiff.js +7 -1
  319. package/skill/useSkillDiff.js.map +1 -1
  320. package/skill/useSkillUpload.d.ts.map +1 -1
  321. package/skill/useSkillUpload.js +22 -4
  322. package/skill/useSkillUpload.js.map +1 -1
  323. package/src/__tests__/bare-host-resets.layout.test.tsx +184 -0
  324. package/src/agent/steps/IdentityStep.tsx +2 -1
  325. package/src/agent-instance/AgentInstanceDetailPanel.tsx +2 -1
  326. package/src/api-key/CreateApiKeyForm.tsx +2 -1
  327. package/src/attachment/AttachmentChipList.tsx +19 -8
  328. package/src/attachment/__tests__/AttachmentChipList.test.tsx +12 -0
  329. package/src/attachment/__tests__/useAttachments.test.ts +293 -0
  330. package/src/attachment/index.ts +1 -0
  331. package/src/attachment/useAttachments.ts +143 -11
  332. package/src/channel/ChannelConversationsDialog.tsx +2 -1
  333. package/src/channel/ChannelTemplatesDialog.tsx +2 -1
  334. package/src/channel/ConnectSlackDialog.tsx +2 -1
  335. package/src/channel/connect/ServingAppSection.tsx +2 -1
  336. package/src/channel-app/CreateChannelAppForm.tsx +2 -1
  337. package/src/composer/SessionComposer.tsx +23 -14
  338. package/src/conversation/ConversationComposer.tsx +38 -4
  339. package/src/conversation/ConversationListPane.tsx +2 -5
  340. package/src/conversation/ConversationTemplatePickerDialog.tsx +441 -0
  341. package/src/conversation/ConversationTimelineView.tsx +2 -1
  342. package/src/conversation/ConversationsWorkbench.tsx +40 -4
  343. package/src/conversation/__tests__/ConversationComposer.test.tsx +56 -1
  344. package/src/conversation/__tests__/ConversationTemplatePickerDialog.test.tsx +224 -0
  345. package/src/conversation/__tests__/useConversationParticipation.test.tsx +45 -4
  346. package/src/conversation/index.ts +4 -0
  347. package/src/conversation/useConversationParticipation.ts +58 -6
  348. package/src/cursor-accounts/CursorAccountsConsole.tsx +2 -1
  349. package/src/cursor-accounts/MemberKeysPanel.tsx +2 -1
  350. package/src/dashboard/DashboardFailedRuns.tsx +2 -1
  351. package/src/dependency-graph/DependencyGraph.tsx +2 -1
  352. package/src/dependency-graph/DependencyTreeNode.tsx +2 -1
  353. package/src/environment/EnvironmentPicker.tsx +2 -1
  354. package/src/error/SecretFlowErrorGuide.tsx +3 -2
  355. package/src/execution/ArtifactContentBody.tsx +2 -1
  356. package/src/execution/ArtifactsWidget.tsx +2 -1
  357. package/src/execution/FileChangeProgressBar.tsx +2 -1
  358. package/src/execution/TodoList.tsx +2 -1
  359. package/src/execution/WriteBacksWidget.tsx +2 -1
  360. package/src/execution/tool-categories.ts +17 -41
  361. package/src/iam-policy/PeopleWithAccess.tsx +2 -1
  362. package/src/iam-policy/PrincipalPicker.tsx +2 -0
  363. package/src/iam-policy/RoleSelector.tsx +2 -1
  364. package/src/identity-account/AccountPreferencesPanel.tsx +446 -0
  365. package/src/identity-account/__tests__/AccountPreferencesPanel.test.tsx +233 -0
  366. package/src/identity-account/__tests__/useAccountExecutionDefaults.test.tsx +116 -0
  367. package/src/identity-account/__tests__/useMyIdentityAccount.test.tsx +121 -0
  368. package/src/identity-account/index.ts +11 -0
  369. package/src/identity-account/useAccountExecutionDefaults.ts +63 -0
  370. package/src/identity-account/useMyIdentityAccount.ts +75 -0
  371. package/src/identity-account/useUpdateIdentityAccount.ts +73 -0
  372. package/src/identity-provider/CreateIdentityProviderForm.tsx +2 -1
  373. package/src/identity-provider/IdentityProviderDetailPanel.tsx +2 -1
  374. package/src/identity-provider/IdentityProviderWizard.tsx +2 -1
  375. package/src/index.ts +37 -2
  376. package/src/internal/StandingContextField.tsx +92 -0
  377. package/src/internal/element-resets.ts +33 -0
  378. package/src/internal/file-tree/FileTreeNode.tsx +2 -1
  379. package/src/internal/markdown-components.tsx +15 -5
  380. package/src/invitation/InvitationManager.tsx +3 -2
  381. package/src/library/InstanceVisibilitySelector.tsx +9 -2
  382. package/src/library/ResourceVisibilityControl.tsx +46 -13
  383. package/src/library/VisibilityOptionRow.tsx +28 -6
  384. package/src/library/VisibilitySelector.tsx +14 -2
  385. package/src/library/__tests__/VisibilitySelector.test.tsx +48 -1
  386. package/src/library/__tests__/visibilityLevels.test.ts +67 -1
  387. package/src/library/index.ts +6 -1
  388. package/src/library/useCanSetPublicVisibility.ts +56 -0
  389. package/src/library/visibilityLevels.ts +65 -14
  390. package/src/manifest/ApplyManifestDialog.tsx +2 -1
  391. package/src/mcp-server/__tests__/useMcpServerConnect.asyncLane.test.tsx +117 -0
  392. package/src/mcp-server/steps/IdentityTransportStep.tsx +3 -2
  393. package/src/mcp-server/useMcpServerConnect.ts +9 -6
  394. package/src/mcp-server/useMcpServerOAuthConnect.ts +7 -2
  395. package/src/oauth-app/CreateOAuthAppForm.tsx +58 -3
  396. package/src/oauth-app/OAuthAppDetailPanel.tsx +84 -3
  397. package/src/organization/OrgPreferencesPanel.tsx +221 -0
  398. package/src/organization/OrgProfilePanel.tsx +5 -4
  399. package/src/organization/__tests__/OrgPreferencesPanel.test.tsx +145 -0
  400. package/src/organization/__tests__/OrgProfilePanel.test.tsx +108 -0
  401. package/src/organization/index.ts +2 -0
  402. package/src/platform-client/CreatePlatformClientForm.tsx +4 -3
  403. package/src/platform-client/PlatformClientDetailPanel.tsx +4 -3
  404. package/src/pricing-governance/BaselineEditor.tsx +3 -2
  405. package/src/pricing-governance/PricingGovernanceConsole.tsx +2 -1
  406. package/src/provider-standing/ProviderStandingAccessNotice.tsx +36 -0
  407. package/src/provider-standing/ProviderStandingConsole.tsx +216 -0
  408. package/src/provider-standing/__tests__/ProviderStandingConsole.test.tsx +143 -0
  409. package/src/provider-standing/index.ts +8 -0
  410. package/src/provider-standing/useProviderStanding.ts +50 -0
  411. package/src/provider.tsx +12 -0
  412. package/src/resource-creation/StepIndicator.tsx +2 -1
  413. package/src/schedule/ScheduleDetailView.tsx +3 -2
  414. package/src/schedule/ScheduleRunsTable.tsx +2 -1
  415. package/src/session/NewSessionViewer.tsx +12 -0
  416. package/src/session/__tests__/UsageTab.test.tsx +136 -0
  417. package/src/session/__tests__/useNewSessionFlow.test.tsx +151 -0
  418. package/src/session/__tests__/useSessionUsage.test.ts +19 -0
  419. package/src/session/facets/ArtifactsTab.tsx +2 -1
  420. package/src/session/facets/ChangesTab.tsx +2 -1
  421. package/src/session/facets/UsageTab.tsx +98 -6
  422. package/src/session/index.ts +1 -0
  423. package/src/session/useNewSessionFlow.ts +76 -9
  424. package/src/session/useSessionUsage.ts +37 -0
  425. package/src/settings/AccountPreferencesSection.tsx +25 -0
  426. package/src/settings/OrgPreferencesSection.tsx +35 -0
  427. package/src/settings/__tests__/settings-nav.test.ts +27 -0
  428. package/src/settings/__tests__/useSettingsNavGroups.test.tsx +11 -1
  429. package/src/settings/index.ts +2 -0
  430. package/src/settings/settings-nav.ts +25 -0
  431. package/src/settings/useSettingsNavGroups.ts +8 -1
  432. package/src/sharing/ShareAgentDialog.tsx +2 -1
  433. package/src/sidebar/WorkspaceSidebar.tsx +2 -1
  434. package/src/skill/SkillFileBrowser.tsx +2 -1
  435. package/src/skill/__tests__/SkillFileBrowser.test.tsx +10 -2
  436. package/src/skill/__tests__/fetchAndUnpackArtifact.test.ts +90 -0
  437. package/src/skill/__tests__/useSkillUpload.test.ts +69 -0
  438. package/src/skill/internal/fetchAndUnpackArtifact.ts +54 -4
  439. package/src/skill/useSkillDiff.ts +7 -1
  440. package/src/skill/useSkillUpload.ts +25 -6
  441. package/src/workflow/ApprovalFormBuilder.tsx +5 -27
  442. package/src/workflow/FailedRunsWidget.tsx +2 -1
  443. package/src/workflow/PendingApprovalsWidget.tsx +2 -1
  444. package/src/workflow/facets/WorkflowArtifactsTab.tsx +2 -1
  445. package/src/workflow/facets/WorkflowUsageTab.tsx +2 -1
  446. package/src/workflow/inspector/WorkflowSummaryPanel.tsx +2 -1
  447. package/src/workflow/inspector/tabs/BranchesTab.tsx +2 -1
  448. package/src/workflow/inspector/tabs/IterationTab.tsx +2 -1
  449. package/src/workflow/instance/WorkflowInstanceDetailPanel.tsx +2 -1
  450. package/src/workspace/ExplorerTree.tsx +2 -1
  451. package/src/workspace/WorkspaceContentSearch.tsx +2 -1
  452. package/src/workspace/WorkspaceFileSearch.tsx +2 -1
  453. package/src/workspace/WorkspaceSummary.tsx +2 -1
  454. package/styles.css +1 -1
  455. package/workflow/ApprovalFormBuilder.d.ts.map +1 -1
  456. package/workflow/ApprovalFormBuilder.js +8 -5
  457. package/workflow/ApprovalFormBuilder.js.map +1 -1
  458. package/workflow/FailedRunsWidget.d.ts.map +1 -1
  459. package/workflow/FailedRunsWidget.js +2 -1
  460. package/workflow/FailedRunsWidget.js.map +1 -1
  461. package/workflow/PendingApprovalsWidget.d.ts.map +1 -1
  462. package/workflow/PendingApprovalsWidget.js +2 -1
  463. package/workflow/PendingApprovalsWidget.js.map +1 -1
  464. package/workflow/facets/WorkflowArtifactsTab.d.ts.map +1 -1
  465. package/workflow/facets/WorkflowArtifactsTab.js +2 -1
  466. package/workflow/facets/WorkflowArtifactsTab.js.map +1 -1
  467. package/workflow/facets/WorkflowUsageTab.d.ts.map +1 -1
  468. package/workflow/facets/WorkflowUsageTab.js +2 -1
  469. package/workflow/facets/WorkflowUsageTab.js.map +1 -1
  470. package/workflow/inspector/WorkflowSummaryPanel.d.ts.map +1 -1
  471. package/workflow/inspector/WorkflowSummaryPanel.js +2 -1
  472. package/workflow/inspector/WorkflowSummaryPanel.js.map +1 -1
  473. package/workflow/inspector/tabs/BranchesTab.d.ts.map +1 -1
  474. package/workflow/inspector/tabs/BranchesTab.js +2 -1
  475. package/workflow/inspector/tabs/BranchesTab.js.map +1 -1
  476. package/workflow/inspector/tabs/IterationTab.d.ts.map +1 -1
  477. package/workflow/inspector/tabs/IterationTab.js +2 -1
  478. package/workflow/inspector/tabs/IterationTab.js.map +1 -1
  479. package/workflow/instance/WorkflowInstanceDetailPanel.d.ts.map +1 -1
  480. package/workflow/instance/WorkflowInstanceDetailPanel.js +2 -1
  481. package/workflow/instance/WorkflowInstanceDetailPanel.js.map +1 -1
  482. package/workspace/ExplorerTree.d.ts.map +1 -1
  483. package/workspace/ExplorerTree.js +2 -1
  484. package/workspace/ExplorerTree.js.map +1 -1
  485. package/workspace/WorkspaceContentSearch.d.ts.map +1 -1
  486. package/workspace/WorkspaceContentSearch.js +2 -1
  487. package/workspace/WorkspaceContentSearch.js.map +1 -1
  488. package/workspace/WorkspaceFileSearch.d.ts.map +1 -1
  489. package/workspace/WorkspaceFileSearch.js +2 -1
  490. package/workspace/WorkspaceFileSearch.js.map +1 -1
  491. package/workspace/WorkspaceSummary.d.ts.map +1 -1
  492. package/workspace/WorkspaceSummary.js +2 -1
  493. package/workspace/WorkspaceSummary.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RoleSelector.js","sourceRoot":"","sources":["../../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J,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
2
+ /** Props for {@link AccountPreferencesPanel}. */
3
+ export interface AccountPreferencesPanelProps {
4
+ /** Fired with the updated resource after a successful save. */
5
+ readonly onUpdated?: (account: IdentityAccount) => void;
6
+ /** Additional CSS class names for the root container. */
7
+ readonly className?: string;
8
+ }
9
+ /**
10
+ * Self-contained editor for the current user's declared preferences
11
+ * (`IdentityAccountSpec.preferences.standing_context`).
12
+ *
13
+ * The declared text is snapshotted into the user's own eligible agent
14
+ * executions and delivered to the agent as background context.
15
+ * Self-service: the account is resolved via `whoAmI()` and updated
16
+ * through the caller's self-ownership permission — no explicit
17
+ * permission check is needed. On save, calls `identityAccount.update()`
18
+ * with the complete mapped input (full-spec-replace safety) and fires
19
+ * `onUpdated`.
20
+ *
21
+ * Cloud-only: the OSS local server has no IdentityAccount (local mode
22
+ * is single-user, so the organization's preferences cover it). In local
23
+ * mode the panel renders a {@link CloudFeatureNotice} instead.
24
+ *
25
+ * All visual properties flow through `--stgm-*` design tokens. Zero
26
+ * dependencies on Console routing, auth context, or layout — platform
27
+ * builders can embed it directly:
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * <AccountPreferencesPanel />
32
+ * ```
33
+ */
34
+ export declare function AccountPreferencesPanel({ onUpdated, className, }: AccountPreferencesPanelProps): import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=AccountPreferencesPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountPreferencesPanel.d.ts","sourceRoot":"","sources":["../../src/identity-account/AccountPreferencesPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAUhG,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,SAAS,GACV,EAAE,4BAA4B,2CAqB9B"}
@@ -0,0 +1,187 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useId, useMemo, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { getUserMessage, toIdentityAccountUpdateInput } from "@stigmer/sdk";
6
+ import { useMyIdentityAccount } from "./useMyIdentityAccount.js";
7
+ import { useUpdateIdentityAccount } from "./useUpdateIdentityAccount.js";
8
+ import { useResourceAvailable, ApiResourceKind } from "../deployment-mode.js";
9
+ import { useModelRegistry } from "../models/index.js";
10
+ import { HARNESS_META } from "../models/harness.js";
11
+ import { CloudFeatureNotice } from "../internal/CloudFeatureNotice.js";
12
+ import { StandingContextField } from "../internal/StandingContextField.js";
13
+ import { SpinnerIcon } from "../internal/SpinnerIcon.js";
14
+ /**
15
+ * Self-contained editor for the current user's declared preferences
16
+ * (`IdentityAccountSpec.preferences.standing_context`).
17
+ *
18
+ * The declared text is snapshotted into the user's own eligible agent
19
+ * executions and delivered to the agent as background context.
20
+ * Self-service: the account is resolved via `whoAmI()` and updated
21
+ * through the caller's self-ownership permission — no explicit
22
+ * permission check is needed. On save, calls `identityAccount.update()`
23
+ * with the complete mapped input (full-spec-replace safety) and fires
24
+ * `onUpdated`.
25
+ *
26
+ * Cloud-only: the OSS local server has no IdentityAccount (local mode
27
+ * is single-user, so the organization's preferences cover it). In local
28
+ * mode the panel renders a {@link CloudFeatureNotice} instead.
29
+ *
30
+ * All visual properties flow through `--stgm-*` design tokens. Zero
31
+ * dependencies on Console routing, auth context, or layout — platform
32
+ * builders can embed it directly:
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <AccountPreferencesPanel />
37
+ * ```
38
+ */
39
+ export function AccountPreferencesPanel({ onUpdated, className, }) {
40
+ const baseId = useId();
41
+ const available = useResourceAvailable(ApiResourceKind.identity_account);
42
+ if (!available) {
43
+ return (_jsx(CloudFeatureNotice, { className: className, children: "Personal preferences require Stigmer Cloud. Local mode is single-user, so the organization's preferences apply to every execution \u2014 set standing context there instead." }));
44
+ }
45
+ return (_jsx(AccountPreferencesForm, { baseId: baseId, onUpdated: onUpdated, className: className }));
46
+ }
47
+ /**
48
+ * Inner form, mounted only when IdentityAccount is available — keeps the
49
+ * data hooks from issuing doomed RPCs against a local server.
50
+ */
51
+ function AccountPreferencesForm({ baseId, onUpdated, className, }) {
52
+ const { account, isLoading: isFetching, error: fetchError, refetch, } = useMyIdentityAccount();
53
+ const { update, isUpdating, error: updateError, clearError, } = useUpdateIdentityAccount();
54
+ const [standingContext, setStandingContext] = useState("");
55
+ const [defaultHarness, setDefaultHarness] = useState("");
56
+ const [defaultNativeModel, setDefaultNativeModel] = useState("");
57
+ const [defaultCursorModel, setDefaultCursorModel] = useState("");
58
+ const serverPreferences = account?.spec?.preferences;
59
+ const serverStandingContext = serverPreferences?.standingContext ?? "";
60
+ const serverDefaultHarness = serverPreferences?.defaultHarness ?? "";
61
+ const serverDefaultNativeModel = serverPreferences?.defaultNativeModel ?? "";
62
+ const serverDefaultCursorModel = serverPreferences?.defaultCursorModel ?? "";
63
+ // Sync the form fields when server data changes.
64
+ useEffect(() => {
65
+ if (!account)
66
+ return;
67
+ const prefs = account.spec?.preferences;
68
+ setStandingContext(prefs?.standingContext ?? "");
69
+ setDefaultHarness(prefs?.defaultHarness ?? "");
70
+ setDefaultNativeModel(prefs?.defaultNativeModel ?? "");
71
+ setDefaultCursorModel(prefs?.defaultCursorModel ?? "");
72
+ }, [account]);
73
+ const hasChanges = useMemo(() => standingContext.trim() !== serverStandingContext ||
74
+ defaultHarness !== serverDefaultHarness ||
75
+ defaultNativeModel !== serverDefaultNativeModel ||
76
+ defaultCursorModel !== serverDefaultCursorModel, [
77
+ standingContext,
78
+ defaultHarness,
79
+ defaultNativeModel,
80
+ defaultCursorModel,
81
+ serverStandingContext,
82
+ serverDefaultHarness,
83
+ serverDefaultNativeModel,
84
+ serverDefaultCursorModel,
85
+ ]);
86
+ const canSubmit = hasChanges && !isUpdating;
87
+ const handleDiscard = useCallback(() => {
88
+ setStandingContext(serverStandingContext);
89
+ setDefaultHarness(serverDefaultHarness);
90
+ setDefaultNativeModel(serverDefaultNativeModel);
91
+ setDefaultCursorModel(serverDefaultCursorModel);
92
+ clearError();
93
+ }, [
94
+ serverStandingContext,
95
+ serverDefaultHarness,
96
+ serverDefaultNativeModel,
97
+ serverDefaultCursorModel,
98
+ clearError,
99
+ ]);
100
+ const handleSubmit = useCallback(async (e) => {
101
+ e.preventDefault();
102
+ if (!canSubmit || !account)
103
+ return;
104
+ clearError();
105
+ try {
106
+ // update() is a full-spec replace: spread the complete mapped input
107
+ // so unedited spec fields survive. `preferences` is a nested message,
108
+ // so the override spreads the mapper's COMPLETE preferences too —
109
+ // fields this form does not own (added by later phases) survive.
110
+ const mapped = toIdentityAccountUpdateInput(account);
111
+ const updated = await update({
112
+ ...mapped,
113
+ preferences: {
114
+ ...mapped.preferences,
115
+ standingContext: standingContext.trim() || undefined,
116
+ defaultHarness: defaultHarness || undefined,
117
+ defaultNativeModel: defaultNativeModel || undefined,
118
+ defaultCursorModel: defaultCursorModel || undefined,
119
+ },
120
+ });
121
+ refetch();
122
+ onUpdated?.(updated);
123
+ }
124
+ catch {
125
+ // error state is managed by useUpdateIdentityAccount
126
+ }
127
+ }, [
128
+ canSubmit,
129
+ account,
130
+ standingContext,
131
+ defaultHarness,
132
+ defaultNativeModel,
133
+ defaultCursorModel,
134
+ update,
135
+ clearError,
136
+ refetch,
137
+ onUpdated,
138
+ ]);
139
+ // -----------------------------------------------------------------------
140
+ // Loading state
141
+ // -----------------------------------------------------------------------
142
+ if (isFetching && !account) {
143
+ return (_jsxs("div", { className: cn("stg:space-y-4", className), "aria-busy": "true", "aria-label": "Loading account preferences", children: [_jsx("div", { className: "stg:bg-muted-subtle stg:h-28 stg:animate-pulse stg:rounded" }), _jsx("div", { className: "stg:bg-muted-subtle stg:h-8 stg:w-32 stg:animate-pulse stg:rounded" })] }));
144
+ }
145
+ // -----------------------------------------------------------------------
146
+ // Fetch error
147
+ // -----------------------------------------------------------------------
148
+ if (fetchError) {
149
+ return (_jsxs("div", { className: cn("stg:space-y-3", className), role: "alert", children: [_jsx("p", { className: "stg:text-destructive stg:text-sm", children: getUserMessage(fetchError) }), _jsx("button", { type: "button", onClick: refetch, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"), children: "Retry" })] }));
150
+ }
151
+ if (!account)
152
+ return null;
153
+ // -----------------------------------------------------------------------
154
+ // Render
155
+ // -----------------------------------------------------------------------
156
+ return (_jsxs("form", { onSubmit: handleSubmit, className: cn("stg:space-y-4", className), children: [_jsx(StandingContextField, { id: `${baseId}-standing-context`, value: standingContext, onChange: setStandingContext, disabled: isUpdating, placeholder: "e.g. Keep answers terse. I prefer TypeScript examples. My timezone is IST.", helperText: "Shared with agents as background context \u2014 not instructions. Applies only to executions you start and is visible on those execution records." }), _jsxs("div", { className: "stg:space-y-3", children: [_jsxs("div", { children: [_jsx("h3", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Execution defaults" }), _jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Seed new sessions across your devices and the CLI. An explicit pick in the composer always wins for that device." })] }), _jsx(DefaultHarnessRadioGroup, { baseId: baseId, value: defaultHarness, onChange: setDefaultHarness, disabled: isUpdating }), _jsxs("div", { className: "stg:grid stg:gap-3 stg:sm:grid-cols-2", children: [_jsx(DefaultModelSelect, { id: `${baseId}-default-native-model`, harness: "native", label: `Default model — ${HARNESS_META.native.label}`, value: defaultNativeModel, onChange: setDefaultNativeModel, disabled: isUpdating }), _jsx(DefaultModelSelect, { id: `${baseId}-default-cursor-model`, harness: "cursor", label: `Default model — ${HARNESS_META.cursor.label}`, value: defaultCursorModel, onChange: setDefaultCursorModel, disabled: isUpdating })] })] }), updateError && (_jsx("p", { className: "stg:text-destructive stg:text-[0.65rem]", role: "alert", children: getUserMessage(updateError) })), _jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsxs("button", { type: "submit", disabled: !canSubmit, className: cn("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-40"), children: [isUpdating && _jsx(SpinnerIcon, { size: 12 }), "Save changes"] }), hasChanges && !isUpdating && (_jsx("button", { type: "button", onClick: handleDiscard, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs", "stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover"), children: "Discard" }))] })] }));
157
+ }
158
+ /**
159
+ * Only harnesses with a shipped runtime are offerable as a default — must
160
+ * stay in lockstep with the proto's `default_harness` in-list validation.
161
+ */
162
+ const OFFERABLE_HARNESSES = ["native", "cursor"];
163
+ /**
164
+ * Default-harness choice: Platform default plus each shipped harness.
165
+ * A mutually exclusive, always-visible set — radio group, not a select.
166
+ */
167
+ function DefaultHarnessRadioGroup({ baseId, value, onChange, disabled, }) {
168
+ const name = `${baseId}-default-harness`;
169
+ const options = [
170
+ { value: "", label: "Platform default" },
171
+ ...OFFERABLE_HARNESSES.map((h) => ({ value: h, label: HARNESS_META[h].label })),
172
+ ];
173
+ return (_jsxs("fieldset", { className: "stg:space-y-1", disabled: disabled, children: [_jsx("legend", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Default harness" }), _jsx("div", { className: "stg:flex stg:flex-wrap stg:gap-x-4 stg:gap-y-1", children: options.map((option) => (_jsxs("label", { className: cn("stg:inline-flex stg:cursor-pointer stg:items-center stg:gap-1.5 stg:text-xs stg:text-foreground", disabled && "stg:cursor-default stg:opacity-50"), children: [_jsx("input", { type: "radio", name: name, value: option.value, checked: value === option.value, onChange: () => onChange(option.value), disabled: disabled, className: "stg:accent-primary stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring" }), option.label] }, option.value))) })] }));
174
+ }
175
+ /**
176
+ * Per-harness default model select, fed by the harness-filtered registry.
177
+ *
178
+ * A saved model that the registry no longer lists is rendered as its own
179
+ * "(unavailable)" option so the select never lies about the stored value;
180
+ * composers self-heal such a preference to the platform default on read.
181
+ */
182
+ function DefaultModelSelect({ id, harness, label, value, onChange, disabled, }) {
183
+ const { models, isLoading } = useModelRegistry({ harness });
184
+ const isStale = value !== "" && !isLoading && !models.some((m) => m.modelId === value);
185
+ return (_jsxs("div", { className: "stg:space-y-1", children: [_jsx("label", { htmlFor: id, className: "stg:text-xs stg:font-medium stg:text-foreground", children: label }), _jsxs("select", { id: id, value: value, onChange: (e) => onChange(e.target.value), disabled: disabled || isLoading, className: cn("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), children: [_jsx("option", { value: "", children: "Platform default" }), isStale && _jsxs("option", { value: value, children: [value, " (unavailable)"] }), models.map((model) => (_jsx("option", { value: model.modelId, children: model.displayName || model.modelId }, model.modelId)))] })] }));
186
+ }
187
+ //# sourceMappingURL=AccountPreferencesPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountPreferencesPanel.js","sourceRoot":"","sources":["../../src/identity-account/AccountPreferencesPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CA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AC"}
@@ -1,2 +1,10 @@
1
1
  export { useIdentityAccountGate, type IdentityAccountGateState, type UseIdentityAccountGateReturn, } from "./useIdentityAccountGate.js";
2
+ export { useMyIdentityAccount } from "./useMyIdentityAccount.js";
3
+ export type { UseMyIdentityAccountOptions, UseMyIdentityAccountReturn, } from "./useMyIdentityAccount.js";
4
+ export { useAccountExecutionDefaults } from "./useAccountExecutionDefaults.js";
5
+ export type { AccountExecutionDefaults } from "./useAccountExecutionDefaults.js";
6
+ export { useUpdateIdentityAccount } from "./useUpdateIdentityAccount.js";
7
+ export type { UseUpdateIdentityAccountReturn } from "./useUpdateIdentityAccount.js";
8
+ export { AccountPreferencesPanel } from "./AccountPreferencesPanel.js";
9
+ export type { AccountPreferencesPanelProps } from "./AccountPreferencesPanel.js";
2
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,2 +1,6 @@
1
1
  export { useIdentityAccountGate, } from "./useIdentityAccountGate.js";
2
+ export { useMyIdentityAccount } from "./useMyIdentityAccount.js";
3
+ export { useAccountExecutionDefaults } from "./useAccountExecutionDefaults.js";
4
+ export { useUpdateIdentityAccount } from "./useUpdateIdentityAccount.js";
5
+ export { AccountPreferencesPanel } from "./AccountPreferencesPanel.js";
2
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GAGvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAKjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { HarnessOption } from "../models/harness.js";
2
+ /**
3
+ * The current user's account-level execution defaults, shaped for the
4
+ * session launcher's `accountDefaults` prop.
5
+ */
6
+ export interface AccountExecutionDefaults {
7
+ /** Preferred harness for new sessions, when declared. */
8
+ readonly harness?: HarnessOption;
9
+ /** Preferred model for native-harness sessions, when declared. */
10
+ readonly nativeModel?: string;
11
+ /** Preferred model for cursor-harness sessions, when declared. */
12
+ readonly cursorModel?: string;
13
+ }
14
+ /**
15
+ * Data hook that reads the current user's execution defaults
16
+ * (`IdentityAccountSpec.preferences.default_*`) for seeding new-session
17
+ * composers.
18
+ *
19
+ * Returns `undefined` in local mode (no IdentityAccount), while loading,
20
+ * on error, and when no default is declared — every one of those cases
21
+ * degrades to the platform's existing defaults, so consumers wire the
22
+ * result straight through:
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <NewSessionViewer org={org} accountDefaults={useAccountExecutionDefaults()} />
27
+ * ```
28
+ *
29
+ * The defaults are a SEED, not an override: an explicit device-local pick
30
+ * outranks them (the layered precedence in `useNewSessionFlow`), and the
31
+ * chosen values ride the execution spec explicitly. Rides
32
+ * `useMyIdentityAccount`'s cross-mount cache, so the seed is available
33
+ * synchronously on every visit after the first.
34
+ */
35
+ export declare function useAccountExecutionDefaults(): AccountExecutionDefaults | undefined;
36
+ //# sourceMappingURL=useAccountExecutionDefaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccountExecutionDefaults.d.ts","sourceRoot":"","sources":["../../src/identity-account/useAccountExecutionDefaults.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,IAAI,wBAAwB,GAAG,SAAS,CAqBlF"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { useMyIdentityAccount } from "./useMyIdentityAccount.js";
4
+ import { useResourceAvailable, ApiResourceKind } from "../deployment-mode.js";
5
+ /**
6
+ * Data hook that reads the current user's execution defaults
7
+ * (`IdentityAccountSpec.preferences.default_*`) for seeding new-session
8
+ * composers.
9
+ *
10
+ * Returns `undefined` in local mode (no IdentityAccount), while loading,
11
+ * on error, and when no default is declared — every one of those cases
12
+ * degrades to the platform's existing defaults, so consumers wire the
13
+ * result straight through:
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <NewSessionViewer org={org} accountDefaults={useAccountExecutionDefaults()} />
18
+ * ```
19
+ *
20
+ * The defaults are a SEED, not an override: an explicit device-local pick
21
+ * outranks them (the layered precedence in `useNewSessionFlow`), and the
22
+ * chosen values ride the execution spec explicitly. Rides
23
+ * `useMyIdentityAccount`'s cross-mount cache, so the seed is available
24
+ * synchronously on every visit after the first.
25
+ */
26
+ export function useAccountExecutionDefaults() {
27
+ const available = useResourceAvailable(ApiResourceKind.identity_account);
28
+ const { account } = useMyIdentityAccount({ enabled: available });
29
+ return useMemo(() => {
30
+ const prefs = account?.spec?.preferences;
31
+ if (!prefs)
32
+ return undefined;
33
+ // The proto validates default_harness to the shipped set, but a client
34
+ // must not trust persisted data it did not write — unknown values are
35
+ // treated as undeclared.
36
+ const harness = prefs.defaultHarness === "native" || prefs.defaultHarness === "cursor"
37
+ ? prefs.defaultHarness
38
+ : undefined;
39
+ const nativeModel = prefs.defaultNativeModel || undefined;
40
+ const cursorModel = prefs.defaultCursorModel || undefined;
41
+ if (!harness && !nativeModel && !cursorModel)
42
+ return undefined;
43
+ return { harness, nativeModel, cursorModel };
44
+ }, [account]);
45
+ }
46
+ //# sourceMappingURL=useAccountExecutionDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccountExecutionDefaults.js","sourceRoot":"","sources":["../../src/identity-account/useAccountExecutionDefaults.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAgB9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,2BAA2B;IACzC,MAAM,SAAS,GAAG,oBAAoB,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;IACzE,MAAM,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAEjE,OAAO,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,KAAK,GAAG,OAAO,EAAE,IAAI,EAAE,WAAW,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAE7B,uEAAuE;QACvE,sEAAsE;QACtE,yBAAyB;QACzB,MAAM,OAAO,GACX,KAAK,CAAC,cAAc,KAAK,QAAQ,IAAI,KAAK,CAAC,cAAc,KAAK,QAAQ;YACpE,CAAC,CAAE,KAAK,CAAC,cAAuC;YAChD,CAAC,CAAC,SAAS,CAAC;QAChB,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,IAAI,SAAS,CAAC;QAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,kBAAkB,IAAI,SAAS,CAAC;QAE1D,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QAC/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IAC/C,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
2
+ /** Options for {@link useMyIdentityAccount}. */
3
+ export interface UseMyIdentityAccountOptions {
4
+ /**
5
+ * When `false`, the hook is idle: no RPC is issued and `account` stays
6
+ * `null`. Lets always-called hooks (React's rules) skip the doomed
7
+ * whoAmI against a local server — pass
8
+ * `useResourceAvailable(ApiResourceKind.identity_account)` here.
9
+ *
10
+ * @default true
11
+ */
12
+ readonly enabled?: boolean;
13
+ }
14
+ /** Return value of {@link useMyIdentityAccount}. */
15
+ export interface UseMyIdentityAccountReturn {
16
+ /** The authenticated user's identity account, or `null` while loading / on error. */
17
+ readonly account: IdentityAccount | null;
18
+ /** `true` while the initial fetch is in flight. */
19
+ readonly isLoading: boolean;
20
+ /** `true` while a background refetch is in flight and stale data is shown. */
21
+ readonly isRefetching: boolean;
22
+ /** Error from the last failed request, or `null` when healthy. */
23
+ readonly error: Error | null;
24
+ /** Re-fetch the account from the server (e.g. after an update). */
25
+ readonly refetch: () => void;
26
+ }
27
+ /**
28
+ * Data hook that fetches the current authenticated user's full
29
+ * {@link IdentityAccount} via `identityAccount.whoAmI()`.
30
+ *
31
+ * Unlike {@link useWhoAmI} (a cached identity lookup for "is this me?"
32
+ * checks), this hook is a refetchable data source for editors of the
33
+ * caller's own account — after a mutation, call `refetch()` to re-sync.
34
+ * `whoAmI()` returns the complete resource, so no follow-up `get()` is
35
+ * needed.
36
+ *
37
+ * Cloud-only by nature: the OSS local server does not implement
38
+ * IdentityAccount. Gate consumers with
39
+ * `useResourceAvailable(ApiResourceKind.identity_account)` — either by
40
+ * conditional mounting or via {@link UseMyIdentityAccountOptions.enabled}.
41
+ *
42
+ * Cached across mounts under a {@link FetchCacheProvider} (DD-014): a
43
+ * revisit renders the previous result immediately and refetches in the
44
+ * background, so consumers that seed UI from the account (e.g. composer
45
+ * defaults) settle synchronously after the first visit.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * const { account, refetch } = useMyIdentityAccount();
50
+ * const standingContext =
51
+ * account?.spec?.preferences?.standingContext ?? "";
52
+ * ```
53
+ */
54
+ export declare function useMyIdentityAccount(options?: UseMyIdentityAccountOptions): UseMyIdentityAccountReturn;
55
+ //# sourceMappingURL=useMyIdentityAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMyIdentityAccount.d.ts","sourceRoot":"","sources":["../../src/identity-account/useMyIdentityAccount.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAIhG,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,oDAAoD;AACpD,MAAM,WAAW,0BAA0B;IACzC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,2BAA2B,GACpC,0BAA0B,CAY5B"}
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { useStigmer } from "../hooks.js";
3
+ import { useFetch } from "../internal/useFetch.js";
4
+ /**
5
+ * Data hook that fetches the current authenticated user's full
6
+ * {@link IdentityAccount} via `identityAccount.whoAmI()`.
7
+ *
8
+ * Unlike {@link useWhoAmI} (a cached identity lookup for "is this me?"
9
+ * checks), this hook is a refetchable data source for editors of the
10
+ * caller's own account — after a mutation, call `refetch()` to re-sync.
11
+ * `whoAmI()` returns the complete resource, so no follow-up `get()` is
12
+ * needed.
13
+ *
14
+ * Cloud-only by nature: the OSS local server does not implement
15
+ * IdentityAccount. Gate consumers with
16
+ * `useResourceAvailable(ApiResourceKind.identity_account)` — either by
17
+ * conditional mounting or via {@link UseMyIdentityAccountOptions.enabled}.
18
+ *
19
+ * Cached across mounts under a {@link FetchCacheProvider} (DD-014): a
20
+ * revisit renders the previous result immediately and refetches in the
21
+ * background, so consumers that seed UI from the account (e.g. composer
22
+ * defaults) settle synchronously after the first visit.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * const { account, refetch } = useMyIdentityAccount();
27
+ * const standingContext =
28
+ * account?.spec?.preferences?.standingContext ?? "";
29
+ * ```
30
+ */
31
+ export function useMyIdentityAccount(options) {
32
+ const stigmer = useStigmer();
33
+ const enabled = options?.enabled ?? true;
34
+ const { data: account, isLoading, isRefetching, error, refetch } = useFetch(enabled ? () => stigmer.identityAccount.whoAmI() : null, [stigmer, enabled], null, { cacheKey: enabled ? "identity-account:me" : undefined });
35
+ return { account, isLoading, isRefetching, error, refetch };
36
+ }
37
+ //# sourceMappingURL=useMyIdentityAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMyIdentityAccount.js","sourceRoot":"","sources":["../../src/identity-account/useMyIdentityAccount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AA6BnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAqC;IAErC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC;IAEzC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,QAAQ,CACzE,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,EACvD,CAAC,OAAO,EAAE,OAAO,CAAC,EAClB,IAA8B,EAC9B,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,EAAE,CAC1D,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { IdentityAccountInput } from "@stigmer/sdk";
2
+ import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
3
+ /** Return value of {@link useUpdateIdentityAccount}. */
4
+ export interface UseUpdateIdentityAccountReturn {
5
+ /** Submit an {@link IdentityAccountInput} to update an identity account. Resolves with the updated resource. */
6
+ readonly update: (input: IdentityAccountInput) => Promise<IdentityAccount>;
7
+ /** `true` while the update request is in flight. */
8
+ readonly isUpdating: boolean;
9
+ /** Error from the last failed update, or `null` when healthy. */
10
+ readonly error: Error | null;
11
+ /** Reset `error` to `null`. */
12
+ readonly clearError: () => void;
13
+ }
14
+ /**
15
+ * Mutation hook that wraps `identityAccount.update()` with loading and
16
+ * error state.
17
+ *
18
+ * The update RPC is a full-spec replacement addressed by `org` + `slug`
19
+ * (the generated input carries no id). Build the input from the loaded
20
+ * resource with `toIdentityAccountUpdateInput` from `@stigmer/sdk` and
21
+ * override only the fields being edited — sending a partial input wipes
22
+ * the unsent spec fields. The same rule applies INSIDE nested messages:
23
+ * override `preferences` by spreading the mapper's complete value first,
24
+ * or the untouched preference fields wipe.
25
+ *
26
+ * Self-service: a user can always update their own account (`can_edit`
27
+ * via the self-ownership relationship written at account creation).
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * const { update, isUpdating, error } = useUpdateIdentityAccount();
32
+ *
33
+ * const mapped = toIdentityAccountUpdateInput(account);
34
+ * await update({
35
+ * ...mapped,
36
+ * preferences: { ...mapped.preferences, standingContext: "Keep answers terse." },
37
+ * });
38
+ * refetch(); // re-sync the editor
39
+ * ```
40
+ */
41
+ export declare function useUpdateIdentityAccount(): UseUpdateIdentityAccountReturn;
42
+ //# sourceMappingURL=useUpdateIdentityAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateIdentityAccount.d.ts","sourceRoot":"","sources":["../../src/identity-account/useUpdateIdentityAccount.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAIhG,wDAAwD;AACxD,MAAM,WAAW,8BAA8B;IAC7C,gHAAgH;IAChH,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3E,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,wBAAwB,IAAI,8BAA8B,CAyBzE"}
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { useCallback, useState } from "react";
3
+ import { useStigmer } from "../hooks.js";
4
+ import { toError } from "../internal/toError.js";
5
+ /**
6
+ * Mutation hook that wraps `identityAccount.update()` with loading and
7
+ * error state.
8
+ *
9
+ * The update RPC is a full-spec replacement addressed by `org` + `slug`
10
+ * (the generated input carries no id). Build the input from the loaded
11
+ * resource with `toIdentityAccountUpdateInput` from `@stigmer/sdk` and
12
+ * override only the fields being edited — sending a partial input wipes
13
+ * the unsent spec fields. The same rule applies INSIDE nested messages:
14
+ * override `preferences` by spreading the mapper's complete value first,
15
+ * or the untouched preference fields wipe.
16
+ *
17
+ * Self-service: a user can always update their own account (`can_edit`
18
+ * via the self-ownership relationship written at account creation).
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const { update, isUpdating, error } = useUpdateIdentityAccount();
23
+ *
24
+ * const mapped = toIdentityAccountUpdateInput(account);
25
+ * await update({
26
+ * ...mapped,
27
+ * preferences: { ...mapped.preferences, standingContext: "Keep answers terse." },
28
+ * });
29
+ * refetch(); // re-sync the editor
30
+ * ```
31
+ */
32
+ export function useUpdateIdentityAccount() {
33
+ const stigmer = useStigmer();
34
+ const [isUpdating, setIsUpdating] = useState(false);
35
+ const [error, setError] = useState(null);
36
+ const clearError = useCallback(() => setError(null), []);
37
+ const update = useCallback(async (input) => {
38
+ setIsUpdating(true);
39
+ setError(null);
40
+ try {
41
+ return await stigmer.identityAccount.update(input);
42
+ }
43
+ catch (err) {
44
+ setError(toError(err));
45
+ throw err;
46
+ }
47
+ finally {
48
+ setIsUpdating(false);
49
+ }
50
+ }, [stigmer]);
51
+ return { update, isUpdating, error, clearError };
52
+ }
53
+ //# sourceMappingURL=useUpdateIdentityAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateIdentityAccount.js","sourceRoot":"","sources":["../../src/identity-account/useUpdateIdentityAccount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAcjD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAA2B,EAA4B,EAAE;QAC9D,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateIdentityProviderForm.d.ts","sourceRoot":"","sources":["../../src/identity-provider/CreateIdentityProviderForm.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAKlG,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,+BAA+B,2CA8OjC"}
1
+ {"version":3,"file":"CreateIdentityProviderForm.d.ts","sourceRoot":"","sources":["../../src/identity-provider/CreateIdentityProviderForm.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAKlG,oDAAoD;AACpD,MAAM,WAAW,+BAA+B;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACrD,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,GAAG,EACH,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,+BAA+B,2CA8OjC"}
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useCallback, useId, useState } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
+ import { UNSTYLED_FIELDSET } from "../internal/element-resets.js";
5
6
  import { getUserMessage } from "@stigmer/sdk";
6
7
  import { IamRole } from "@stigmer/protos/ai/stigmer/iam/v1/enum_pb";
7
8
  import { useCreateIdentityProvider } from "./useCreateIdentityProvider.js";
@@ -146,7 +147,7 @@ function JitSection({ isSso, autoProvision, onAutoProvisionChange, autoGrant, on
146
147
  if (isSso) {
147
148
  return (_jsx("div", { className: "stg:rounded-md stg:border stg:border-border-muted stg:bg-muted-faint stg:px-3 stg:py-2", children: _jsxs("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: ["SSO providers automatically provision accounts and grant the", " ", _jsx("span", { className: "stg:font-medium stg:text-foreground", children: "viewer" }), " role on the owning organization. JIT provisioning settings are not applicable."] }) }));
148
149
  }
149
- return (_jsxs("fieldset", { className: "stg:space-y-2.5", disabled: disabled, children: [_jsx("hr", { className: "stg:border-border-muted" }), _jsx("legend", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "JIT provisioning" }), _jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Configure automatic account creation and role assignment for users authenticating with this provider." }), _jsx(ToggleSwitch, { checked: autoProvision, onChange: onAutoProvisionChange, label: "Auto-provision accounts", hint: "Create a federated account automatically on first authentication", disabled: disabled }), _jsx(ToggleSwitch, { checked: autoGrant, onChange: onAutoGrantChange, label: "Auto-grant on organization", hint: "Grant a role on the owning organization when an account is provisioned", disabled: disabled || !autoProvision }), autoGrant && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "stg:space-y-1", children: [_jsx("label", { htmlFor: `${baseId}-grant-role`, className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Auto-grant role" }), _jsx("select", { id: `${baseId}-grant-role`, value: String(autoGrantRole), onChange: (e) => onAutoGrantRoleChange(Number(e.target.value)), disabled: disabled, className: cn("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), children: JIT_ROLE_OPTIONS.map((opt) => (_jsx("option", { value: opt.value, children: opt.label }, opt.value))) }), _jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Role granted automatically \u2014 org admins can upgrade later" })] }), _jsx(FormField, { id: `${baseId}-tenant-claim`, label: "Tenant org claim", value: tenantOrgClaim, onChange: onTenantOrgClaimChange, placeholder: "e.g., org_id", hint: "JWT claim name that maps to a platform-managed organization (max 256 chars)", disabled: disabled })] }))] }));
150
+ return (_jsxs("fieldset", { className: cn(UNSTYLED_FIELDSET, "stg:space-y-2.5"), disabled: disabled, children: [_jsx("hr", { className: "stg:border-border-muted" }), _jsx("legend", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "JIT provisioning" }), _jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Configure automatic account creation and role assignment for users authenticating with this provider." }), _jsx(ToggleSwitch, { checked: autoProvision, onChange: onAutoProvisionChange, label: "Auto-provision accounts", hint: "Create a federated account automatically on first authentication", disabled: disabled }), _jsx(ToggleSwitch, { checked: autoGrant, onChange: onAutoGrantChange, label: "Auto-grant on organization", hint: "Grant a role on the owning organization when an account is provisioned", disabled: disabled || !autoProvision }), autoGrant && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "stg:space-y-1", children: [_jsx("label", { htmlFor: `${baseId}-grant-role`, className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Auto-grant role" }), _jsx("select", { id: `${baseId}-grant-role`, value: String(autoGrantRole), onChange: (e) => onAutoGrantRoleChange(Number(e.target.value)), disabled: disabled, className: cn("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), children: JIT_ROLE_OPTIONS.map((opt) => (_jsx("option", { value: opt.value, children: opt.label }, opt.value))) }), _jsx("p", { className: "stg:text-[0.65rem] stg:text-muted-foreground", children: "Role granted automatically \u2014 org admins can upgrade later" })] }), _jsx(FormField, { id: `${baseId}-tenant-claim`, label: "Tenant org claim", value: tenantOrgClaim, onChange: onTenantOrgClaimChange, placeholder: "e.g., org_id", hint: "JWT claim name that maps to a platform-managed organization (max 256 chars)", disabled: disabled })] }))] }));
150
151
  }
151
152
  // ---------------------------------------------------------------------------
152
153
  // Toggle switch