@stigmer/react 3.12.2 → 3.12.4

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 (429) hide show
  1. package/access/ManageAccessDialog.d.ts.map +1 -1
  2. package/access/ManageAccessDialog.js +3 -19
  3. package/access/ManageAccessDialog.js.map +1 -1
  4. package/agent/steps/IdentityStep.d.ts.map +1 -1
  5. package/agent/steps/IdentityStep.js +2 -1
  6. package/agent/steps/IdentityStep.js.map +1 -1
  7. package/agent-instance/AgentInstanceDetailPanel.d.ts.map +1 -1
  8. package/agent-instance/AgentInstanceDetailPanel.js +2 -1
  9. package/agent-instance/AgentInstanceDetailPanel.js.map +1 -1
  10. package/agent-instance/CreateAgentInstanceDialog.d.ts.map +1 -1
  11. package/agent-instance/CreateAgentInstanceDialog.js +7 -20
  12. package/agent-instance/CreateAgentInstanceDialog.js.map +1 -1
  13. package/api-key/CreateApiKeyForm.d.ts.map +1 -1
  14. package/api-key/CreateApiKeyForm.js +2 -1
  15. package/api-key/CreateApiKeyForm.js.map +1 -1
  16. package/attachment/AttachmentImageLightbox.d.ts.map +1 -1
  17. package/attachment/AttachmentImageLightbox.js +8 -23
  18. package/attachment/AttachmentImageLightbox.js.map +1 -1
  19. package/channel/ChannelConversationsDialog.d.ts.map +1 -1
  20. package/channel/ChannelConversationsDialog.js +5 -20
  21. package/channel/ChannelConversationsDialog.js.map +1 -1
  22. package/channel/ChannelCredentialsDialog.d.ts.map +1 -1
  23. package/channel/ChannelCredentialsDialog.js +3 -19
  24. package/channel/ChannelCredentialsDialog.js.map +1 -1
  25. package/channel/ChannelTemplatesDialog.d.ts.map +1 -1
  26. package/channel/ChannelTemplatesDialog.js +6 -21
  27. package/channel/ChannelTemplatesDialog.js.map +1 -1
  28. package/channel/ConnectSlackDialog.d.ts.map +1 -1
  29. package/channel/ConnectSlackDialog.js +5 -22
  30. package/channel/ConnectSlackDialog.js.map +1 -1
  31. package/channel/ConnectWhatsAppDialog.d.ts.map +1 -1
  32. package/channel/ConnectWhatsAppDialog.js +3 -21
  33. package/channel/ConnectWhatsAppDialog.js.map +1 -1
  34. package/channel/connect/ServingAppSection.d.ts.map +1 -1
  35. package/channel/connect/ServingAppSection.js +2 -1
  36. package/channel/connect/ServingAppSection.js.map +1 -1
  37. package/channel-app/CreateChannelAppForm.d.ts.map +1 -1
  38. package/channel-app/CreateChannelAppForm.js +2 -1
  39. package/channel-app/CreateChannelAppForm.js.map +1 -1
  40. package/conversation/ConversationAttentionBanner.d.ts +23 -6
  41. package/conversation/ConversationAttentionBanner.d.ts.map +1 -1
  42. package/conversation/ConversationAttentionBanner.js +25 -10
  43. package/conversation/ConversationAttentionBanner.js.map +1 -1
  44. package/conversation/ConversationListPane.d.ts.map +1 -1
  45. package/conversation/ConversationListPane.js +26 -6
  46. package/conversation/ConversationListPane.js.map +1 -1
  47. package/conversation/ConversationTimelineView.d.ts.map +1 -1
  48. package/conversation/ConversationTimelineView.js +2 -1
  49. package/conversation/ConversationTimelineView.js.map +1 -1
  50. package/conversation/ConversationsWorkbench.d.ts.map +1 -1
  51. package/conversation/ConversationsWorkbench.js +1 -1
  52. package/conversation/ConversationsWorkbench.js.map +1 -1
  53. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
  54. package/cursor-accounts/CursorAccountsConsole.js +2 -1
  55. package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
  56. package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -1
  57. package/cursor-accounts/MemberKeysPanel.js +2 -1
  58. package/cursor-accounts/MemberKeysPanel.js.map +1 -1
  59. package/dashboard/DashboardFailedRuns.d.ts.map +1 -1
  60. package/dashboard/DashboardFailedRuns.js +2 -1
  61. package/dashboard/DashboardFailedRuns.js.map +1 -1
  62. package/dependency-graph/DependencyGraph.d.ts.map +1 -1
  63. package/dependency-graph/DependencyGraph.js +2 -1
  64. package/dependency-graph/DependencyGraph.js.map +1 -1
  65. package/dependency-graph/DependencyTreeNode.d.ts.map +1 -1
  66. package/dependency-graph/DependencyTreeNode.js +2 -1
  67. package/dependency-graph/DependencyTreeNode.js.map +1 -1
  68. package/environment/EnvironmentPicker.d.ts.map +1 -1
  69. package/environment/EnvironmentPicker.js +2 -1
  70. package/environment/EnvironmentPicker.js.map +1 -1
  71. package/error/SecretFlowErrorGuide.d.ts.map +1 -1
  72. package/error/SecretFlowErrorGuide.js +2 -1
  73. package/error/SecretFlowErrorGuide.js.map +1 -1
  74. package/execution/ApprovalCard.d.ts.map +1 -1
  75. package/execution/ApprovalCard.js +13 -3
  76. package/execution/ApprovalCard.js.map +1 -1
  77. package/execution/ArtifactContentBody.d.ts.map +1 -1
  78. package/execution/ArtifactContentBody.js +2 -1
  79. package/execution/ArtifactContentBody.js.map +1 -1
  80. package/execution/ArtifactPreviewModal.d.ts.map +1 -1
  81. package/execution/ArtifactPreviewModal.js +11 -17
  82. package/execution/ArtifactPreviewModal.js.map +1 -1
  83. package/execution/ArtifactsWidget.d.ts.map +1 -1
  84. package/execution/ArtifactsWidget.js +2 -1
  85. package/execution/ArtifactsWidget.js.map +1 -1
  86. package/execution/FileChangeProgressBar.d.ts.map +1 -1
  87. package/execution/FileChangeProgressBar.js +2 -1
  88. package/execution/FileChangeProgressBar.js.map +1 -1
  89. package/execution/TodoList.d.ts.map +1 -1
  90. package/execution/TodoList.js +2 -1
  91. package/execution/TodoList.js.map +1 -1
  92. package/execution/ToolCallItem.d.ts +3 -1
  93. package/execution/ToolCallItem.d.ts.map +1 -1
  94. package/execution/ToolCallItem.js +19 -7
  95. package/execution/ToolCallItem.js.map +1 -1
  96. package/execution/WriteBacksWidget.d.ts.map +1 -1
  97. package/execution/WriteBacksWidget.js +2 -1
  98. package/execution/WriteBacksWidget.js.map +1 -1
  99. package/execution/index.d.ts +1 -1
  100. package/execution/index.d.ts.map +1 -1
  101. package/execution/index.js +1 -1
  102. package/execution/index.js.map +1 -1
  103. package/execution/tool-categories.d.ts +37 -3
  104. package/execution/tool-categories.d.ts.map +1 -1
  105. package/execution/tool-categories.js +74 -2
  106. package/execution/tool-categories.js.map +1 -1
  107. package/execution/tool-presenter.d.ts +15 -0
  108. package/execution/tool-presenter.d.ts.map +1 -1
  109. package/execution/tool-presenter.js +7 -2
  110. package/execution/tool-presenter.js.map +1 -1
  111. package/iam-policy/PeopleWithAccess.d.ts.map +1 -1
  112. package/iam-policy/PeopleWithAccess.js +2 -1
  113. package/iam-policy/PeopleWithAccess.js.map +1 -1
  114. package/iam-policy/PrincipalPicker.d.ts.map +1 -1
  115. package/iam-policy/PrincipalPicker.js +2 -1
  116. package/iam-policy/PrincipalPicker.js.map +1 -1
  117. package/iam-policy/RoleSelector.d.ts.map +1 -1
  118. package/iam-policy/RoleSelector.js +2 -1
  119. package/iam-policy/RoleSelector.js.map +1 -1
  120. package/identity-provider/CreateIdentityProviderForm.d.ts.map +1 -1
  121. package/identity-provider/CreateIdentityProviderForm.js +2 -1
  122. package/identity-provider/CreateIdentityProviderForm.js.map +1 -1
  123. package/identity-provider/IdentityProviderDetailPanel.d.ts.map +1 -1
  124. package/identity-provider/IdentityProviderDetailPanel.js +2 -1
  125. package/identity-provider/IdentityProviderDetailPanel.js.map +1 -1
  126. package/identity-provider/IdentityProviderWizard.d.ts.map +1 -1
  127. package/identity-provider/IdentityProviderWizard.js +2 -1
  128. package/identity-provider/IdentityProviderWizard.js.map +1 -1
  129. package/index.d.ts +4 -2
  130. package/index.d.ts.map +1 -1
  131. package/index.js +4 -1
  132. package/index.js.map +1 -1
  133. package/internal/DialogShell.d.ts +77 -0
  134. package/internal/DialogShell.d.ts.map +1 -0
  135. package/internal/DialogShell.js +77 -0
  136. package/internal/DialogShell.js.map +1 -0
  137. package/internal/element-resets.d.ts +17 -0
  138. package/internal/element-resets.d.ts.map +1 -0
  139. package/internal/element-resets.js +32 -0
  140. package/internal/element-resets.js.map +1 -0
  141. package/internal/file-tree/FileTreeNode.d.ts.map +1 -1
  142. package/internal/file-tree/FileTreeNode.js +2 -1
  143. package/internal/file-tree/FileTreeNode.js.map +1 -1
  144. package/internal/markdown-components.d.ts +7 -0
  145. package/internal/markdown-components.d.ts.map +1 -1
  146. package/internal/markdown-components.js +15 -5
  147. package/internal/markdown-components.js.map +1 -1
  148. package/invitation/InvitationManager.d.ts.map +1 -1
  149. package/invitation/InvitationManager.js +2 -1
  150. package/invitation/InvitationManager.js.map +1 -1
  151. package/manifest/ApplyManifestDialog.d.ts.map +1 -1
  152. package/manifest/ApplyManifestDialog.js +8 -17
  153. package/manifest/ApplyManifestDialog.js.map +1 -1
  154. package/manifest/EditResourceYamlDialog.d.ts.map +1 -1
  155. package/manifest/EditResourceYamlDialog.js +3 -19
  156. package/manifest/EditResourceYamlDialog.js.map +1 -1
  157. package/mcp-server/McpServerConnectDialog.d.ts.map +1 -1
  158. package/mcp-server/McpServerConnectDialog.js +8 -20
  159. package/mcp-server/McpServerConnectDialog.js.map +1 -1
  160. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  161. package/mcp-server/McpServerDetailView.js +4 -15
  162. package/mcp-server/McpServerDetailView.js.map +1 -1
  163. package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -1
  164. package/mcp-server/steps/IdentityTransportStep.js +2 -1
  165. package/mcp-server/steps/IdentityTransportStep.js.map +1 -1
  166. package/package.json +4 -4
  167. package/platform-client/CreatePlatformClientForm.d.ts.map +1 -1
  168. package/platform-client/CreatePlatformClientForm.js +2 -1
  169. package/platform-client/CreatePlatformClientForm.js.map +1 -1
  170. package/platform-client/PlatformClientDetailPanel.d.ts.map +1 -1
  171. package/platform-client/PlatformClientDetailPanel.js +2 -1
  172. package/platform-client/PlatformClientDetailPanel.js.map +1 -1
  173. package/pricing-governance/BaselineEditor.d.ts.map +1 -1
  174. package/pricing-governance/BaselineEditor.js +2 -1
  175. package/pricing-governance/BaselineEditor.js.map +1 -1
  176. package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -1
  177. package/pricing-governance/PricingGovernanceConsole.js +2 -1
  178. package/pricing-governance/PricingGovernanceConsole.js.map +1 -1
  179. package/provider-standing/ProviderStandingAccessNotice.d.ts +11 -0
  180. package/provider-standing/ProviderStandingAccessNotice.d.ts.map +1 -0
  181. package/provider-standing/ProviderStandingAccessNotice.js +14 -0
  182. package/provider-standing/ProviderStandingAccessNotice.js.map +1 -0
  183. package/provider-standing/ProviderStandingConsole.d.ts +24 -0
  184. package/provider-standing/ProviderStandingConsole.d.ts.map +1 -0
  185. package/provider-standing/ProviderStandingConsole.js +98 -0
  186. package/provider-standing/ProviderStandingConsole.js.map +1 -0
  187. package/provider-standing/index.d.ts +6 -0
  188. package/provider-standing/index.d.ts.map +1 -0
  189. package/provider-standing/index.js +6 -0
  190. package/provider-standing/index.js.map +1 -0
  191. package/provider-standing/useProviderStanding.d.ts +34 -0
  192. package/provider-standing/useProviderStanding.d.ts.map +1 -0
  193. package/provider-standing/useProviderStanding.js +26 -0
  194. package/provider-standing/useProviderStanding.js.map +1 -0
  195. package/provider.d.ts +12 -0
  196. package/provider.d.ts.map +1 -1
  197. package/provider.js +12 -0
  198. package/provider.js.map +1 -1
  199. package/resource-creation/StepIndicator.d.ts.map +1 -1
  200. package/resource-creation/StepIndicator.js +2 -1
  201. package/resource-creation/StepIndicator.js.map +1 -1
  202. package/resource-detail/ConfirmDialog.d.ts +2 -3
  203. package/resource-detail/ConfirmDialog.d.ts.map +1 -1
  204. package/resource-detail/ConfirmDialog.js +8 -20
  205. package/resource-detail/ConfirmDialog.js.map +1 -1
  206. package/schedule/ScheduleDetailView.d.ts.map +1 -1
  207. package/schedule/ScheduleDetailView.js +3 -2
  208. package/schedule/ScheduleDetailView.js.map +1 -1
  209. package/schedule/ScheduleRunsTable.d.ts.map +1 -1
  210. package/schedule/ScheduleRunsTable.js +2 -1
  211. package/schedule/ScheduleRunsTable.js.map +1 -1
  212. package/session/facets/ArtifactsTab.d.ts.map +1 -1
  213. package/session/facets/ArtifactsTab.js +2 -1
  214. package/session/facets/ArtifactsTab.js.map +1 -1
  215. package/session/facets/ChangesTab.d.ts.map +1 -1
  216. package/session/facets/ChangesTab.js +2 -1
  217. package/session/facets/ChangesTab.js.map +1 -1
  218. package/session/facets/UsageTab.d.ts +10 -3
  219. package/session/facets/UsageTab.d.ts.map +1 -1
  220. package/session/facets/UsageTab.js +42 -6
  221. package/session/facets/UsageTab.js.map +1 -1
  222. package/session/index.d.ts +1 -1
  223. package/session/index.d.ts.map +1 -1
  224. package/session/index.js.map +1 -1
  225. package/session/useSessionUsage.d.ts +25 -0
  226. package/session/useSessionUsage.d.ts.map +1 -1
  227. package/session/useSessionUsage.js +11 -0
  228. package/session/useSessionUsage.js.map +1 -1
  229. package/settings/settings-nav.d.ts.map +1 -1
  230. package/settings/settings-nav.js +7 -1
  231. package/settings/settings-nav.js.map +1 -1
  232. package/settings/useSettingsNavGroups.d.ts.map +1 -1
  233. package/settings/useSettingsNavGroups.js +4 -1
  234. package/settings/useSettingsNavGroups.js.map +1 -1
  235. package/sharing/ShareAgentDialog.d.ts.map +1 -1
  236. package/sharing/ShareAgentDialog.js +4 -21
  237. package/sharing/ShareAgentDialog.js.map +1 -1
  238. package/sidebar/WorkspaceSidebar.d.ts.map +1 -1
  239. package/sidebar/WorkspaceSidebar.js +2 -1
  240. package/sidebar/WorkspaceSidebar.js.map +1 -1
  241. package/skill/SkillDiffDialog.d.ts.map +1 -1
  242. package/skill/SkillDiffDialog.js +5 -21
  243. package/skill/SkillDiffDialog.js.map +1 -1
  244. package/skill/SkillFileBrowser.d.ts.map +1 -1
  245. package/skill/SkillFileBrowser.js +2 -1
  246. package/skill/SkillFileBrowser.js.map +1 -1
  247. package/skill/internal/fetchAndUnpackArtifact.d.ts +1 -1
  248. package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -1
  249. package/skill/internal/fetchAndUnpackArtifact.js +47 -3
  250. package/skill/internal/fetchAndUnpackArtifact.js.map +1 -1
  251. package/skill/useSkillDiff.d.ts.map +1 -1
  252. package/skill/useSkillDiff.js +7 -1
  253. package/skill/useSkillDiff.js.map +1 -1
  254. package/skill/useSkillUpload.d.ts.map +1 -1
  255. package/skill/useSkillUpload.js +22 -4
  256. package/skill/useSkillUpload.js.map +1 -1
  257. package/src/__tests__/bare-host-resets.layout.test.tsx +184 -0
  258. package/src/access/ManageAccessDialog.tsx +7 -27
  259. package/src/agent/steps/IdentityStep.tsx +2 -1
  260. package/src/agent-instance/AgentInstanceDetailPanel.tsx +2 -1
  261. package/src/agent-instance/CreateAgentInstanceDialog.tsx +14 -27
  262. package/src/api-key/CreateApiKeyForm.tsx +2 -1
  263. package/src/attachment/AttachmentImageLightbox.tsx +13 -36
  264. package/src/channel/ChannelConversationsDialog.tsx +10 -28
  265. package/src/channel/ChannelCredentialsDialog.tsx +8 -28
  266. package/src/channel/ChannelTemplatesDialog.tsx +12 -30
  267. package/src/channel/ConnectSlackDialog.tsx +10 -31
  268. package/src/channel/ConnectWhatsAppDialog.tsx +8 -30
  269. package/src/channel/connect/ServingAppSection.tsx +2 -1
  270. package/src/channel-app/CreateChannelAppForm.tsx +2 -1
  271. package/src/conversation/ConversationAttentionBanner.tsx +64 -19
  272. package/src/conversation/ConversationListPane.tsx +39 -17
  273. package/src/conversation/ConversationTimelineView.tsx +2 -1
  274. package/src/conversation/ConversationsWorkbench.tsx +1 -0
  275. package/src/conversation/__tests__/ConversationAttentionBanner.test.tsx +76 -2
  276. package/src/conversation/__tests__/ConversationListPane.test.tsx +15 -4
  277. package/src/cursor-accounts/CursorAccountsConsole.tsx +2 -1
  278. package/src/cursor-accounts/MemberKeysPanel.tsx +2 -1
  279. package/src/dashboard/DashboardFailedRuns.tsx +2 -1
  280. package/src/dependency-graph/DependencyGraph.tsx +2 -1
  281. package/src/dependency-graph/DependencyTreeNode.tsx +2 -1
  282. package/src/environment/EnvironmentPicker.tsx +2 -1
  283. package/src/error/SecretFlowErrorGuide.tsx +3 -2
  284. package/src/execution/ApprovalCard.tsx +23 -2
  285. package/src/execution/ArtifactContentBody.tsx +2 -1
  286. package/src/execution/ArtifactPreviewModal.tsx +15 -27
  287. package/src/execution/ArtifactsWidget.tsx +2 -1
  288. package/src/execution/FileChangeProgressBar.tsx +2 -1
  289. package/src/execution/TodoList.tsx +2 -1
  290. package/src/execution/ToolCallItem.tsx +19 -8
  291. package/src/execution/WriteBacksWidget.tsx +2 -1
  292. package/src/execution/__tests__/intent-title.test.tsx +221 -0
  293. package/src/execution/index.ts +3 -0
  294. package/src/execution/tool-categories.ts +103 -5
  295. package/src/execution/tool-presenter.ts +22 -1
  296. package/src/iam-policy/PeopleWithAccess.tsx +2 -1
  297. package/src/iam-policy/PrincipalPicker.tsx +2 -0
  298. package/src/iam-policy/RoleSelector.tsx +2 -1
  299. package/src/identity-provider/CreateIdentityProviderForm.tsx +2 -1
  300. package/src/identity-provider/IdentityProviderDetailPanel.tsx +2 -1
  301. package/src/identity-provider/IdentityProviderWizard.tsx +2 -1
  302. package/src/index.ts +16 -0
  303. package/src/internal/DialogShell.tsx +169 -0
  304. package/src/internal/__tests__/DialogShell.test.tsx +223 -0
  305. package/src/internal/element-resets.ts +33 -0
  306. package/src/internal/file-tree/FileTreeNode.tsx +2 -1
  307. package/src/internal/markdown-components.tsx +15 -5
  308. package/src/invitation/InvitationManager.tsx +3 -2
  309. package/src/manifest/ApplyManifestDialog.tsx +10 -27
  310. package/src/manifest/EditResourceYamlDialog.tsx +4 -31
  311. package/src/mcp-server/McpServerConnectDialog.tsx +15 -29
  312. package/src/mcp-server/McpServerDetailView.tsx +12 -24
  313. package/src/mcp-server/steps/IdentityTransportStep.tsx +3 -2
  314. package/src/platform-client/CreatePlatformClientForm.tsx +4 -3
  315. package/src/platform-client/PlatformClientDetailPanel.tsx +4 -3
  316. package/src/pricing-governance/BaselineEditor.tsx +3 -2
  317. package/src/pricing-governance/PricingGovernanceConsole.tsx +2 -1
  318. package/src/provider-standing/ProviderStandingAccessNotice.tsx +36 -0
  319. package/src/provider-standing/ProviderStandingConsole.tsx +216 -0
  320. package/src/provider-standing/__tests__/ProviderStandingConsole.test.tsx +143 -0
  321. package/src/provider-standing/index.ts +8 -0
  322. package/src/provider-standing/useProviderStanding.ts +50 -0
  323. package/src/provider.tsx +12 -0
  324. package/src/resource-creation/StepIndicator.tsx +2 -1
  325. package/src/resource-detail/ConfirmDialog.tsx +9 -30
  326. package/src/schedule/ScheduleDetailView.tsx +3 -2
  327. package/src/schedule/ScheduleRunsTable.tsx +2 -1
  328. package/src/session/__tests__/UsageTab.test.tsx +136 -0
  329. package/src/session/__tests__/useSessionUsage.test.ts +19 -0
  330. package/src/session/facets/ArtifactsTab.tsx +2 -1
  331. package/src/session/facets/ChangesTab.tsx +2 -1
  332. package/src/session/facets/UsageTab.tsx +98 -6
  333. package/src/session/index.ts +1 -0
  334. package/src/session/useSessionUsage.ts +37 -0
  335. package/src/settings/__tests__/useSettingsNavGroups.test.tsx +11 -1
  336. package/src/settings/settings-nav.ts +7 -0
  337. package/src/settings/useSettingsNavGroups.ts +8 -1
  338. package/src/sharing/ShareAgentDialog.tsx +9 -30
  339. package/src/sidebar/WorkspaceSidebar.tsx +2 -1
  340. package/src/skill/SkillDiffDialog.tsx +13 -36
  341. package/src/skill/SkillFileBrowser.tsx +2 -1
  342. package/src/skill/__tests__/SkillFileBrowser.test.tsx +10 -2
  343. package/src/skill/__tests__/fetchAndUnpackArtifact.test.ts +90 -0
  344. package/src/skill/__tests__/useSkillUpload.test.ts +69 -0
  345. package/src/skill/internal/fetchAndUnpackArtifact.ts +54 -4
  346. package/src/skill/useSkillDiff.ts +7 -1
  347. package/src/skill/useSkillUpload.ts +25 -6
  348. package/src/workflow/FailedRunsWidget.tsx +2 -1
  349. package/src/workflow/PendingApprovalsWidget.tsx +2 -1
  350. package/src/workflow/ViewYamlDialog.tsx +18 -37
  351. package/src/workflow/WorkflowArchitectDialog.tsx +11 -43
  352. package/src/workflow/WorkflowExplainDialog.tsx +11 -37
  353. package/src/workflow/WorkflowGraphFullscreenDialog.tsx +14 -26
  354. package/src/workflow/WorkflowRunDialog.tsx +21 -48
  355. package/src/workflow/execution-comparison/ExecutionComparisonPicker.tsx +14 -31
  356. package/src/workflow/facets/WorkflowArtifactsTab.tsx +2 -1
  357. package/src/workflow/facets/WorkflowUsageTab.tsx +2 -1
  358. package/src/workflow/inspector/WorkflowSummaryPanel.tsx +2 -1
  359. package/src/workflow/inspector/tabs/BranchesTab.tsx +2 -1
  360. package/src/workflow/inspector/tabs/IterationTab.tsx +2 -1
  361. package/src/workflow/instance/CreateWorkflowInstanceDialog.tsx +14 -27
  362. package/src/workflow/instance/WorkflowInstanceDetailPanel.tsx +2 -1
  363. package/src/workflow/templates/WorkflowTemplatePreview.tsx +18 -28
  364. package/src/workspace/ExplorerTree.tsx +2 -1
  365. package/src/workspace/WorkspaceContentSearch.tsx +2 -1
  366. package/src/workspace/WorkspaceFileSearch.tsx +2 -1
  367. package/src/workspace/WorkspaceSummary.tsx +2 -1
  368. package/styles.css +1 -1
  369. package/workflow/FailedRunsWidget.d.ts.map +1 -1
  370. package/workflow/FailedRunsWidget.js +2 -1
  371. package/workflow/FailedRunsWidget.js.map +1 -1
  372. package/workflow/PendingApprovalsWidget.d.ts.map +1 -1
  373. package/workflow/PendingApprovalsWidget.js +2 -1
  374. package/workflow/PendingApprovalsWidget.js.map +1 -1
  375. package/workflow/ViewYamlDialog.d.ts.map +1 -1
  376. package/workflow/ViewYamlDialog.js +10 -29
  377. package/workflow/ViewYamlDialog.js.map +1 -1
  378. package/workflow/WorkflowArchitectDialog.d.ts.map +1 -1
  379. package/workflow/WorkflowArchitectDialog.js +5 -24
  380. package/workflow/WorkflowArchitectDialog.js.map +1 -1
  381. package/workflow/WorkflowExplainDialog.d.ts.map +1 -1
  382. package/workflow/WorkflowExplainDialog.js +5 -21
  383. package/workflow/WorkflowExplainDialog.js.map +1 -1
  384. package/workflow/WorkflowGraphFullscreenDialog.d.ts.map +1 -1
  385. package/workflow/WorkflowGraphFullscreenDialog.js +11 -17
  386. package/workflow/WorkflowGraphFullscreenDialog.js.map +1 -1
  387. package/workflow/WorkflowRunDialog.d.ts.map +1 -1
  388. package/workflow/WorkflowRunDialog.js +13 -29
  389. package/workflow/WorkflowRunDialog.js.map +1 -1
  390. package/workflow/execution-comparison/ExecutionComparisonPicker.d.ts.map +1 -1
  391. package/workflow/execution-comparison/ExecutionComparisonPicker.js +8 -26
  392. package/workflow/execution-comparison/ExecutionComparisonPicker.js.map +1 -1
  393. package/workflow/facets/WorkflowArtifactsTab.d.ts.map +1 -1
  394. package/workflow/facets/WorkflowArtifactsTab.js +2 -1
  395. package/workflow/facets/WorkflowArtifactsTab.js.map +1 -1
  396. package/workflow/facets/WorkflowUsageTab.d.ts.map +1 -1
  397. package/workflow/facets/WorkflowUsageTab.js +2 -1
  398. package/workflow/facets/WorkflowUsageTab.js.map +1 -1
  399. package/workflow/inspector/WorkflowSummaryPanel.d.ts.map +1 -1
  400. package/workflow/inspector/WorkflowSummaryPanel.js +2 -1
  401. package/workflow/inspector/WorkflowSummaryPanel.js.map +1 -1
  402. package/workflow/inspector/tabs/BranchesTab.d.ts.map +1 -1
  403. package/workflow/inspector/tabs/BranchesTab.js +2 -1
  404. package/workflow/inspector/tabs/BranchesTab.js.map +1 -1
  405. package/workflow/inspector/tabs/IterationTab.d.ts.map +1 -1
  406. package/workflow/inspector/tabs/IterationTab.js +2 -1
  407. package/workflow/inspector/tabs/IterationTab.js.map +1 -1
  408. package/workflow/instance/CreateWorkflowInstanceDialog.d.ts.map +1 -1
  409. package/workflow/instance/CreateWorkflowInstanceDialog.js +7 -20
  410. package/workflow/instance/CreateWorkflowInstanceDialog.js.map +1 -1
  411. package/workflow/instance/WorkflowInstanceDetailPanel.d.ts.map +1 -1
  412. package/workflow/instance/WorkflowInstanceDetailPanel.js +2 -1
  413. package/workflow/instance/WorkflowInstanceDetailPanel.js.map +1 -1
  414. package/workflow/templates/WorkflowTemplatePreview.d.ts +1 -1
  415. package/workflow/templates/WorkflowTemplatePreview.d.ts.map +1 -1
  416. package/workflow/templates/WorkflowTemplatePreview.js +10 -22
  417. package/workflow/templates/WorkflowTemplatePreview.js.map +1 -1
  418. package/workspace/ExplorerTree.d.ts.map +1 -1
  419. package/workspace/ExplorerTree.js +2 -1
  420. package/workspace/ExplorerTree.js.map +1 -1
  421. package/workspace/WorkspaceContentSearch.d.ts.map +1 -1
  422. package/workspace/WorkspaceContentSearch.js +2 -1
  423. package/workspace/WorkspaceContentSearch.js.map +1 -1
  424. package/workspace/WorkspaceFileSearch.d.ts.map +1 -1
  425. package/workspace/WorkspaceFileSearch.js +2 -1
  426. package/workspace/WorkspaceFileSearch.js.map +1 -1
  427. package/workspace/WorkspaceSummary.d.ts.map +1 -1
  428. package/workspace/WorkspaceSummary.js +2 -1
  429. package/workspace/WorkspaceSummary.js.map +1 -1
package/src/index.ts CHANGED
@@ -196,6 +196,7 @@ export type {
196
196
  UseSessionFileChangesReturn,
197
197
  ModelCostEntry,
198
198
  UseSessionUsageReturn,
199
+ ExecutionUsageEntry,
199
200
  UseAgentRefFromSessionReturn,
200
201
  UseNewSessionFlowOptions,
201
202
  UseNewSessionFlowReturn,
@@ -296,6 +297,9 @@ export {
296
297
  toolKindToCategoryInfo,
297
298
  defaultDisclosureForCategory,
298
299
  extractPrimaryArg,
300
+ extractShellIntent,
301
+ extractShellIntentFromPreview,
302
+ SHELL_INTENT_ARG_FIELD,
299
303
  McpToolDetail,
300
304
  parseMcpResult,
301
305
  formatDuration,
@@ -1039,6 +1043,18 @@ export type {
1039
1043
  CursorAccountEditorProps,
1040
1044
  } from "./cursor-accounts/index.js";
1041
1045
 
1046
+ // Provider standing — read-only platform-operator view of the platform's
1047
+ // LLM provider account health (canary-probe verdicts, cloud#447)
1048
+ export {
1049
+ useProviderStanding,
1050
+ ProviderStandingConsole,
1051
+ ProviderStandingAccessNotice,
1052
+ } from "./provider-standing/index.js";
1053
+ export type {
1054
+ UseProviderStandingReturn,
1055
+ ProviderStandingConsoleProps,
1056
+ } from "./provider-standing/index.js";
1057
+
1042
1058
  // Settings — navigation structure + section components shared across app shells
1043
1059
  export {
1044
1060
  SETTINGS_NAV_GROUPS,
@@ -0,0 +1,169 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useRef } from "react";
4
+ import type { MouseEvent, ReactNode, SyntheticEvent } from "react";
5
+ import { cn } from "@stigmer/theme";
6
+
7
+ /**
8
+ * Width presets for {@link DialogShell}, mapping to Tailwind `max-w-*`
9
+ * utilities. Free-form sizes (e.g. a lightbox's `85vw`) ride `className`,
10
+ * which wins over the preset via `cn()`'s tailwind-merge.
11
+ */
12
+ export type DialogShellWidth = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
13
+
14
+ const WIDTH_CLASS: Record<DialogShellWidth, string> = {
15
+ sm: "stg:max-w-sm",
16
+ md: "stg:max-w-md",
17
+ lg: "stg:max-w-lg",
18
+ xl: "stg:max-w-xl",
19
+ "2xl": "stg:max-w-2xl",
20
+ "3xl": "stg:max-w-3xl",
21
+ "4xl": "stg:max-w-4xl",
22
+ };
23
+
24
+ /** Props for {@link DialogShell}. */
25
+ export interface DialogShellProps {
26
+ /** Whether the dialog is open (controlled — the SDK dialog convention). */
27
+ readonly open: boolean;
28
+ /**
29
+ * Called with `false` when the dialog should close: Escape / the platform
30
+ * cancel gesture, or a native close the host did not drive (e.g. a
31
+ * `method="dialog"` form submit). The shell never closes itself — state
32
+ * stays authoritative, so a host that ignores the callback keeps the
33
+ * dialog open (matching the pre-extraction per-dialog behavior).
34
+ */
35
+ readonly onOpenChange: (open: boolean) => void;
36
+ /** Max-width preset (default `"md"`). See {@link DialogShellWidth}. */
37
+ readonly width?: DialogShellWidth;
38
+ /**
39
+ * Modal (default) renders in the top layer via `showModal()` — focus trap,
40
+ * Escape, and the token backdrop. `modal={false}` renders the dialog
41
+ * in-flow (`open` attribute, relative positioning, no backdrop, no focus
42
+ * trap) — the channel-dialog embedding mode.
43
+ */
44
+ readonly modal?: boolean;
45
+ /**
46
+ * Light dismiss: a click on the backdrop (the dialog element itself —
47
+ * clicks inside the content land on descendants) reports close intent.
48
+ * The house rule from the pre-extraction census: read-only viewers
49
+ * (diff/YAML/explain/lightbox/pickers) dismiss on backdrop, form dialogs
50
+ * do NOT — a stray click must never discard a half-filled form. Default
51
+ * `false`.
52
+ */
53
+ readonly dismissOnBackdrop?: boolean;
54
+ /**
55
+ * Merged after the shell's own chrome, so deliberate outliers (a
56
+ * lightbox's viewport sizing, a fullscreen graph's `h-[90vh]`, a
57
+ * `bg-background` surface) override the defaults per class.
58
+ */
59
+ readonly className?: string;
60
+ /** Dialog content. Lazy-mounting bodies (`{open && …}`) stay caller-owned. */
61
+ readonly children: ReactNode;
62
+ /** Accessible name, when no visible heading labels the dialog. */
63
+ readonly "aria-label"?: string;
64
+ /** Id of the visible heading that labels the dialog. */
65
+ readonly "aria-labelledby"?: string;
66
+ }
67
+
68
+ /**
69
+ * The one dialog shell (stigmer#653). Owns everything every modal dialog in
70
+ * the SDK used to re-transcribe by hand: the `<dialog>` element and its
71
+ * `showModal()`/`close()` lifecycle, cancel/Escape wiring, the token
72
+ * backdrop (`--stgm-backdrop`), the open animation, and the base
73
+ * positioning/chrome — parameterized by {@link DialogShellWidth}.
74
+ *
75
+ * Converged chrome: `rounded-xl` + `shadow-xl` on the `popover` token
76
+ * surface (the token family for top-layer content). Before the extraction
77
+ * the 24 hand-rolled shells had drifted across `rounded-lg/xl`,
78
+ * `shadow-lg/xl/2xl`, three background tokens, two hardcoded backdrops that
79
+ * escaped the #652 fence, and animation classes present on some dialogs and
80
+ * missing from others.
81
+ *
82
+ * Internal on purpose — not exported from the package until a host needs it.
83
+ * The `stigmer/no-handrolled-dialog` lint rule fences new `<dialog>`
84
+ * elements onto this shell.
85
+ *
86
+ * @example
87
+ * ```tsx
88
+ * <DialogShell open={open} onOpenChange={setOpen} width="lg" aria-labelledby={titleId}>
89
+ * {open && <MyDialogBody titleId={titleId} onClose={() => setOpen(false)} />}
90
+ * </DialogShell>
91
+ * ```
92
+ */
93
+ export function DialogShell({
94
+ open,
95
+ onOpenChange,
96
+ width = "md",
97
+ modal = true,
98
+ dismissOnBackdrop = false,
99
+ className,
100
+ children,
101
+ "aria-label": ariaLabel,
102
+ "aria-labelledby": ariaLabelledby,
103
+ }: DialogShellProps) {
104
+ const dialogRef = useRef<HTMLDialogElement>(null);
105
+
106
+ // Sync the native top-layer state to the controlled prop. Runs on mount
107
+ // too, so a shell mounted with `open` already true shows immediately.
108
+ useEffect(() => {
109
+ const dialog = dialogRef.current;
110
+ if (!dialog || !modal) return;
111
+ if (open && !dialog.open) {
112
+ dialog.showModal();
113
+ } else if (!open && dialog.open) {
114
+ dialog.close();
115
+ }
116
+ }, [open, modal]);
117
+
118
+ // Escape / platform cancel: keep the native dialog open (preventDefault)
119
+ // and report the intent — the controlled `open` prop then drives the
120
+ // actual close through the effect above.
121
+ const handleCancel = useCallback(
122
+ (e: SyntheticEvent<HTMLDialogElement>) => {
123
+ e.preventDefault();
124
+ onOpenChange(false);
125
+ },
126
+ [onOpenChange],
127
+ );
128
+
129
+ // A native close the effect did not perform (e.g. a `method="dialog"`
130
+ // form submit) must not leave the controlled state stranded open.
131
+ const handleClose = useCallback(() => {
132
+ if (open) onOpenChange(false);
133
+ }, [open, onOpenChange]);
134
+
135
+ // Backdrop clicks hit the <dialog> element itself; clicks anywhere in the
136
+ // content land on a descendant, so the target check is exact.
137
+ const handleClick = useCallback(
138
+ (e: MouseEvent<HTMLDialogElement>) => {
139
+ if (e.target === e.currentTarget) onOpenChange(false);
140
+ },
141
+ [onOpenChange],
142
+ );
143
+
144
+ return (
145
+ <dialog
146
+ ref={dialogRef}
147
+ open={modal ? undefined : open || undefined}
148
+ onCancel={modal ? handleCancel : undefined}
149
+ onClose={modal ? handleClose : undefined}
150
+ onClick={modal && dismissOnBackdrop ? handleClick : undefined}
151
+ aria-label={ariaLabel}
152
+ aria-labelledby={ariaLabelledby}
153
+ className={cn(
154
+ "stg:w-full stg:rounded-xl stg:border stg:border-border stg:bg-popover stg:p-0 stg:text-popover-foreground stg:shadow-xl",
155
+ modal
156
+ ? cn(
157
+ "stg:fixed stg:inset-0 stg:z-50 stg:m-auto",
158
+ "stg:backdrop:bg-backdrop",
159
+ "stg:open:animate-in stg:open:fade-in-0 stg:open:zoom-in-95",
160
+ )
161
+ : "stg:relative",
162
+ WIDTH_CLASS[width],
163
+ className,
164
+ )}
165
+ >
166
+ {children}
167
+ </dialog>
168
+ );
169
+ }
@@ -0,0 +1,223 @@
1
+ /**
2
+ * DialogShell (stigmer#653): the one modal shell — showModal lifecycle,
3
+ * cancel/Escape wiring with state authority, native-close sync, the token
4
+ * backdrop + converged chrome, and the non-modal in-flow mode.
5
+ */
6
+
7
+ import { describe, it, expect, vi, beforeAll, afterEach } from "vitest";
8
+ import { render, cleanup, fireEvent } from "@testing-library/react";
9
+ import { DialogShell } from "../DialogShell";
10
+
11
+ // happy-dom does not implement the native dialog show/close methods.
12
+ beforeAll(() => {
13
+ HTMLDialogElement.prototype.showModal = function showModal() {
14
+ this.open = true;
15
+ };
16
+ HTMLDialogElement.prototype.close = function close() {
17
+ this.open = false;
18
+ };
19
+ });
20
+
21
+ afterEach(cleanup);
22
+
23
+ function dialogOf(container: HTMLElement): HTMLDialogElement {
24
+ return container.querySelector("dialog")!;
25
+ }
26
+
27
+ describe("DialogShell lifecycle", () => {
28
+ it("opens via showModal when the controlled prop flips true", () => {
29
+ const { container, rerender } = render(
30
+ <DialogShell open={false} onOpenChange={() => {}}>
31
+ <p>body</p>
32
+ </DialogShell>,
33
+ );
34
+ expect(dialogOf(container).open).toBe(false);
35
+
36
+ rerender(
37
+ <DialogShell open onOpenChange={() => {}}>
38
+ <p>body</p>
39
+ </DialogShell>,
40
+ );
41
+ expect(dialogOf(container).open).toBe(true);
42
+ });
43
+
44
+ it("shows immediately when mounted already open", () => {
45
+ const { container } = render(
46
+ <DialogShell open onOpenChange={() => {}}>
47
+ <p>body</p>
48
+ </DialogShell>,
49
+ );
50
+ expect(dialogOf(container).open).toBe(true);
51
+ });
52
+
53
+ it("closes the native dialog when the controlled prop flips false", () => {
54
+ const { container, rerender } = render(
55
+ <DialogShell open onOpenChange={() => {}}>
56
+ <p>body</p>
57
+ </DialogShell>,
58
+ );
59
+ rerender(
60
+ <DialogShell open={false} onOpenChange={() => {}}>
61
+ <p>body</p>
62
+ </DialogShell>,
63
+ );
64
+ expect(dialogOf(container).open).toBe(false);
65
+ });
66
+
67
+ it("Escape/cancel reports intent but never closes on its own — state stays authoritative", () => {
68
+ const onOpenChange = vi.fn();
69
+ const { container } = render(
70
+ <DialogShell open onOpenChange={onOpenChange}>
71
+ <p>body</p>
72
+ </DialogShell>,
73
+ );
74
+
75
+ fireEvent(dialogOf(container), new Event("cancel", { cancelable: true }));
76
+
77
+ expect(onOpenChange).toHaveBeenCalledExactlyOnceWith(false);
78
+ // The shell prevented the native close; the dialog stays open until the
79
+ // host flips the prop.
80
+ expect(dialogOf(container).open).toBe(true);
81
+ });
82
+
83
+ it("syncs the controlled state when something else closes the dialog natively", () => {
84
+ const onOpenChange = vi.fn();
85
+ const { container } = render(
86
+ <DialogShell open onOpenChange={onOpenChange}>
87
+ <p>body</p>
88
+ </DialogShell>,
89
+ );
90
+
91
+ // e.g. a method="dialog" form submit closes without going through props.
92
+ const dialog = dialogOf(container);
93
+ dialog.close();
94
+ fireEvent(dialog, new Event("close"));
95
+
96
+ expect(onOpenChange).toHaveBeenCalledExactlyOnceWith(false);
97
+ });
98
+
99
+ it("does not re-report a close the host itself drove", () => {
100
+ const onOpenChange = vi.fn();
101
+ const { container, rerender } = render(
102
+ <DialogShell open onOpenChange={onOpenChange}>
103
+ <p>body</p>
104
+ </DialogShell>,
105
+ );
106
+ rerender(
107
+ <DialogShell open={false} onOpenChange={onOpenChange}>
108
+ <p>body</p>
109
+ </DialogShell>,
110
+ );
111
+ // The effect's own dialog.close() fires a native close event in real
112
+ // browsers — replay it against the now-false prop.
113
+ fireEvent(dialogOf(container), new Event("close"));
114
+ expect(onOpenChange).not.toHaveBeenCalled();
115
+ });
116
+ });
117
+
118
+ describe("DialogShell chrome", () => {
119
+ it("carries the token backdrop, animation, positioning, and width preset", () => {
120
+ const { container } = render(
121
+ <DialogShell open onOpenChange={() => {}} width="3xl">
122
+ <p>body</p>
123
+ </DialogShell>,
124
+ );
125
+ const cls = dialogOf(container).className;
126
+
127
+ expect(cls).toContain("stg:backdrop:bg-backdrop");
128
+ expect(cls).toContain("stg:open:animate-in");
129
+ expect(cls).toContain("stg:fixed");
130
+ expect(cls).toContain("stg:m-auto");
131
+ expect(cls).toContain("stg:max-w-3xl");
132
+ expect(cls).toContain("stg:bg-popover");
133
+ });
134
+
135
+ it("className overrides the shell's own chrome per class (tailwind-merge)", () => {
136
+ const { container } = render(
137
+ <DialogShell
138
+ open
139
+ onOpenChange={() => {}}
140
+ className="stg:bg-background stg:max-w-[85vw]"
141
+ >
142
+ <p>body</p>
143
+ </DialogShell>,
144
+ );
145
+ const cls = dialogOf(container).className;
146
+
147
+ expect(cls).toContain("stg:bg-background");
148
+ expect(cls).not.toContain("stg:bg-popover");
149
+ expect(cls).toContain("stg:max-w-[85vw]");
150
+ expect(cls).not.toContain("stg:max-w-md");
151
+ });
152
+
153
+ it("labels the dialog for assistive tech", () => {
154
+ const { container } = render(
155
+ <DialogShell open onOpenChange={() => {}} aria-label="Confirm delete">
156
+ <p>body</p>
157
+ </DialogShell>,
158
+ );
159
+ expect(dialogOf(container).getAttribute("aria-label")).toBe("Confirm delete");
160
+ });
161
+ });
162
+
163
+ describe("DialogShell backdrop dismiss", () => {
164
+ it("dismissOnBackdrop: a click on the dialog element itself reports close intent", () => {
165
+ const onOpenChange = vi.fn();
166
+ const { container } = render(
167
+ <DialogShell open onOpenChange={onOpenChange} dismissOnBackdrop>
168
+ <p>body</p>
169
+ </DialogShell>,
170
+ );
171
+
172
+ fireEvent.click(dialogOf(container));
173
+ expect(onOpenChange).toHaveBeenCalledExactlyOnceWith(false);
174
+ });
175
+
176
+ it("dismissOnBackdrop: clicks on content descendants never dismiss", () => {
177
+ const onOpenChange = vi.fn();
178
+ const { container, getByText } = render(
179
+ <DialogShell open onOpenChange={onOpenChange} dismissOnBackdrop>
180
+ <p>body</p>
181
+ </DialogShell>,
182
+ );
183
+
184
+ fireEvent.click(getByText("body"));
185
+ expect(onOpenChange).not.toHaveBeenCalled();
186
+ expect(dialogOf(container).open).toBe(true);
187
+ });
188
+
189
+ it("default: backdrop clicks are inert (form dialogs)", () => {
190
+ const onOpenChange = vi.fn();
191
+ const { container } = render(
192
+ <DialogShell open onOpenChange={onOpenChange}>
193
+ <p>body</p>
194
+ </DialogShell>,
195
+ );
196
+
197
+ fireEvent.click(dialogOf(container));
198
+ expect(onOpenChange).not.toHaveBeenCalled();
199
+ });
200
+ });
201
+
202
+ describe("DialogShell non-modal mode", () => {
203
+ it("renders in-flow: open attribute, no backdrop, no fixed positioning", () => {
204
+ const { container, rerender } = render(
205
+ <DialogShell open modal={false} onOpenChange={() => {}}>
206
+ <p>body</p>
207
+ </DialogShell>,
208
+ );
209
+ const dialog = dialogOf(container);
210
+
211
+ expect(dialog.open).toBe(true);
212
+ expect(dialog.className).toContain("stg:relative");
213
+ expect(dialog.className).not.toContain("stg:backdrop:bg-backdrop");
214
+ expect(dialog.className).not.toContain("stg:fixed");
215
+
216
+ rerender(
217
+ <DialogShell open={false} modal={false} onOpenChange={() => {}}>
218
+ <p>body</p>
219
+ </DialogShell>,
220
+ );
221
+ expect(dialogOf(container).open).toBe(false);
222
+ });
223
+ });
@@ -0,0 +1,33 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Per-element UA-default resets for preflight-less hosts (#695).
3
+ // Internal — never exported from the package barrel.
4
+ //
5
+ // Why these are per-component classes and NOT stylesheet rules: the #374
6
+ // scoped form-control preflight in `styles.css` could reset every button
7
+ // under `.stgm` because UA control chrome is never wanted. Lists are
8
+ // different — "UI list" vs "content list" is a semantic distinction CSS
9
+ // scoping cannot express. The documented quickstart wraps the host's whole
10
+ // app in `StigmerProvider`, so a `.stgm ul { list-style: none }` rule would
11
+ // strip the bullets off the HOST's own content. Every SDK-rendered UI list
12
+ // therefore declares its own reset (enforced by the `stigmer/require-list-reset`
13
+ // lint rule); markdown-rendered content lists instead declare their bullets
14
+ // explicitly (`stg:list-disc stg:pl-5 ...` in markdown-components.tsx).
15
+ // ---------------------------------------------------------------------------
16
+
17
+ /**
18
+ * UA-default reset for a UI `<ul>`/`<ol>` (no bullets, no indent, no
19
+ * margins). Without it, a host that ships no global CSS reset renders list
20
+ * markers and ~40px of `padding-inline-start` on every SDK list — invisible
21
+ * on first-party surfaces (console, desktop, docs tours all ship global
22
+ * resets), broken in exactly the third-party embeds the SDK exists for.
23
+ * Spacing utilities (`stg:space-y-*`, `stg:p-*`) compose on top.
24
+ */
25
+ export const UNSTYLED_LIST = "stg:m-0 stg:list-none stg:p-0";
26
+
27
+ /**
28
+ * UA-default reset for `<fieldset>` (margin-inline, padding, and
29
+ * `min-inline-size: min-content` — the last one silently breaks flex/grid
30
+ * shrinking). The UA border is already cleared by the `.stgm *` border reset
31
+ * in `styles.css`, so it is not repeated here.
32
+ */
33
+ export const UNSTYLED_FIELDSET = "stg:m-0 stg:min-w-0 stg:p-0";
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useCallback, useState, type DragEvent } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
+ import { UNSTYLED_LIST } from "../element-resets.js";
5
6
  import { FileTypeIcon, FolderTypeIcon } from "../file-icons/index.js";
6
7
  import type { TreeNode } from "./tree-node.js";
7
8
 
@@ -151,7 +152,7 @@ export function FileTreeNode({
151
152
  {isFolder && expanded && node.children && (
152
153
  <ul
153
154
  role="group"
154
- className={cn(indentGuides && "stg:ml-3 stg:border-l stg:border-border")}
155
+ className={cn(UNSTYLED_LIST, indentGuides && "stg:ml-3 stg:border-l stg:border-border")}
155
156
  >
156
157
  {node.children.map((child) => (
157
158
  <FileTreeNode
@@ -152,12 +152,19 @@ function extractMermaidSource(children: ReactNode): string | null {
152
152
  * ensuring correct rendering in both the Stigmer Console and third-party
153
153
  * host applications with custom themes.
154
154
  *
155
+ * Margin-bearing elements (`p`, `ul`, `ol`, `pre`, `blockquote`) declare
156
+ * their top margin (`stg:mt-0`) and blockquote its inline margins
157
+ * explicitly: the spacing rhythm here is authored via `mb-*` on the
158
+ * assumption that UA base margins are zero, which is only true when the
159
+ * host ships a global reset — preflight-less embeds otherwise stack
160
+ * `margin-top: 1em` (and 40px blockquote indents) on top (#695).
161
+ *
155
162
  * Used by `MessageEntry` (chat messages) and `SkillDetailView` (SKILL.md).
156
163
  */
157
164
  export const MARKDOWN_COMPONENTS: Components = {
158
165
  p({ children, ...props }: MdProps<"p">) {
159
166
  return (
160
- <p className="stg:text-sm stg:text-foreground stg:mb-3 stg:last:mb-0 stg:leading-relaxed stg:break-words" {...props}>
167
+ <p className="stg:text-sm stg:text-foreground stg:mt-0 stg:mb-3 stg:last:mb-0 stg:leading-relaxed stg:break-words" {...props}>
161
168
  {children}
162
169
  </p>
163
170
  );
@@ -211,7 +218,7 @@ export const MARKDOWN_COMPONENTS: Components = {
211
218
 
212
219
  ul({ children, ...props }: MdProps<"ul">) {
213
220
  return (
214
- <ul className="stg:list-disc stg:pl-5 stg:mb-3 stg:last:mb-0 stg:space-y-1 stg:text-sm stg:text-foreground" {...props}>
221
+ <ul className="stg:list-disc stg:pl-5 stg:mt-0 stg:mb-3 stg:last:mb-0 stg:space-y-1 stg:text-sm stg:text-foreground" {...props}>
215
222
  {children}
216
223
  </ul>
217
224
  );
@@ -219,7 +226,7 @@ export const MARKDOWN_COMPONENTS: Components = {
219
226
 
220
227
  ol({ children, ...props }: MdProps<"ol">) {
221
228
  return (
222
- <ol className="stg:list-decimal stg:pl-5 stg:mb-3 stg:last:mb-0 stg:space-y-1 stg:text-sm stg:text-foreground" {...props}>
229
+ <ol className="stg:list-decimal stg:pl-5 stg:mt-0 stg:mb-3 stg:last:mb-0 stg:space-y-1 stg:text-sm stg:text-foreground" {...props}>
223
230
  {children}
224
231
  </ol>
225
232
  );
@@ -245,7 +252,7 @@ export const MARKDOWN_COMPONENTS: Components = {
245
252
 
246
253
  return (
247
254
  <pre
248
- className="stg:mb-3 stg:last:mb-0 stg:overflow-x-auto stg:rounded-md stg:bg-muted stg:p-3"
255
+ className="stg:mt-0 stg:mb-3 stg:last:mb-0 stg:overflow-x-auto stg:rounded-md stg:bg-muted stg:p-3"
249
256
  {...props}
250
257
  >
251
258
  {children}
@@ -293,9 +300,12 @@ export const MARKDOWN_COMPONENTS: Components = {
293
300
  },
294
301
 
295
302
  blockquote({ children, ...props }: MdProps<"blockquote">) {
303
+ // mx-0 matters as much as mt-0 here: UA blockquote margin is `1em 40px`,
304
+ // so a preflight-less host renders a double indent on BOTH sides on top
305
+ // of the border-l + pl-4 treatment.
296
306
  return (
297
307
  <blockquote
298
- className="stg:border-l-2 stg:border-border stg:pl-4 stg:mb-3 stg:last:mb-0 stg:text-muted-foreground stg:italic"
308
+ className="stg:border-l-2 stg:border-border stg:mx-0 stg:mt-0 stg:mb-3 stg:pl-4 stg:last:mb-0 stg:text-muted-foreground stg:italic"
299
309
  {...props}
300
310
  >
301
311
  {children}
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useCallback, useId, useState, type FormEvent } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
+ import { UNSTYLED_FIELDSET } from "../internal/element-resets.js";
5
6
  import {
6
7
  getUserMessage,
7
8
  iamRoleDisplayName,
@@ -302,7 +303,7 @@ function CreateInvitationForm({
302
303
  />
303
304
 
304
305
  {/* Expiry */}
305
- <fieldset className="stg:space-y-1.5">
306
+ <fieldset className={cn(UNSTYLED_FIELDSET, "stg:space-y-1.5")}>
306
307
  <legend className="stg:text-xs stg:font-medium stg:text-foreground">
307
308
  Expires in
308
309
  </legend>
@@ -324,7 +325,7 @@ function CreateInvitationForm({
324
325
  </fieldset>
325
326
 
326
327
  {/* Redemption mode */}
327
- <fieldset className="stg:space-y-1.5">
328
+ <fieldset className={cn(UNSTYLED_FIELDSET, "stg:space-y-1.5")}>
328
329
  <legend className="stg:text-xs stg:font-medium stg:text-foreground">
329
330
  Usage limit
330
331
  </legend>
@@ -2,6 +2,8 @@
2
2
 
3
3
  import { lazy, Suspense, useCallback, useEffect, useRef } from "react";
4
4
  import { cn } from "@stigmer/theme";
5
+ import { DialogShell } from "../internal/DialogShell.js";
6
+ import { UNSTYLED_LIST } from "../internal/element-resets.js";
5
7
  import { toast } from "../feedback/toast.js";
6
8
  import { RedactedSecretsNotice } from "./RedactedSecretsNotice.js";
7
9
  import {
@@ -71,22 +73,10 @@ export function ApplyManifestDialog({
71
73
  org,
72
74
  onApplied,
73
75
  }: ApplyManifestDialogProps) {
74
- const dialogRef = useRef<HTMLDialogElement>(null);
75
76
  const fileInputRef = useRef<HTMLInputElement>(null);
76
77
  const manifest = useApplyManifest(org);
77
78
  const { reset } = manifest;
78
79
 
79
- // Sync dialog open state with the native <dialog> element.
80
- useEffect(() => {
81
- const dialog = dialogRef.current;
82
- if (!dialog) return;
83
- if (open && !dialog.open) {
84
- dialog.showModal();
85
- } else if (!open && dialog.open) {
86
- dialog.close();
87
- }
88
- }, [open]);
89
-
90
80
  // Start each session clean.
91
81
  useEffect(() => {
92
82
  if (open) {
@@ -109,10 +99,11 @@ export function ApplyManifestDialog({
109
99
  if (applied.length > 0) onApplied?.(applied);
110
100
  }, [onOpenChange, manifest.entries, onApplied]);
111
101
 
112
- const handleCancel = useCallback(
113
- (e: React.SyntheticEvent) => {
114
- e.preventDefault();
115
- closeAndMaybeRefresh();
102
+ // Escape/cancel routes through the same dismiss-after-partial path as the
103
+ // Close button, via the shell's single close-intent callback.
104
+ const handleShellOpenChange = useCallback(
105
+ (nextOpen: boolean) => {
106
+ if (!nextOpen) closeAndMaybeRefresh();
116
107
  },
117
108
  [closeAndMaybeRefresh],
118
109
  );
@@ -151,15 +142,7 @@ export function ApplyManifestDialog({
151
142
  !manifest.isApplying;
152
143
 
153
144
  return (
154
- <dialog
155
- ref={dialogRef}
156
- onCancel={handleCancel}
157
- className={cn(
158
- "stg:fixed stg:inset-0 stg:z-50 stg:m-auto stg:w-full stg:max-w-3xl stg:rounded-lg stg:border stg:border-border stg:bg-popover stg:p-0 stg:text-popover-foreground stg:shadow-lg",
159
- "stg:backdrop:bg-backdrop",
160
- "stg:open:animate-in stg:open:fade-in-0 stg:open:zoom-in-95",
161
- )}
162
- >
145
+ <DialogShell open={open} onOpenChange={handleShellOpenChange} width="3xl" aria-label="Apply YAML">
163
146
  <div className="stg:flex stg:flex-col stg:gap-4 stg:p-6">
164
147
  {/* Header */}
165
148
  <div className="stg:flex stg:flex-col stg:gap-1">
@@ -207,7 +190,7 @@ export function ApplyManifestDialog({
207
190
 
208
191
  {/* Per-document preview */}
209
192
  {manifest.entries && manifest.entries.length > 0 && (
210
- <ul className="stg:flex stg:max-h-48 stg:flex-col stg:gap-2 stg:overflow-y-auto" aria-label="Resources to apply">
193
+ <ul className={cn(UNSTYLED_LIST, "stg:flex stg:max-h-48 stg:flex-col stg:gap-2 stg:overflow-y-auto")} aria-label="Resources to apply">
211
194
  {manifest.entries.map((entry, index) => (
212
195
  <PreviewRow key={`${entry.document.handler.yamlKind}/${entry.document.org}/${entry.document.slug}/${index}`} entry={entry} />
213
196
  ))}
@@ -252,7 +235,7 @@ export function ApplyManifestDialog({
252
235
  </div>
253
236
  </div>
254
237
  </div>
255
- </dialog>
238
+ </DialogShell>
256
239
  );
257
240
  }
258
241