@stigmer/react 0.0.36 → 0.0.39

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 (889) hide show
  1. package/README.md +4 -88
  2. package/__tests__/hooks.test.d.ts +2 -0
  3. package/__tests__/hooks.test.d.ts.map +1 -0
  4. package/__tests__/hooks.test.js +18 -0
  5. package/__tests__/hooks.test.js.map +1 -0
  6. package/agent/AgentDetailView.d.ts +69 -0
  7. package/agent/AgentDetailView.d.ts.map +1 -0
  8. package/agent/AgentDetailView.js +183 -0
  9. package/agent/AgentDetailView.js.map +1 -0
  10. package/agent/AgentEnvForm.d.ts +83 -0
  11. package/agent/AgentEnvForm.d.ts.map +1 -0
  12. package/agent/AgentEnvForm.js +31 -0
  13. package/agent/AgentEnvForm.js.map +1 -0
  14. package/agent/AgentPicker.d.ts +44 -0
  15. package/agent/AgentPicker.d.ts.map +1 -0
  16. package/agent/AgentPicker.js +121 -0
  17. package/agent/AgentPicker.js.map +1 -0
  18. package/agent/agentSetupReducer.d.ts +122 -0
  19. package/agent/agentSetupReducer.d.ts.map +1 -0
  20. package/agent/agentSetupReducer.js +75 -0
  21. package/agent/agentSetupReducer.js.map +1 -0
  22. package/agent/index.d.ts +19 -8
  23. package/agent/index.d.ts.map +1 -1
  24. package/agent/index.js +10 -6
  25. package/agent/index.js.map +1 -1
  26. package/agent/useAgent.d.ts +48 -0
  27. package/agent/useAgent.d.ts.map +1 -0
  28. package/agent/useAgent.js +82 -0
  29. package/agent/useAgent.js.map +1 -0
  30. package/agent/useAgentCount.d.ts +49 -0
  31. package/agent/useAgentCount.d.ts.map +1 -0
  32. package/agent/useAgentCount.js +32 -0
  33. package/agent/useAgentCount.js.map +1 -0
  34. package/agent/useAgentList.d.ts +62 -0
  35. package/agent/useAgentList.d.ts.map +1 -0
  36. package/agent/useAgentList.js +38 -0
  37. package/agent/useAgentList.js.map +1 -0
  38. package/agent/useAgentSearch.d.ts +23 -0
  39. package/agent/useAgentSearch.d.ts.map +1 -0
  40. package/agent/useAgentSearch.js +28 -0
  41. package/agent/useAgentSearch.js.map +1 -0
  42. package/agent/useAgentSetup.d.ts +115 -0
  43. package/agent/useAgentSetup.d.ts.map +1 -0
  44. package/agent/useAgentSetup.js +244 -0
  45. package/agent/useAgentSetup.js.map +1 -0
  46. package/agent/useDefaultAgent.d.ts +29 -0
  47. package/agent/useDefaultAgent.d.ts.map +1 -0
  48. package/agent/useDefaultAgent.js +60 -0
  49. package/agent/useDefaultAgent.js.map +1 -0
  50. package/agent-instance/buildPersonalInstanceInput.d.ts +20 -0
  51. package/agent-instance/buildPersonalInstanceInput.d.ts.map +1 -0
  52. package/agent-instance/buildPersonalInstanceInput.js +29 -0
  53. package/agent-instance/buildPersonalInstanceInput.js.map +1 -0
  54. package/agent-instance/index.d.ts +9 -0
  55. package/agent-instance/index.d.ts.map +1 -0
  56. package/agent-instance/index.js +5 -0
  57. package/agent-instance/index.js.map +1 -0
  58. package/agent-instance/useAgentInstance.d.ts +35 -0
  59. package/agent-instance/useAgentInstance.d.ts.map +1 -0
  60. package/agent-instance/useAgentInstance.js +67 -0
  61. package/agent-instance/useAgentInstance.js.map +1 -0
  62. package/agent-instance/useAgentInstanceList.d.ts +29 -0
  63. package/agent-instance/useAgentInstanceList.d.ts.map +1 -0
  64. package/agent-instance/useAgentInstanceList.js +74 -0
  65. package/agent-instance/useAgentInstanceList.js.map +1 -0
  66. package/agent-instance/useCreateAgentInstance.d.ts +44 -0
  67. package/agent-instance/useCreateAgentInstance.d.ts.map +1 -0
  68. package/agent-instance/useCreateAgentInstance.js +60 -0
  69. package/agent-instance/useCreateAgentInstance.js.map +1 -0
  70. package/agent-instance/usePersonalAgentInstance.d.ts +93 -0
  71. package/agent-instance/usePersonalAgentInstance.d.ts.map +1 -0
  72. package/agent-instance/usePersonalAgentInstance.js +103 -0
  73. package/agent-instance/usePersonalAgentInstance.js.map +1 -0
  74. package/attachment/AttachmentChipList.d.ts +24 -0
  75. package/attachment/AttachmentChipList.d.ts.map +1 -0
  76. package/attachment/AttachmentChipList.js +45 -0
  77. package/attachment/AttachmentChipList.js.map +1 -0
  78. package/attachment/attachment-utils.d.ts +32 -0
  79. package/attachment/attachment-utils.d.ts.map +1 -0
  80. package/attachment/attachment-utils.js +104 -0
  81. package/attachment/attachment-utils.js.map +1 -0
  82. package/attachment/index.d.ts +6 -0
  83. package/attachment/index.d.ts.map +1 -0
  84. package/attachment/index.js +4 -0
  85. package/attachment/index.js.map +1 -0
  86. package/attachment/useAttachments.d.ts +113 -0
  87. package/attachment/useAttachments.d.ts.map +1 -0
  88. package/attachment/useAttachments.js +175 -0
  89. package/attachment/useAttachments.js.map +1 -0
  90. package/composer/ComposerToolbar.d.ts +37 -0
  91. package/composer/ComposerToolbar.d.ts.map +1 -0
  92. package/composer/ComposerToolbar.js +24 -0
  93. package/composer/ComposerToolbar.js.map +1 -0
  94. package/composer/ConfigureMenu.d.ts +37 -0
  95. package/composer/ConfigureMenu.d.ts.map +1 -0
  96. package/composer/ConfigureMenu.js +53 -0
  97. package/composer/ConfigureMenu.js.map +1 -0
  98. package/composer/ContextChip.d.ts +22 -0
  99. package/composer/ContextChip.d.ts.map +1 -0
  100. package/composer/ContextChip.js +19 -0
  101. package/composer/ContextChip.js.map +1 -0
  102. package/composer/ContextPopover.d.ts +10 -0
  103. package/composer/ContextPopover.d.ts.map +1 -0
  104. package/composer/ContextPopover.js +11 -0
  105. package/composer/ContextPopover.js.map +1 -0
  106. package/composer/SessionComposer.d.ts +269 -0
  107. package/composer/SessionComposer.d.ts.map +1 -0
  108. package/composer/SessionComposer.js +568 -0
  109. package/composer/SessionComposer.js.map +1 -0
  110. package/composer/icons.d.ts +15 -0
  111. package/composer/icons.d.ts.map +1 -0
  112. package/composer/icons.js +42 -0
  113. package/composer/icons.js.map +1 -0
  114. package/composer/index.d.ts +5 -0
  115. package/composer/index.d.ts.map +1 -0
  116. package/composer/index.js +3 -0
  117. package/composer/index.js.map +1 -0
  118. package/composer/useComposer.d.ts +74 -0
  119. package/composer/useComposer.d.ts.map +1 -0
  120. package/composer/useComposer.js +94 -0
  121. package/composer/useComposer.js.map +1 -0
  122. package/environment/CreateEnvironmentForm.d.ts +31 -0
  123. package/environment/CreateEnvironmentForm.d.ts.map +1 -0
  124. package/environment/CreateEnvironmentForm.js +57 -0
  125. package/environment/CreateEnvironmentForm.js.map +1 -0
  126. package/environment/EnvVarForm.d.ts +134 -0
  127. package/environment/EnvVarForm.d.ts.map +1 -0
  128. package/environment/EnvVarForm.js +122 -0
  129. package/environment/EnvVarForm.js.map +1 -0
  130. package/environment/EnvironmentListPanel.d.ts +51 -0
  131. package/environment/EnvironmentListPanel.d.ts.map +1 -0
  132. package/environment/EnvironmentListPanel.js +96 -0
  133. package/environment/EnvironmentListPanel.js.map +1 -0
  134. package/environment/EnvironmentVariableEditor.d.ts +43 -0
  135. package/environment/EnvironmentVariableEditor.d.ts.map +1 -0
  136. package/environment/EnvironmentVariableEditor.js +269 -0
  137. package/environment/EnvironmentVariableEditor.js.map +1 -0
  138. package/environment/diffEnvSpec.d.ts +34 -0
  139. package/environment/diffEnvSpec.d.ts.map +1 -0
  140. package/environment/diffEnvSpec.js +44 -0
  141. package/environment/diffEnvSpec.js.map +1 -0
  142. package/environment/index.d.ts +28 -0
  143. package/environment/index.d.ts.map +1 -0
  144. package/environment/index.js +15 -0
  145. package/environment/index.js.map +1 -0
  146. package/environment/useCreateEnvironment.d.ts +43 -0
  147. package/environment/useCreateEnvironment.d.ts.map +1 -0
  148. package/environment/useCreateEnvironment.js +59 -0
  149. package/environment/useCreateEnvironment.js.map +1 -0
  150. package/environment/useEnvironment.d.ts +37 -0
  151. package/environment/useEnvironment.d.ts.map +1 -0
  152. package/environment/useEnvironment.js +69 -0
  153. package/environment/useEnvironment.js.map +1 -0
  154. package/environment/useEnvironmentList.d.ts +31 -0
  155. package/environment/useEnvironmentList.d.ts.map +1 -0
  156. package/environment/useEnvironmentList.js +88 -0
  157. package/environment/useEnvironmentList.js.map +1 -0
  158. package/environment/usePersonalEnvironment.d.ts +100 -0
  159. package/environment/usePersonalEnvironment.d.ts.map +1 -0
  160. package/environment/usePersonalEnvironment.js +168 -0
  161. package/environment/usePersonalEnvironment.js.map +1 -0
  162. package/environment/useRemoveEnvironmentVariables.d.ts +45 -0
  163. package/environment/useRemoveEnvironmentVariables.d.ts.map +1 -0
  164. package/environment/useRemoveEnvironmentVariables.js +57 -0
  165. package/environment/useRemoveEnvironmentVariables.js.map +1 -0
  166. package/environment/useRevealSecretValue.d.ts +66 -0
  167. package/environment/useRevealSecretValue.d.ts.map +1 -0
  168. package/environment/useRevealSecretValue.js +92 -0
  169. package/environment/useRevealSecretValue.js.map +1 -0
  170. package/environment/useSessionEnvPool.d.ts +80 -0
  171. package/environment/useSessionEnvPool.d.ts.map +1 -0
  172. package/environment/useSessionEnvPool.js +72 -0
  173. package/environment/useSessionEnvPool.js.map +1 -0
  174. package/environment/useUpdateEnvironment.d.ts +43 -0
  175. package/environment/useUpdateEnvironment.d.ts.map +1 -0
  176. package/environment/useUpdateEnvironment.js +59 -0
  177. package/environment/useUpdateEnvironment.js.map +1 -0
  178. package/environment/useUpdateEnvironmentVariables.d.ts +53 -0
  179. package/environment/useUpdateEnvironmentVariables.d.ts.map +1 -0
  180. package/environment/useUpdateEnvironmentVariables.js +71 -0
  181. package/environment/useUpdateEnvironmentVariables.js.map +1 -0
  182. package/error/ErrorMessage.d.ts +33 -0
  183. package/error/ErrorMessage.d.ts.map +1 -0
  184. package/error/ErrorMessage.js +60 -0
  185. package/error/ErrorMessage.js.map +1 -0
  186. package/error/SecretFlowErrorGuide.d.ts +41 -0
  187. package/error/SecretFlowErrorGuide.d.ts.map +1 -0
  188. package/error/SecretFlowErrorGuide.js +87 -0
  189. package/error/SecretFlowErrorGuide.js.map +1 -0
  190. package/error/index.d.ts +5 -0
  191. package/error/index.d.ts.map +1 -0
  192. package/error/index.js +3 -0
  193. package/error/index.js.map +1 -0
  194. package/execution/ApprovalCard.d.ts +35 -0
  195. package/execution/ApprovalCard.d.ts.map +1 -0
  196. package/execution/ApprovalCard.js +192 -0
  197. package/execution/ApprovalCard.js.map +1 -0
  198. package/execution/ArtifactCard.d.ts +70 -0
  199. package/execution/ArtifactCard.d.ts.map +1 -0
  200. package/execution/ArtifactCard.js +109 -0
  201. package/execution/ArtifactCard.js.map +1 -0
  202. package/execution/ArtifactPreviewModal.d.ts +77 -0
  203. package/execution/ArtifactPreviewModal.d.ts.map +1 -0
  204. package/execution/ArtifactPreviewModal.js +310 -0
  205. package/execution/ArtifactPreviewModal.js.map +1 -0
  206. package/execution/ArtifactsWidget.d.ts +63 -0
  207. package/execution/ArtifactsWidget.d.ts.map +1 -0
  208. package/execution/ArtifactsWidget.js +61 -0
  209. package/execution/ArtifactsWidget.js.map +1 -0
  210. package/execution/ExecutionCostSummary.d.ts +47 -0
  211. package/execution/ExecutionCostSummary.d.ts.map +1 -0
  212. package/execution/ExecutionCostSummary.js +77 -0
  213. package/execution/ExecutionCostSummary.js.map +1 -0
  214. package/execution/ExecutionPhaseBadge.d.ts +20 -0
  215. package/execution/ExecutionPhaseBadge.d.ts.map +1 -0
  216. package/execution/ExecutionPhaseBadge.js +112 -0
  217. package/execution/ExecutionPhaseBadge.js.map +1 -0
  218. package/execution/ExecutionProgress.d.ts +32 -0
  219. package/execution/ExecutionProgress.d.ts.map +1 -0
  220. package/execution/ExecutionProgress.js +96 -0
  221. package/execution/ExecutionProgress.js.map +1 -0
  222. package/execution/FilePathContext.d.ts +22 -0
  223. package/execution/FilePathContext.d.ts.map +1 -0
  224. package/execution/FilePathContext.js +6 -0
  225. package/execution/FilePathContext.js.map +1 -0
  226. package/execution/FilePathLink.d.ts +26 -0
  227. package/execution/FilePathLink.d.ts.map +1 -0
  228. package/execution/FilePathLink.js +64 -0
  229. package/execution/FilePathLink.js.map +1 -0
  230. package/execution/FollowUpInput.d.ts +55 -0
  231. package/execution/FollowUpInput.d.ts.map +1 -0
  232. package/execution/FollowUpInput.js +95 -0
  233. package/execution/FollowUpInput.js.map +1 -0
  234. package/execution/MessageEntry.d.ts +25 -0
  235. package/execution/MessageEntry.d.ts.map +1 -0
  236. package/execution/MessageEntry.js +46 -0
  237. package/execution/MessageEntry.js.map +1 -0
  238. package/execution/MessageThread.d.ts +88 -0
  239. package/execution/MessageThread.d.ts.map +1 -0
  240. package/execution/MessageThread.js +157 -0
  241. package/execution/MessageThread.js.map +1 -0
  242. package/execution/SessionVariablesInput.d.ts +47 -0
  243. package/execution/SessionVariablesInput.d.ts.map +1 -0
  244. package/execution/SessionVariablesInput.js +80 -0
  245. package/execution/SessionVariablesInput.js.map +1 -0
  246. package/execution/SubAgentSection.d.ts +23 -0
  247. package/execution/SubAgentSection.d.ts.map +1 -0
  248. package/execution/SubAgentSection.js +103 -0
  249. package/execution/SubAgentSection.js.map +1 -0
  250. package/execution/ToolCallDetail.d.ts +32 -0
  251. package/execution/ToolCallDetail.d.ts.map +1 -0
  252. package/execution/ToolCallDetail.js +204 -0
  253. package/execution/ToolCallDetail.js.map +1 -0
  254. package/execution/ToolCallGroup.d.ts +45 -0
  255. package/execution/ToolCallGroup.d.ts.map +1 -0
  256. package/execution/ToolCallGroup.js +160 -0
  257. package/execution/ToolCallGroup.js.map +1 -0
  258. package/execution/ToolCallItem.d.ts +39 -0
  259. package/execution/ToolCallItem.d.ts.map +1 -0
  260. package/execution/ToolCallItem.js +164 -0
  261. package/execution/ToolCallItem.js.map +1 -0
  262. package/execution/__tests__/ExecutionCostSummary.test.d.ts +2 -0
  263. package/execution/__tests__/ExecutionCostSummary.test.d.ts.map +1 -0
  264. package/execution/__tests__/ExecutionCostSummary.test.js +255 -0
  265. package/execution/__tests__/ExecutionCostSummary.test.js.map +1 -0
  266. package/execution/__tests__/execution-phases.test.d.ts +2 -0
  267. package/execution/__tests__/execution-phases.test.d.ts.map +1 -0
  268. package/execution/__tests__/execution-phases.test.js +25 -0
  269. package/execution/__tests__/execution-phases.test.js.map +1 -0
  270. package/execution/__tests__/useExecutionStream.test.d.ts +2 -0
  271. package/execution/__tests__/useExecutionStream.test.d.ts.map +1 -0
  272. package/execution/__tests__/useExecutionStream.test.js +190 -0
  273. package/execution/__tests__/useExecutionStream.test.js.map +1 -0
  274. package/execution/__tests__/useExecutionUsage.test.d.ts +2 -0
  275. package/execution/__tests__/useExecutionUsage.test.d.ts.map +1 -0
  276. package/execution/__tests__/useExecutionUsage.test.js +303 -0
  277. package/execution/__tests__/useExecutionUsage.test.js.map +1 -0
  278. package/execution/artifact-utils.d.ts +58 -0
  279. package/execution/artifact-utils.d.ts.map +1 -0
  280. package/execution/artifact-utils.js +123 -0
  281. package/execution/artifact-utils.js.map +1 -0
  282. package/execution/execution-phases.d.ts +7 -0
  283. package/execution/execution-phases.d.ts.map +1 -0
  284. package/execution/execution-phases.js +15 -0
  285. package/execution/execution-phases.js.map +1 -0
  286. package/execution/file-path-resolver.d.ts +63 -0
  287. package/execution/file-path-resolver.d.ts.map +1 -0
  288. package/execution/file-path-resolver.js +121 -0
  289. package/execution/file-path-resolver.js.map +1 -0
  290. package/execution/index.d.ts +55 -0
  291. package/execution/index.d.ts.map +1 -0
  292. package/execution/index.js +29 -0
  293. package/execution/index.js.map +1 -0
  294. package/execution/tool-categories.d.ts +36 -0
  295. package/execution/tool-categories.d.ts.map +1 -0
  296. package/execution/tool-categories.js +110 -0
  297. package/execution/tool-categories.js.map +1 -0
  298. package/execution/useArtifactContent.d.ts +75 -0
  299. package/execution/useArtifactContent.d.ts.map +1 -0
  300. package/execution/useArtifactContent.js +102 -0
  301. package/execution/useArtifactContent.js.map +1 -0
  302. package/execution/useCreateAgentExecution.d.ts +84 -0
  303. package/execution/useCreateAgentExecution.d.ts.map +1 -0
  304. package/execution/useCreateAgentExecution.js +79 -0
  305. package/execution/useCreateAgentExecution.js.map +1 -0
  306. package/execution/useExecutionArtifacts.d.ts +42 -0
  307. package/execution/useExecutionArtifacts.d.ts.map +1 -0
  308. package/execution/useExecutionArtifacts.js +43 -0
  309. package/execution/useExecutionArtifacts.js.map +1 -0
  310. package/execution/useExecutionStream.d.ts +62 -0
  311. package/execution/useExecutionStream.d.ts.map +1 -0
  312. package/execution/useExecutionStream.js +99 -0
  313. package/execution/useExecutionStream.js.map +1 -0
  314. package/execution/useExecutionUsage.d.ts +45 -0
  315. package/execution/useExecutionUsage.d.ts.map +1 -0
  316. package/execution/useExecutionUsage.js +157 -0
  317. package/execution/useExecutionUsage.js.map +1 -0
  318. package/execution/useSessionVariables.d.ts +102 -0
  319. package/execution/useSessionVariables.d.ts.map +1 -0
  320. package/execution/useSessionVariables.js +102 -0
  321. package/execution/useSessionVariables.js.map +1 -0
  322. package/execution/useSubmitApproval.d.ts +39 -0
  323. package/execution/useSubmitApproval.d.ts.map +1 -0
  324. package/execution/useSubmitApproval.js +62 -0
  325. package/execution/useSubmitApproval.js.map +1 -0
  326. package/github/GitHubRepoPicker.d.ts +24 -0
  327. package/github/GitHubRepoPicker.d.ts.map +1 -0
  328. package/github/GitHubRepoPicker.js +248 -0
  329. package/github/GitHubRepoPicker.js.map +1 -0
  330. package/github/index.d.ts +4 -0
  331. package/github/index.d.ts.map +1 -0
  332. package/github/index.js +4 -0
  333. package/github/index.js.map +1 -0
  334. package/github/useGitHubConnection.d.ts +72 -0
  335. package/github/useGitHubConnection.d.ts.map +1 -0
  336. package/github/useGitHubConnection.js +268 -0
  337. package/github/useGitHubConnection.js.map +1 -0
  338. package/github/useGitHubRepos.d.ts +39 -0
  339. package/github/useGitHubRepos.d.ts.map +1 -0
  340. package/github/useGitHubRepos.js +135 -0
  341. package/github/useGitHubRepos.js.map +1 -0
  342. package/index.d.ts +32 -0
  343. package/index.d.ts.map +1 -1
  344. package/index.js +31 -0
  345. package/index.js.map +1 -1
  346. package/internal/ScrollFade.d.ts +15 -0
  347. package/internal/ScrollFade.d.ts.map +1 -0
  348. package/internal/ScrollFade.js +24 -0
  349. package/internal/ScrollFade.js.map +1 -0
  350. package/internal/markdown-components.d.ts +18 -0
  351. package/internal/markdown-components.d.ts.map +1 -0
  352. package/internal/markdown-components.js +78 -0
  353. package/internal/markdown-components.js.map +1 -0
  354. package/internal/slug.d.ts +32 -0
  355. package/internal/slug.d.ts.map +1 -0
  356. package/internal/slug.js +41 -0
  357. package/internal/slug.js.map +1 -0
  358. package/internal/toError.d.ts +16 -0
  359. package/internal/toError.d.ts.map +1 -0
  360. package/internal/toError.js +22 -0
  361. package/internal/toError.js.map +1 -0
  362. package/internal/useScrollShadows.d.ts +22 -0
  363. package/internal/useScrollShadows.d.ts.map +1 -0
  364. package/internal/useScrollShadows.js +40 -0
  365. package/internal/useScrollShadows.js.map +1 -0
  366. package/library/ResourceCountCard.d.ts +104 -0
  367. package/library/ResourceCountCard.d.ts.map +1 -0
  368. package/library/ResourceCountCard.js +80 -0
  369. package/library/ResourceCountCard.js.map +1 -0
  370. package/library/ResourceListView.d.ts +123 -0
  371. package/library/ResourceListView.d.ts.map +1 -0
  372. package/library/ResourceListView.js +208 -0
  373. package/library/ResourceListView.js.map +1 -0
  374. package/library/ScopeToggle.d.ts +38 -0
  375. package/library/ScopeToggle.d.ts.map +1 -0
  376. package/library/ScopeToggle.js +61 -0
  377. package/library/ScopeToggle.js.map +1 -0
  378. package/library/detect-skill-package.d.ts +79 -0
  379. package/library/detect-skill-package.d.ts.map +1 -0
  380. package/library/detect-skill-package.js +113 -0
  381. package/library/detect-skill-package.js.map +1 -0
  382. package/library/detect-stigmer-resource.d.ts +66 -0
  383. package/library/detect-stigmer-resource.d.ts.map +1 -0
  384. package/library/detect-stigmer-resource.js +77 -0
  385. package/library/detect-stigmer-resource.js.map +1 -0
  386. package/library/index.d.ts +20 -0
  387. package/library/index.d.ts.map +1 -0
  388. package/library/index.js +11 -0
  389. package/library/index.js.map +1 -0
  390. package/library/parse-resource-yaml.d.ts +59 -0
  391. package/library/parse-resource-yaml.d.ts.map +1 -0
  392. package/library/parse-resource-yaml.js +397 -0
  393. package/library/parse-resource-yaml.js.map +1 -0
  394. package/library/serialize-resource-yaml.d.ts +50 -0
  395. package/library/serialize-resource-yaml.d.ts.map +1 -0
  396. package/library/serialize-resource-yaml.js +294 -0
  397. package/library/serialize-resource-yaml.js.map +1 -0
  398. package/library/useApplyResource.d.ts +115 -0
  399. package/library/useApplyResource.d.ts.map +1 -0
  400. package/library/useApplyResource.js +124 -0
  401. package/library/useApplyResource.js.map +1 -0
  402. package/library/useDetectSkillPackage.d.ts +54 -0
  403. package/library/useDetectSkillPackage.d.ts.map +1 -0
  404. package/library/useDetectSkillPackage.js +59 -0
  405. package/library/useDetectSkillPackage.js.map +1 -0
  406. package/library/useDetectStigmerResource.d.ts +30 -0
  407. package/library/useDetectStigmerResource.d.ts.map +1 -0
  408. package/library/useDetectStigmerResource.js +35 -0
  409. package/library/useDetectStigmerResource.js.map +1 -0
  410. package/mcp-server/McpServerConfigPanel.d.ts +116 -0
  411. package/mcp-server/McpServerConfigPanel.d.ts.map +1 -0
  412. package/mcp-server/McpServerConfigPanel.js +72 -0
  413. package/mcp-server/McpServerConfigPanel.js.map +1 -0
  414. package/mcp-server/McpServerDetailView.d.ts +43 -0
  415. package/mcp-server/McpServerDetailView.d.ts.map +1 -0
  416. package/mcp-server/McpServerDetailView.js +137 -0
  417. package/mcp-server/McpServerDetailView.js.map +1 -0
  418. package/mcp-server/McpServerPicker.d.ts +158 -0
  419. package/mcp-server/McpServerPicker.d.ts.map +1 -0
  420. package/mcp-server/McpServerPicker.js +265 -0
  421. package/mcp-server/McpServerPicker.js.map +1 -0
  422. package/mcp-server/McpToolSelector.d.ts +44 -0
  423. package/mcp-server/McpToolSelector.d.ts.map +1 -0
  424. package/mcp-server/McpToolSelector.js +75 -0
  425. package/mcp-server/McpToolSelector.js.map +1 -0
  426. package/mcp-server/index.d.ts +18 -2
  427. package/mcp-server/index.d.ts.map +1 -1
  428. package/mcp-server/index.js +9 -2
  429. package/mcp-server/index.js.map +1 -1
  430. package/mcp-server/mcpServerSetupReducer.d.ts +138 -0
  431. package/mcp-server/mcpServerSetupReducer.d.ts.map +1 -0
  432. package/mcp-server/mcpServerSetupReducer.js +163 -0
  433. package/mcp-server/mcpServerSetupReducer.js.map +1 -0
  434. package/mcp-server/useMcpServer.d.ts +48 -0
  435. package/mcp-server/useMcpServer.d.ts.map +1 -0
  436. package/mcp-server/useMcpServer.js +82 -0
  437. package/mcp-server/useMcpServer.js.map +1 -0
  438. package/mcp-server/useMcpServerCount.d.ts +49 -0
  439. package/mcp-server/useMcpServerCount.d.ts.map +1 -0
  440. package/mcp-server/useMcpServerCount.js +32 -0
  441. package/mcp-server/useMcpServerCount.js.map +1 -0
  442. package/mcp-server/useMcpServerList.d.ts +62 -0
  443. package/mcp-server/useMcpServerList.d.ts.map +1 -0
  444. package/mcp-server/useMcpServerList.js +38 -0
  445. package/mcp-server/useMcpServerList.js.map +1 -0
  446. package/mcp-server/useMcpServerSearch.d.ts +18 -0
  447. package/mcp-server/useMcpServerSearch.d.ts.map +1 -0
  448. package/mcp-server/useMcpServerSearch.js +23 -0
  449. package/mcp-server/useMcpServerSearch.js.map +1 -0
  450. package/mcp-server/useMcpServerSetup.d.ts +162 -0
  451. package/mcp-server/useMcpServerSetup.d.ts.map +1 -0
  452. package/mcp-server/useMcpServerSetup.js +269 -0
  453. package/mcp-server/useMcpServerSetup.js.map +1 -0
  454. package/models/ModelSelector.d.ts +22 -0
  455. package/models/ModelSelector.d.ts.map +1 -0
  456. package/models/ModelSelector.js +59 -0
  457. package/models/ModelSelector.js.map +1 -0
  458. package/models/index.d.ts +7 -0
  459. package/models/index.d.ts.map +1 -0
  460. package/models/index.js +4 -0
  461. package/models/index.js.map +1 -0
  462. package/models/registry.d.ts +22 -0
  463. package/models/registry.d.ts.map +1 -0
  464. package/models/registry.js +43 -0
  465. package/models/registry.js.map +1 -0
  466. package/models/useModelRegistry.d.ts +18 -0
  467. package/models/useModelRegistry.d.ts.map +1 -0
  468. package/models/useModelRegistry.js +40 -0
  469. package/models/useModelRegistry.js.map +1 -0
  470. package/organization/CreateOrganizationForm.d.ts +28 -0
  471. package/organization/CreateOrganizationForm.d.ts.map +1 -0
  472. package/organization/CreateOrganizationForm.js +91 -0
  473. package/organization/CreateOrganizationForm.js.map +1 -0
  474. package/organization/index.d.ts +5 -0
  475. package/organization/index.d.ts.map +1 -0
  476. package/organization/index.js +3 -0
  477. package/organization/index.js.map +1 -0
  478. package/organization/useCreateOrganization.d.ts +34 -0
  479. package/organization/useCreateOrganization.d.ts.map +1 -0
  480. package/organization/useCreateOrganization.js +50 -0
  481. package/organization/useCreateOrganization.js.map +1 -0
  482. package/package.json +12 -40
  483. package/search/index.d.ts +7 -0
  484. package/search/index.d.ts.map +1 -0
  485. package/search/index.js +4 -0
  486. package/search/index.js.map +1 -0
  487. package/search/useResourceCount.d.ts +42 -0
  488. package/search/useResourceCount.d.ts.map +1 -0
  489. package/search/useResourceCount.js +58 -0
  490. package/search/useResourceCount.js.map +1 -0
  491. package/search/useResourceList.d.ts +43 -0
  492. package/search/useResourceList.d.ts.map +1 -0
  493. package/search/useResourceList.js +73 -0
  494. package/search/useResourceList.js.map +1 -0
  495. package/search/useResourceSearch.d.ts +27 -0
  496. package/search/useResourceSearch.d.ts.map +1 -0
  497. package/search/useResourceSearch.js +55 -0
  498. package/search/useResourceSearch.js.map +1 -0
  499. package/session/__tests__/group-sessions.test.d.ts +2 -0
  500. package/session/__tests__/group-sessions.test.d.ts.map +1 -0
  501. package/session/__tests__/group-sessions.test.js +91 -0
  502. package/session/__tests__/group-sessions.test.js.map +1 -0
  503. package/session/__tests__/useSessionConversation.test.d.ts +2 -0
  504. package/session/__tests__/useSessionConversation.test.d.ts.map +1 -0
  505. package/session/__tests__/useSessionConversation.test.js +209 -0
  506. package/session/__tests__/useSessionConversation.test.js.map +1 -0
  507. package/session/group-sessions.d.ts +20 -0
  508. package/session/group-sessions.d.ts.map +1 -0
  509. package/session/group-sessions.js +61 -0
  510. package/session/group-sessions.js.map +1 -0
  511. package/session/index.d.ts +16 -6
  512. package/session/index.d.ts.map +1 -1
  513. package/session/index.js +8 -5
  514. package/session/index.js.map +1 -1
  515. package/session/useAgentRefFromSession.d.ts +28 -0
  516. package/session/useAgentRefFromSession.d.ts.map +1 -0
  517. package/session/useAgentRefFromSession.js +73 -0
  518. package/session/useAgentRefFromSession.js.map +1 -0
  519. package/session/useCreateSession.d.ts +73 -0
  520. package/session/useCreateSession.d.ts.map +1 -0
  521. package/session/useCreateSession.js +86 -0
  522. package/session/useCreateSession.js.map +1 -0
  523. package/session/useSession.d.ts +17 -0
  524. package/session/useSession.d.ts.map +1 -0
  525. package/session/useSession.js +46 -0
  526. package/session/useSession.js.map +1 -0
  527. package/session/useSessionConversation.d.ts +151 -0
  528. package/session/useSessionConversation.d.ts.map +1 -0
  529. package/session/useSessionConversation.js +282 -0
  530. package/session/useSessionConversation.js.map +1 -0
  531. package/session/useSessionExecutions.d.ts +20 -0
  532. package/session/useSessionExecutions.d.ts.map +1 -0
  533. package/session/useSessionExecutions.js +57 -0
  534. package/session/useSessionExecutions.js.map +1 -0
  535. package/session/useSessionList.d.ts +25 -0
  536. package/session/useSessionList.d.ts.map +1 -0
  537. package/session/useSessionList.js +57 -0
  538. package/session/useSessionList.js.map +1 -0
  539. package/session/useUpdateSession.d.ts +22 -0
  540. package/session/useUpdateSession.d.ts.map +1 -0
  541. package/session/useUpdateSession.js +38 -0
  542. package/session/useUpdateSession.js.map +1 -0
  543. package/skill/SkillDetailView.d.ts +51 -0
  544. package/skill/SkillDetailView.d.ts.map +1 -0
  545. package/skill/SkillDetailView.js +156 -0
  546. package/skill/SkillDetailView.js.map +1 -0
  547. package/skill/SkillPicker.d.ts +26 -0
  548. package/skill/SkillPicker.d.ts.map +1 -0
  549. package/skill/SkillPicker.js +102 -0
  550. package/skill/SkillPicker.js.map +1 -0
  551. package/skill/index.d.ts +12 -2
  552. package/skill/index.d.ts.map +1 -1
  553. package/skill/index.js +6 -2
  554. package/skill/index.js.map +1 -1
  555. package/skill/useSkill.d.ts +49 -0
  556. package/skill/useSkill.d.ts.map +1 -0
  557. package/skill/useSkill.js +83 -0
  558. package/skill/useSkill.js.map +1 -0
  559. package/skill/useSkillCount.d.ts +49 -0
  560. package/skill/useSkillCount.d.ts.map +1 -0
  561. package/skill/useSkillCount.js +32 -0
  562. package/skill/useSkillCount.js.map +1 -0
  563. package/skill/useSkillList.d.ts +62 -0
  564. package/skill/useSkillList.d.ts.map +1 -0
  565. package/skill/useSkillList.js +38 -0
  566. package/skill/useSkillList.js.map +1 -0
  567. package/skill/useSkillSearch.d.ts +18 -0
  568. package/skill/useSkillSearch.d.ts.map +1 -0
  569. package/skill/useSkillSearch.js +23 -0
  570. package/skill/useSkillSearch.js.map +1 -0
  571. package/src/__tests__/hooks.test.tsx +28 -0
  572. package/src/agent/AgentDetailView.tsx +712 -0
  573. package/src/agent/AgentEnvForm.tsx +113 -0
  574. package/src/agent/AgentPicker.tsx +342 -0
  575. package/src/agent/agentSetupReducer.ts +222 -0
  576. package/src/agent/index.ts +43 -11
  577. package/src/agent/useAgent.ts +103 -0
  578. package/src/agent/useAgentCount.ts +68 -0
  579. package/src/agent/useAgentList.ts +84 -0
  580. package/src/agent/useAgentSearch.ts +43 -0
  581. package/src/agent/useAgentSetup.ts +384 -0
  582. package/src/agent/useDefaultAgent.ts +77 -0
  583. package/src/agent-instance/buildPersonalInstanceInput.ts +40 -0
  584. package/src/agent-instance/index.ts +11 -0
  585. package/src/agent-instance/useAgentInstance.ts +87 -0
  586. package/src/agent-instance/useAgentInstanceList.ts +99 -0
  587. package/src/agent-instance/useCreateAgentInstance.ts +75 -0
  588. package/src/agent-instance/usePersonalAgentInstance.ts +185 -0
  589. package/src/attachment/AttachmentChipList.tsx +189 -0
  590. package/src/attachment/attachment-utils.ts +114 -0
  591. package/src/attachment/index.ts +17 -0
  592. package/src/attachment/useAttachments.ts +293 -0
  593. package/src/composer/ComposerToolbar.tsx +169 -0
  594. package/src/composer/ConfigureMenu.tsx +237 -0
  595. package/src/composer/ContextChip.tsx +104 -0
  596. package/src/composer/ContextPopover.tsx +54 -0
  597. package/src/composer/SessionComposer.tsx +1175 -0
  598. package/src/composer/icons.tsx +253 -0
  599. package/src/composer/index.ts +8 -0
  600. package/src/composer/useComposer.ts +163 -0
  601. package/src/environment/CreateEnvironmentForm.tsx +188 -0
  602. package/src/environment/EnvVarForm.tsx +475 -0
  603. package/src/environment/EnvironmentListPanel.tsx +258 -0
  604. package/src/environment/EnvironmentVariableEditor.tsx +811 -0
  605. package/src/environment/diffEnvSpec.ts +50 -0
  606. package/src/environment/index.ts +43 -0
  607. package/src/environment/useCreateEnvironment.ts +74 -0
  608. package/src/environment/useEnvironment.ts +89 -0
  609. package/src/environment/useEnvironmentList.ts +112 -0
  610. package/src/environment/usePersonalEnvironment.ts +285 -0
  611. package/src/environment/useRemoveEnvironmentVariables.ts +86 -0
  612. package/src/environment/useRevealSecretValue.ts +141 -0
  613. package/src/environment/useSessionEnvPool.ts +151 -0
  614. package/src/environment/useUpdateEnvironment.ts +74 -0
  615. package/src/environment/useUpdateEnvironmentVariables.ts +106 -0
  616. package/src/error/ErrorMessage.tsx +225 -0
  617. package/src/error/SecretFlowErrorGuide.tsx +189 -0
  618. package/src/error/index.ts +5 -0
  619. package/src/execution/ApprovalCard.tsx +499 -0
  620. package/src/execution/ArtifactCard.tsx +275 -0
  621. package/src/execution/ArtifactPreviewModal.tsx +942 -0
  622. package/src/execution/ArtifactsWidget.tsx +128 -0
  623. package/src/execution/ExecutionCostSummary.tsx +172 -0
  624. package/src/execution/ExecutionPhaseBadge.tsx +223 -0
  625. package/src/execution/ExecutionProgress.tsx +191 -0
  626. package/src/execution/FilePathContext.tsx +32 -0
  627. package/src/execution/FilePathLink.tsx +147 -0
  628. package/src/execution/FollowUpInput.tsx +220 -0
  629. package/src/execution/MessageEntry.tsx +120 -0
  630. package/src/execution/MessageThread.tsx +343 -0
  631. package/src/execution/SessionVariablesInput.tsx +374 -0
  632. package/src/execution/SubAgentSection.tsx +243 -0
  633. package/src/execution/ToolCallDetail.tsx +452 -0
  634. package/src/execution/ToolCallGroup.tsx +342 -0
  635. package/src/execution/ToolCallItem.tsx +426 -0
  636. package/src/execution/__tests__/ExecutionCostSummary.test.tsx +416 -0
  637. package/src/execution/__tests__/execution-phases.test.ts +31 -0
  638. package/src/execution/__tests__/useExecutionStream.test.tsx +242 -0
  639. package/src/execution/__tests__/useExecutionUsage.test.tsx +408 -0
  640. package/src/execution/artifact-utils.ts +136 -0
  641. package/src/execution/execution-phases.ts +16 -0
  642. package/src/execution/file-path-resolver.ts +171 -0
  643. package/src/execution/index.ts +97 -0
  644. package/src/execution/tool-categories.ts +171 -0
  645. package/src/execution/useArtifactContent.ts +156 -0
  646. package/src/execution/useCreateAgentExecution.ts +137 -0
  647. package/src/execution/useExecutionArtifacts.ts +58 -0
  648. package/src/execution/useExecutionStream.ts +149 -0
  649. package/src/execution/useExecutionUsage.ts +213 -0
  650. package/src/execution/useSessionVariables.ts +189 -0
  651. package/src/execution/useSubmitApproval.ts +98 -0
  652. package/src/github/GitHubRepoPicker.tsx +568 -0
  653. package/src/github/index.ts +19 -0
  654. package/src/github/useGitHubConnection.ts +368 -0
  655. package/src/github/useGitHubRepos.ts +197 -0
  656. package/src/index.ts +367 -0
  657. package/src/internal/ScrollFade.tsx +29 -0
  658. package/src/internal/markdown-components.tsx +197 -0
  659. package/src/internal/slug.ts +41 -0
  660. package/src/internal/toError.ts +19 -0
  661. package/src/internal/useScrollShadows.ts +54 -0
  662. package/src/library/ResourceCountCard.tsx +187 -0
  663. package/src/library/ResourceListView.tsx +698 -0
  664. package/src/library/ScopeToggle.tsx +121 -0
  665. package/src/library/detect-skill-package.ts +162 -0
  666. package/src/library/detect-stigmer-resource.ts +130 -0
  667. package/src/library/index.ts +42 -0
  668. package/src/library/parse-resource-yaml.ts +611 -0
  669. package/src/library/serialize-resource-yaml.ts +407 -0
  670. package/src/library/useApplyResource.ts +211 -0
  671. package/src/library/useDetectSkillPackage.ts +91 -0
  672. package/src/library/useDetectStigmerResource.ts +45 -0
  673. package/src/mcp-server/McpServerConfigPanel.tsx +265 -0
  674. package/src/mcp-server/McpServerDetailView.tsx +580 -0
  675. package/src/mcp-server/McpServerPicker.tsx +857 -0
  676. package/src/mcp-server/McpToolSelector.tsx +243 -0
  677. package/src/mcp-server/index.ts +44 -3
  678. package/src/mcp-server/mcpServerSetupReducer.ts +308 -0
  679. package/src/mcp-server/useMcpServer.ts +103 -0
  680. package/src/mcp-server/useMcpServerCount.ts +68 -0
  681. package/src/mcp-server/useMcpServerList.ts +84 -0
  682. package/src/mcp-server/useMcpServerSearch.ts +38 -0
  683. package/src/mcp-server/useMcpServerSetup.ts +487 -0
  684. package/src/models/ModelSelector.tsx +132 -0
  685. package/src/models/index.ts +6 -0
  686. package/src/models/registry.ts +60 -0
  687. package/src/models/useModelRegistry.ts +58 -0
  688. package/src/organization/CreateOrganizationForm.tsx +269 -0
  689. package/src/organization/index.ts +4 -0
  690. package/src/organization/useCreateOrganization.ts +65 -0
  691. package/src/search/index.ts +18 -0
  692. package/src/search/useResourceCount.ts +102 -0
  693. package/src/search/useResourceList.ts +123 -0
  694. package/src/search/useResourceSearch.ts +90 -0
  695. package/src/session/__tests__/group-sessions.test.ts +113 -0
  696. package/src/session/__tests__/useSessionConversation.test.tsx +305 -0
  697. package/src/session/group-sessions.ts +80 -0
  698. package/src/session/index.ts +30 -10
  699. package/src/session/useAgentRefFromSession.ts +94 -0
  700. package/src/session/useCreateSession.ts +141 -0
  701. package/src/session/useSession.ts +60 -0
  702. package/src/session/useSessionConversation.ts +515 -0
  703. package/src/session/useSessionExecutions.ts +77 -0
  704. package/src/session/useSessionList.ts +90 -0
  705. package/src/session/useUpdateSession.ts +54 -0
  706. package/src/skill/SkillDetailView.tsx +477 -0
  707. package/src/skill/SkillPicker.tsx +331 -0
  708. package/src/skill/index.ts +23 -3
  709. package/src/skill/useSkill.ts +105 -0
  710. package/src/skill/useSkillCount.ts +68 -0
  711. package/src/skill/useSkillList.ts +84 -0
  712. package/src/skill/useSkillSearch.ts +38 -0
  713. package/src/styles.css +2 -0
  714. package/src/workspace/FolderBrowser.tsx +568 -0
  715. package/src/workspace/WorkspaceEditor.tsx +480 -0
  716. package/src/workspace/WorkspaceSummary.tsx +109 -0
  717. package/src/workspace/index.ts +17 -0
  718. package/src/workspace/useFolderListing.ts +126 -0
  719. package/src/workspace/useWorkspaceEntries.ts +98 -0
  720. package/styles.css +1 -1
  721. package/workspace/FolderBrowser.d.ts +26 -0
  722. package/workspace/FolderBrowser.d.ts.map +1 -0
  723. package/workspace/FolderBrowser.js +179 -0
  724. package/workspace/FolderBrowser.js.map +1 -0
  725. package/workspace/WorkspaceEditor.d.ts +30 -0
  726. package/workspace/WorkspaceEditor.d.ts.map +1 -0
  727. package/workspace/WorkspaceEditor.js +116 -0
  728. package/workspace/WorkspaceEditor.js.map +1 -0
  729. package/workspace/WorkspaceSummary.d.ts +30 -0
  730. package/workspace/WorkspaceSummary.d.ts.map +1 -0
  731. package/workspace/WorkspaceSummary.js +53 -0
  732. package/workspace/WorkspaceSummary.js.map +1 -0
  733. package/workspace/index.d.ts +11 -0
  734. package/workspace/index.d.ts.map +1 -0
  735. package/workspace/index.js +6 -0
  736. package/workspace/index.js.map +1 -0
  737. package/workspace/useFolderListing.d.ts +35 -0
  738. package/workspace/useFolderListing.d.ts.map +1 -0
  739. package/workspace/useFolderListing.js +86 -0
  740. package/workspace/useFolderListing.js.map +1 -0
  741. package/workspace/useWorkspaceEntries.d.ts +28 -0
  742. package/workspace/useWorkspaceEntries.d.ts.map +1 -0
  743. package/workspace/useWorkspaceEntries.js +66 -0
  744. package/workspace/useWorkspaceEntries.js.map +1 -0
  745. package/agent/components/AgentCard.d.ts +0 -9
  746. package/agent/components/AgentCard.d.ts.map +0 -1
  747. package/agent/components/AgentCard.js +0 -26
  748. package/agent/components/AgentCard.js.map +0 -1
  749. package/agent/components/AgentOverview.d.ts +0 -7
  750. package/agent/components/AgentOverview.d.ts.map +0 -1
  751. package/agent/components/AgentOverview.js +0 -36
  752. package/agent/components/AgentOverview.js.map +0 -1
  753. package/agent/components/AgentPicker.d.ts +0 -17
  754. package/agent/components/AgentPicker.d.ts.map +0 -1
  755. package/agent/components/AgentPicker.js +0 -86
  756. package/agent/components/AgentPicker.js.map +0 -1
  757. package/agent/hooks/useAgentSearch.d.ts +0 -28
  758. package/agent/hooks/useAgentSearch.d.ts.map +0 -1
  759. package/agent/hooks/useAgentSearch.js +0 -63
  760. package/agent/hooks/useAgentSearch.js.map +0 -1
  761. package/agent-execution/components/ApprovalControls.d.ts +0 -10
  762. package/agent-execution/components/ApprovalControls.d.ts.map +0 -1
  763. package/agent-execution/components/ApprovalControls.js +0 -19
  764. package/agent-execution/components/ApprovalControls.js.map +0 -1
  765. package/agent-execution/components/ExecutionStatus.d.ts +0 -8
  766. package/agent-execution/components/ExecutionStatus.d.ts.map +0 -1
  767. package/agent-execution/components/ExecutionStatus.js +0 -14
  768. package/agent-execution/components/ExecutionStatus.js.map +0 -1
  769. package/agent-execution/components/ExecutionStream.d.ts +0 -16
  770. package/agent-execution/components/ExecutionStream.d.ts.map +0 -1
  771. package/agent-execution/components/ExecutionStream.js +0 -39
  772. package/agent-execution/components/ExecutionStream.js.map +0 -1
  773. package/agent-execution/components/MessageEntry.d.ts +0 -17
  774. package/agent-execution/components/MessageEntry.d.ts.map +0 -1
  775. package/agent-execution/components/MessageEntry.js +0 -36
  776. package/agent-execution/components/MessageEntry.js.map +0 -1
  777. package/agent-execution/components/MessageInput.d.ts +0 -10
  778. package/agent-execution/components/MessageInput.d.ts.map +0 -1
  779. package/agent-execution/components/MessageInput.js +0 -27
  780. package/agent-execution/components/MessageInput.js.map +0 -1
  781. package/agent-execution/components/OutputBlock.d.ts +0 -9
  782. package/agent-execution/components/OutputBlock.d.ts.map +0 -1
  783. package/agent-execution/components/OutputBlock.js +0 -15
  784. package/agent-execution/components/OutputBlock.js.map +0 -1
  785. package/agent-execution/components/SubAgentCard.d.ts +0 -11
  786. package/agent-execution/components/SubAgentCard.d.ts.map +0 -1
  787. package/agent-execution/components/SubAgentCard.js +0 -19
  788. package/agent-execution/components/SubAgentCard.js.map +0 -1
  789. package/agent-execution/components/ToolCallCard.d.ts +0 -11
  790. package/agent-execution/components/ToolCallCard.d.ts.map +0 -1
  791. package/agent-execution/components/ToolCallCard.js +0 -25
  792. package/agent-execution/components/ToolCallCard.js.map +0 -1
  793. package/agent-execution/helpers.d.ts +0 -35
  794. package/agent-execution/helpers.d.ts.map +0 -1
  795. package/agent-execution/helpers.js +0 -157
  796. package/agent-execution/helpers.js.map +0 -1
  797. package/agent-execution/hooks/useAgentExecution.d.ts +0 -21
  798. package/agent-execution/hooks/useAgentExecution.d.ts.map +0 -1
  799. package/agent-execution/hooks/useAgentExecution.js +0 -99
  800. package/agent-execution/hooks/useAgentExecution.js.map +0 -1
  801. package/agent-execution/hooks/useApproval.d.ts +0 -12
  802. package/agent-execution/hooks/useApproval.d.ts.map +0 -1
  803. package/agent-execution/hooks/useApproval.js +0 -32
  804. package/agent-execution/hooks/useApproval.js.map +0 -1
  805. package/agent-execution/index.d.ts +0 -14
  806. package/agent-execution/index.d.ts.map +0 -1
  807. package/agent-execution/index.js +0 -15
  808. package/agent-execution/index.js.map +0 -1
  809. package/catalog/components/ResourceSearchCard.d.ts +0 -23
  810. package/catalog/components/ResourceSearchCard.d.ts.map +0 -1
  811. package/catalog/components/ResourceSearchCard.js +0 -36
  812. package/catalog/components/ResourceSearchCard.js.map +0 -1
  813. package/catalog/index.d.ts +0 -4
  814. package/catalog/index.d.ts.map +0 -1
  815. package/catalog/index.js +0 -5
  816. package/catalog/index.js.map +0 -1
  817. package/catalog/internal/time.d.ts +0 -13
  818. package/catalog/internal/time.d.ts.map +0 -1
  819. package/catalog/internal/time.js +0 -41
  820. package/catalog/internal/time.js.map +0 -1
  821. package/internal/badge.d.ts +0 -8
  822. package/internal/badge.d.ts.map +0 -1
  823. package/internal/badge.js +0 -34
  824. package/internal/badge.js.map +0 -1
  825. package/internal/button.d.ts +0 -9
  826. package/internal/button.d.ts.map +0 -1
  827. package/internal/button.js +0 -36
  828. package/internal/button.js.map +0 -1
  829. package/internal/collapsible.d.ts +0 -6
  830. package/internal/collapsible.d.ts.map +0 -1
  831. package/internal/collapsible.js +0 -14
  832. package/internal/collapsible.js.map +0 -1
  833. package/internal/section.d.ts +0 -8
  834. package/internal/section.d.ts.map +0 -1
  835. package/internal/section.js +0 -6
  836. package/internal/section.js.map +0 -1
  837. package/internal/textarea.d.ts +0 -4
  838. package/internal/textarea.d.ts.map +0 -1
  839. package/internal/textarea.js +0 -9
  840. package/internal/textarea.js.map +0 -1
  841. package/mcp-server/hooks/useMcpServerSearch.d.ts +0 -25
  842. package/mcp-server/hooks/useMcpServerSearch.d.ts.map +0 -1
  843. package/mcp-server/hooks/useMcpServerSearch.js +0 -57
  844. package/mcp-server/hooks/useMcpServerSearch.js.map +0 -1
  845. package/session/components/AgentSessionHistory.d.ts +0 -8
  846. package/session/components/AgentSessionHistory.d.ts.map +0 -1
  847. package/session/components/AgentSessionHistory.js +0 -11
  848. package/session/components/AgentSessionHistory.js.map +0 -1
  849. package/session/components/SessionCard.d.ts +0 -8
  850. package/session/components/SessionCard.d.ts.map +0 -1
  851. package/session/components/SessionCard.js +0 -57
  852. package/session/components/SessionCard.js.map +0 -1
  853. package/session/hooks/useAgentSessionList.d.ts +0 -21
  854. package/session/hooks/useAgentSessionList.d.ts.map +0 -1
  855. package/session/hooks/useAgentSessionList.js +0 -90
  856. package/session/hooks/useAgentSessionList.js.map +0 -1
  857. package/skill/hooks/useSkillSearch.d.ts +0 -25
  858. package/skill/hooks/useSkillSearch.d.ts.map +0 -1
  859. package/skill/hooks/useSkillSearch.js +0 -57
  860. package/skill/hooks/useSkillSearch.js.map +0 -1
  861. package/src/agent/components/AgentCard.tsx +0 -125
  862. package/src/agent/components/AgentOverview.tsx +0 -209
  863. package/src/agent/components/AgentPicker.tsx +0 -255
  864. package/src/agent/hooks/useAgentSearch.ts +0 -94
  865. package/src/agent-execution/components/ApprovalControls.tsx +0 -99
  866. package/src/agent-execution/components/ExecutionStatus.tsx +0 -33
  867. package/src/agent-execution/components/ExecutionStream.tsx +0 -148
  868. package/src/agent-execution/components/MessageEntry.tsx +0 -125
  869. package/src/agent-execution/components/MessageInput.tsx +0 -70
  870. package/src/agent-execution/components/OutputBlock.tsx +0 -43
  871. package/src/agent-execution/components/SubAgentCard.tsx +0 -138
  872. package/src/agent-execution/components/ToolCallCard.tsx +0 -153
  873. package/src/agent-execution/helpers.ts +0 -193
  874. package/src/agent-execution/hooks/useAgentExecution.ts +0 -147
  875. package/src/agent-execution/hooks/useApproval.ts +0 -56
  876. package/src/agent-execution/index.ts +0 -46
  877. package/src/catalog/components/ResourceSearchCard.tsx +0 -137
  878. package/src/catalog/index.ts +0 -6
  879. package/src/catalog/internal/time.ts +0 -40
  880. package/src/internal/badge.tsx +0 -52
  881. package/src/internal/button.tsx +0 -60
  882. package/src/internal/collapsible.tsx +0 -21
  883. package/src/internal/section.tsx +0 -18
  884. package/src/internal/textarea.tsx +0 -23
  885. package/src/mcp-server/hooks/useMcpServerSearch.ts +0 -79
  886. package/src/session/components/AgentSessionHistory.tsx +0 -109
  887. package/src/session/components/SessionCard.tsx +0 -113
  888. package/src/session/hooks/useAgentSessionList.ts +0 -117
  889. package/src/skill/hooks/useSkillSearch.ts +0 -79
@@ -0,0 +1,60 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+ import type { Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
5
+ import { useStigmer } from "../hooks";
6
+ import { toError } from "../internal/toError";
7
+
8
+ export interface UseSessionReturn {
9
+ readonly session: Session | null;
10
+ readonly isLoading: boolean;
11
+ readonly error: Error | null;
12
+ }
13
+
14
+ /**
15
+ * Data hook that fetches a single Session by ID.
16
+ *
17
+ * Pass `null` to skip fetching (stable no-op). When the `id` changes,
18
+ * the previous in-flight request is discarded and a fresh fetch begins.
19
+ *
20
+ * Returns the full proto {@link Session} resource so consumers have
21
+ * access to metadata, spec, and status without additional calls.
22
+ */
23
+ export function useSession(id: string | null): UseSessionReturn {
24
+ const stigmer = useStigmer();
25
+ const [session, setSession] = useState<Session | null>(null);
26
+ const [isLoading, setIsLoading] = useState(false);
27
+ const [error, setError] = useState<Error | null>(null);
28
+
29
+ useEffect(() => {
30
+ if (!id) {
31
+ setSession(null);
32
+ setIsLoading(false);
33
+ setError(null);
34
+ return;
35
+ }
36
+
37
+ const cancelled = { current: false };
38
+ setIsLoading(true);
39
+ setError(null);
40
+
41
+ stigmer.session.get(id).then(
42
+ (result) => {
43
+ if (cancelled.current) return;
44
+ setSession(result);
45
+ setIsLoading(false);
46
+ },
47
+ (err) => {
48
+ if (cancelled.current) return;
49
+ setError(toError(err));
50
+ setIsLoading(false);
51
+ },
52
+ );
53
+
54
+ return () => {
55
+ cancelled.current = true;
56
+ };
57
+ }, [id, stigmer]);
58
+
59
+ return { session, isLoading, error };
60
+ }
@@ -0,0 +1,515 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useMemo, useState } from "react";
4
+ import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
5
+ import type { PendingApproval } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/approval_pb";
6
+ import { ApprovalAction, type ExecutionPhase } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
7
+ import type { Session } from "@stigmer/protos/ai/stigmer/agentic/session/v1/api_pb";
8
+ import type { McpServerUsage as ProtoMcpServerUsage } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
9
+ import type { WorkspaceEntry as ProtoWorkspaceEntry } from "@stigmer/protos/ai/stigmer/agentic/session/v1/workspace_pb";
10
+ import type { ApiResourceReference as ProtoApiResourceReference } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
11
+ import type {
12
+ AttachmentInput,
13
+ EnvVarInput,
14
+ McpServerUsageInput,
15
+ ResourceRef,
16
+ WorkspaceEntryInput,
17
+ } from "@stigmer/sdk";
18
+ import { isTerminalPhase } from "../execution/execution-phases";
19
+ import { useCreateAgentExecution } from "../execution/useCreateAgentExecution";
20
+ import { useExecutionStream } from "../execution/useExecutionStream";
21
+ import { useSubmitApproval } from "../execution/useSubmitApproval";
22
+ import { useSession } from "./useSession";
23
+ import { useSessionExecutions } from "./useSessionExecutions";
24
+ import { useUpdateSession } from "./useUpdateSession";
25
+
26
+ /**
27
+ * Options for {@link UseSessionConversationReturn.sendFollowUp}.
28
+ *
29
+ * Session-level fields (`workspaceEntries`, `mcpServerUsages`,
30
+ * `skillRefs`) trigger a `session.update()` before the execution is
31
+ * created. Only provided fields are overwritten; omitted fields
32
+ * preserve the session's existing values.
33
+ *
34
+ * `runtimeEnv` is forwarded to the execution (Execution Flow). These
35
+ * values are scoped to the single execution and deleted on completion.
36
+ */
37
+ export interface SendFollowUpOptions {
38
+ readonly modelName?: string;
39
+ /**
40
+ * Override the session's agent instance for this and all future
41
+ * executions. When provided, the session is updated before the
42
+ * execution is created.
43
+ */
44
+ readonly agentInstanceId?: string;
45
+ readonly workspaceEntries?: WorkspaceEntryInput[];
46
+ readonly mcpServerUsages?: McpServerUsageInput[];
47
+ readonly skillRefs?: ResourceRef[];
48
+ /**
49
+ * Execution-scoped secrets and configuration (Execution Flow).
50
+ *
51
+ * Values are injected into the agent sandbox for this execution only
52
+ * and deleted when the execution completes. They override both
53
+ * Environment values and agent defaults.
54
+ *
55
+ * @see {@link CreateAgentExecutionInput.runtimeEnv}
56
+ */
57
+ readonly runtimeEnv?: Record<string, EnvVarInput>;
58
+ /**
59
+ * Pre-uploaded file attachments for this execution.
60
+ *
61
+ * Each entry must include a `storageKey` from
62
+ * `agentExecution.uploadAttachment()`. Forwarded directly to
63
+ * execution creation.
64
+ *
65
+ * @see {@link CreateAgentExecutionInput.attachments}
66
+ */
67
+ readonly attachments?: AttachmentInput[];
68
+ }
69
+
70
+ export interface UseSessionConversationReturn {
71
+ /** The session object, or null while loading. */
72
+ readonly session: Session | null;
73
+ /** Executions in terminal phases, in chronological order. */
74
+ readonly completedExecutions: readonly AgentExecution[];
75
+ /** Currently streaming execution (stream or fetch fallback), or null. */
76
+ readonly activeStreamExecution: AgentExecution | null;
77
+ /** Phase of the active execution, or null if none active. */
78
+ readonly activePhase: ExecutionPhase | null;
79
+ /** True while the active execution's stream is delivering updates. */
80
+ readonly isStreaming: boolean;
81
+
82
+ /**
83
+ * Submit a follow-up message. Internally creates an execution and
84
+ * starts streaming it.
85
+ *
86
+ * When session-level fields (`agentInstanceId`, `workspaceEntries`,
87
+ * `mcpServerUsages`, `skillRefs`) are provided in options, the
88
+ * session is updated via `session.update()` before creating the
89
+ * execution.
90
+ */
91
+ readonly sendFollowUp: (
92
+ message: string,
93
+ options?: SendFollowUpOptions,
94
+ ) => Promise<void>;
95
+ /** True when the input should be enabled (no active execution, not creating). */
96
+ readonly canSendFollowUp: boolean;
97
+ /** True during the create RPC call (between submit and execution ID). */
98
+ readonly isSending: boolean;
99
+ /** Error from the last sendFollowUp attempt, or null. */
100
+ readonly sendError: Error | null;
101
+ readonly clearSendError: () => void;
102
+
103
+ /** The user's message text, shown in the thread before the stream delivers it. */
104
+ readonly pendingUserMessage: string | null;
105
+
106
+ /** Current workspace entries from the session spec. Empty array when session is not loaded. */
107
+ readonly workspaceEntries: readonly ProtoWorkspaceEntry[];
108
+ /** Current MCP server usages from the session spec. Empty array when session is not loaded. */
109
+ readonly mcpServerUsages: readonly ProtoMcpServerUsage[];
110
+ /** Current skill references from the session spec. Empty array when session is not loaded. */
111
+ readonly skillRefs: readonly ProtoApiResourceReference[];
112
+
113
+ /** Pending approval requests from the active execution, empty when none. */
114
+ readonly pendingApprovals: readonly PendingApproval[];
115
+ /** Submit an approval decision. The executionId is managed internally. */
116
+ readonly submitApproval: (
117
+ toolCallId: string,
118
+ action: ApprovalAction,
119
+ comment?: string,
120
+ ) => Promise<void>;
121
+ /** Set of tool call IDs currently being submitted for approval. */
122
+ readonly submittingApprovalIds: ReadonlySet<string>;
123
+ /**
124
+ * Tool call IDs that have been submitted and should be hidden from
125
+ * the approval UI. Pass to {@link MessageThread.dismissedApprovalIds}
126
+ * for optimistic removal.
127
+ */
128
+ readonly dismissedApprovalIds: ReadonlySet<string>;
129
+ readonly approvalError: Error | null;
130
+ readonly clearApprovalError: () => void;
131
+
132
+ readonly isLoading: boolean;
133
+ readonly loadError: Error | null;
134
+
135
+ readonly streamError: Error | null;
136
+ readonly reconnectStream: () => void;
137
+ }
138
+
139
+ /**
140
+ * Behavior hook that encapsulates the full conversation lifecycle for
141
+ * a session: loading data, streaming the active execution, submitting
142
+ * follow-up messages, and updating session-level workspace entries.
143
+ *
144
+ * Composes {@link useSession}, {@link useSessionExecutions},
145
+ * {@link useCreateAgentExecution}, {@link useExecutionStream}, and
146
+ * {@link useUpdateSession} into a single return value that drives
147
+ * both {@link MessageThread} and {@link SessionComposer}.
148
+ *
149
+ * Platform builders get the complete conversation loop without
150
+ * reimplementing orchestration logic.
151
+ *
152
+ * @param sessionId - Session to display and converse in. Pass `null` to skip.
153
+ * @param org - Organization slug for creating follow-up executions.
154
+ *
155
+ * @example
156
+ * ```tsx
157
+ * function Chat({ sessionId, org }: { sessionId: string; org: string }) {
158
+ * const conv = useSessionConversation(sessionId, org);
159
+ *
160
+ * if (conv.isLoading) return <Spinner />;
161
+ *
162
+ * return (
163
+ * <>
164
+ * <MessageThread
165
+ * executions={conv.completedExecutions}
166
+ * activeStreamExecution={conv.activeStreamExecution}
167
+ * pendingUserMessage={conv.pendingUserMessage}
168
+ * onApprovalSubmit={conv.submitApproval}
169
+ * submittingApprovalIds={conv.submittingApprovalIds}
170
+ * dismissedApprovalIds={conv.dismissedApprovalIds}
171
+ * />
172
+ * <SessionComposer
173
+ * onSubmit={(msg, model) => conv.sendFollowUp(msg, { modelName: model })}
174
+ * disabled={!conv.canSendFollowUp}
175
+ * isSubmitting={conv.isSending}
176
+ * />
177
+ * </>
178
+ * );
179
+ * }
180
+ * ```
181
+ */
182
+ export function useSessionConversation(
183
+ sessionId: string | null,
184
+ org: string,
185
+ ): UseSessionConversationReturn {
186
+ const { session, isLoading: sessionLoading, error: sessionError } =
187
+ useSession(sessionId);
188
+ const {
189
+ executions,
190
+ isLoading: executionsLoading,
191
+ error: executionsError,
192
+ refetch,
193
+ } = useSessionExecutions(sessionId);
194
+ const {
195
+ create,
196
+ isCreating,
197
+ error: createError,
198
+ clearError: clearCreateError,
199
+ } = useCreateAgentExecution();
200
+ const { update: updateSession } = useUpdateSession();
201
+ const {
202
+ submitApproval: rawSubmitApproval,
203
+ submittingToolCallIds,
204
+ error: approvalError,
205
+ clearError: clearApprovalError,
206
+ } = useSubmitApproval();
207
+
208
+ const [pendingExecutionId, setPendingExecutionId] = useState<string | null>(
209
+ null,
210
+ );
211
+ const [pendingUserMessage, setPendingUserMessage] = useState<string | null>(
212
+ null,
213
+ );
214
+ const [dismissedApprovalIds, setDismissedApprovalIds] = useState<
215
+ ReadonlySet<string>
216
+ >(new Set());
217
+
218
+ const listActiveId = useMemo(() => {
219
+ for (let i = executions.length - 1; i >= 0; i--) {
220
+ const phase = executions[i].status?.phase;
221
+ if (phase === undefined || !isTerminalPhase(phase)) {
222
+ return executions[i].metadata?.id ?? null;
223
+ }
224
+ }
225
+ return null;
226
+ }, [executions]);
227
+
228
+ const activeExecutionId = pendingExecutionId ?? listActiveId;
229
+
230
+ const stream = useExecutionStream(activeExecutionId);
231
+
232
+ useEffect(() => {
233
+ setDismissedApprovalIds(new Set());
234
+ }, [activeExecutionId]);
235
+
236
+ // Clear pendingExecutionId once the execution appears in the fetched list
237
+ useEffect(() => {
238
+ if (
239
+ pendingExecutionId &&
240
+ executions.some((e) => (e.metadata?.id ?? "") === pendingExecutionId)
241
+ ) {
242
+ setPendingExecutionId(null);
243
+ }
244
+ }, [pendingExecutionId, executions]);
245
+
246
+ // Clear optimistic message once the stream delivers its first snapshot
247
+ useEffect(() => {
248
+ if (pendingUserMessage && stream.execution) {
249
+ setPendingUserMessage(null);
250
+ }
251
+ }, [pendingUserMessage, stream.execution]);
252
+
253
+ // Refetch executions when stream reaches a terminal phase so the
254
+ // fetched list reflects the completed status and listActiveId clears.
255
+ useEffect(() => {
256
+ if (activeExecutionId && isTerminalPhase(stream.phase)) {
257
+ refetch();
258
+ }
259
+ }, [activeExecutionId, stream.phase, refetch]);
260
+
261
+ const completedExecutions = useMemo(() => {
262
+ if (!activeExecutionId) return executions;
263
+ return executions.filter(
264
+ (e) => (e.metadata?.id ?? "") !== activeExecutionId,
265
+ );
266
+ }, [executions, activeExecutionId]);
267
+
268
+ const fetchedActiveExecution = useMemo(() => {
269
+ if (!activeExecutionId) return null;
270
+ return (
271
+ executions.find(
272
+ (e) => (e.metadata?.id ?? "") === activeExecutionId,
273
+ ) ?? null
274
+ );
275
+ }, [executions, activeExecutionId]);
276
+
277
+ const activeStreamExecution = stream.execution ?? fetchedActiveExecution;
278
+
279
+ const activePhase = useMemo<ExecutionPhase | null>(() => {
280
+ if (!activeExecutionId) return null;
281
+ return stream.phase;
282
+ }, [activeExecutionId, stream.phase]);
283
+
284
+ const canSendFollowUp = !isCreating && activeExecutionId === null;
285
+
286
+ const workspaceEntries = useMemo<readonly ProtoWorkspaceEntry[]>(
287
+ () => session?.spec?.workspaceEntries ?? [],
288
+ [session],
289
+ );
290
+
291
+ const mcpServerUsages = useMemo<readonly ProtoMcpServerUsage[]>(
292
+ () => session?.spec?.mcpServerUsages ?? [],
293
+ [session],
294
+ );
295
+
296
+ const skillRefs = useMemo<readonly ProtoApiResourceReference[]>(
297
+ () => session?.spec?.skillRefs ?? [],
298
+ [session],
299
+ );
300
+
301
+ const sendFollowUp = useCallback(
302
+ async (message: string, options?: SendFollowUpOptions): Promise<void> => {
303
+ if (!sessionId || !session) return;
304
+
305
+ setPendingUserMessage(message);
306
+
307
+ try {
308
+ const needsSessionUpdate =
309
+ options?.agentInstanceId !== undefined ||
310
+ options?.workspaceEntries !== undefined ||
311
+ options?.mcpServerUsages !== undefined ||
312
+ options?.skillRefs !== undefined;
313
+
314
+ if (needsSessionUpdate) {
315
+ await updateSession(
316
+ buildUpdateInput(session, {
317
+ agentInstanceId: options?.agentInstanceId,
318
+ workspaceEntries: options?.workspaceEntries,
319
+ mcpServerUsages: options?.mcpServerUsages,
320
+ skillRefs: options?.skillRefs,
321
+ }),
322
+ );
323
+ }
324
+
325
+ const result = await create({
326
+ org,
327
+ sessionId,
328
+ message,
329
+ modelName: options?.modelName,
330
+ runtimeEnv: options?.runtimeEnv,
331
+ attachments: options?.attachments,
332
+ });
333
+ setPendingExecutionId(result.executionId);
334
+ refetch();
335
+ } catch {
336
+ setPendingUserMessage(null);
337
+ }
338
+ },
339
+ [sessionId, session, org, create, updateSession, refetch],
340
+ );
341
+
342
+ const pendingApprovals = useMemo<readonly PendingApproval[]>(() => {
343
+ const all = activeStreamExecution?.status?.pendingApprovals ?? [];
344
+ if (dismissedApprovalIds.size === 0) return all;
345
+ return all.filter((a) => !dismissedApprovalIds.has(a.toolCallId));
346
+ }, [activeStreamExecution, dismissedApprovalIds]);
347
+
348
+ const submitApproval = useCallback(
349
+ async (
350
+ toolCallId: string,
351
+ action: ApprovalAction,
352
+ comment?: string,
353
+ ): Promise<void> => {
354
+ if (!activeExecutionId) return;
355
+ await rawSubmitApproval(activeExecutionId, toolCallId, action, comment);
356
+ setDismissedApprovalIds((prev) => {
357
+ const next = new Set(prev);
358
+ next.add(toolCallId);
359
+ return next;
360
+ });
361
+ },
362
+ [activeExecutionId, rawSubmitApproval],
363
+ );
364
+
365
+ const isLoading = sessionLoading || executionsLoading;
366
+ const loadError = sessionError || executionsError;
367
+
368
+ return {
369
+ session,
370
+ completedExecutions,
371
+ activeStreamExecution,
372
+ activePhase,
373
+ isStreaming: stream.isStreaming,
374
+
375
+ sendFollowUp,
376
+ canSendFollowUp,
377
+ isSending: isCreating,
378
+ sendError: createError,
379
+ clearSendError: clearCreateError,
380
+
381
+ pendingUserMessage,
382
+
383
+ workspaceEntries,
384
+ mcpServerUsages,
385
+ skillRefs,
386
+
387
+ pendingApprovals,
388
+ submitApproval,
389
+ submittingApprovalIds: submittingToolCallIds,
390
+ dismissedApprovalIds,
391
+ approvalError,
392
+ clearApprovalError,
393
+
394
+ isLoading,
395
+ loadError,
396
+
397
+ streamError: stream.error,
398
+ reconnectStream: stream.reconnect,
399
+ };
400
+ }
401
+
402
+ // ---------------------------------------------------------------------------
403
+ // Internal helpers
404
+ // ---------------------------------------------------------------------------
405
+
406
+ /**
407
+ * Converts the existing Session proto into a SessionInput suitable for
408
+ * the update RPC (which uses replace semantics — the full spec is sent).
409
+ *
410
+ * For each session-level collection (workspace, MCP servers, skills):
411
+ * if an override is provided, it replaces the existing value; otherwise
412
+ * the current session value is preserved by converting it back to input
413
+ * format.
414
+ */
415
+ function buildUpdateInput(
416
+ session: Session,
417
+ overrides: {
418
+ agentInstanceId?: string;
419
+ workspaceEntries?: WorkspaceEntryInput[];
420
+ mcpServerUsages?: McpServerUsageInput[];
421
+ skillRefs?: ResourceRef[];
422
+ },
423
+ ) {
424
+ const meta = session.metadata!;
425
+ const spec = session.spec;
426
+
427
+ const workspaceEntries =
428
+ overrides.workspaceEntries ?? specWorkspaceToInput(spec);
429
+
430
+ const mcpServerUsages =
431
+ overrides.mcpServerUsages ?? specMcpUsagesToInput(spec);
432
+
433
+ const skillRefs = overrides.skillRefs ?? specSkillRefsToInput(spec);
434
+
435
+ return {
436
+ name: meta.name,
437
+ org: meta.org,
438
+ agentInstanceId: overrides.agentInstanceId ?? (spec?.agentInstanceId || undefined),
439
+ subject: spec?.subject || undefined,
440
+ threadId: spec?.threadId || undefined,
441
+ sandboxId: spec?.sandboxId || undefined,
442
+ metadata:
443
+ spec?.metadata && Object.keys(spec.metadata).length > 0
444
+ ? { ...spec.metadata }
445
+ : undefined,
446
+ workspaceEntries: workspaceEntries?.length ? workspaceEntries : undefined,
447
+ mcpServerUsages: mcpServerUsages?.length ? mcpServerUsages : undefined,
448
+ skillRefs: skillRefs?.length ? skillRefs : undefined,
449
+ };
450
+ }
451
+
452
+ /** Convert proto workspace entries back to SDK input format. */
453
+ function specWorkspaceToInput(
454
+ spec: Session["spec"],
455
+ ): WorkspaceEntryInput[] | undefined {
456
+ return spec?.workspaceEntries?.map((e): WorkspaceEntryInput => {
457
+ if (e.source?.source.case === "gitRepo") {
458
+ const v = e.source.source.value;
459
+ return {
460
+ name: e.name || undefined,
461
+ source: {
462
+ gitRepo: {
463
+ url: v.url,
464
+ branch: v.branch || undefined,
465
+ commit: v.commit || undefined,
466
+ depth: v.depth || undefined,
467
+ },
468
+ },
469
+ };
470
+ }
471
+ if (e.source?.source.case === "localPath") {
472
+ return {
473
+ name: e.name || undefined,
474
+ source: {
475
+ localPath: { path: e.source.source.value.path || undefined },
476
+ },
477
+ };
478
+ }
479
+ return { name: e.name || undefined, source: {} };
480
+ });
481
+ }
482
+
483
+ /** Convert proto MCP server usages back to SDK input format. */
484
+ function specMcpUsagesToInput(
485
+ spec: Session["spec"],
486
+ ): McpServerUsageInput[] | undefined {
487
+ return spec?.mcpServerUsages?.map((u) => ({
488
+ mcpServerRef: {
489
+ org: u.mcpServerRef?.org ?? "",
490
+ slug: u.mcpServerRef?.slug ?? "",
491
+ version: u.mcpServerRef?.version || undefined,
492
+ kind: u.mcpServerRef?.kind,
493
+ },
494
+ enabledTools: u.enabledTools?.length ? [...u.enabledTools] : undefined,
495
+ toolApprovalOverrides: u.toolApprovalOverrides?.length
496
+ ? u.toolApprovalOverrides.map((o) => ({
497
+ toolName: o.toolName || undefined,
498
+ requiresApproval: o.requiresApproval || undefined,
499
+ message: o.message || undefined,
500
+ }))
501
+ : undefined,
502
+ }));
503
+ }
504
+
505
+ /** Convert proto skill references back to SDK input format. */
506
+ function specSkillRefsToInput(
507
+ spec: Session["spec"],
508
+ ): ResourceRef[] | undefined {
509
+ return spec?.skillRefs?.map((r) => ({
510
+ org: r.org ?? "",
511
+ slug: r.slug ?? "",
512
+ version: r.version || undefined,
513
+ kind: r.kind,
514
+ }));
515
+ }
@@ -0,0 +1,77 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useState } from "react";
4
+ import { create } from "@bufbuild/protobuf";
5
+ import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
6
+ import { ListAgentExecutionsBySessionRequestSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
7
+ import { useStigmer } from "../hooks";
8
+ import { toError } from "../internal/toError";
9
+
10
+ export interface UseSessionExecutionsReturn {
11
+ readonly executions: readonly AgentExecution[];
12
+ readonly isLoading: boolean;
13
+ readonly error: Error | null;
14
+ readonly refetch: () => void;
15
+ }
16
+
17
+ /**
18
+ * Data hook that fetches all {@link AgentExecution} entries for a session.
19
+ *
20
+ * Pass `null` to skip fetching (stable no-op). Call `refetch()` to
21
+ * re-query after a new execution is created within the same session
22
+ * (needed by the follow-up conversation loop in SP2).
23
+ *
24
+ * Returns up to 100 executions per call. Sessions rarely exceed a
25
+ * handful of executions; full cursor-based pagination can be added
26
+ * later without breaking the return type.
27
+ */
28
+ export function useSessionExecutions(
29
+ sessionId: string | null,
30
+ ): UseSessionExecutionsReturn {
31
+ const stigmer = useStigmer();
32
+ const [executions, setExecutions] = useState<AgentExecution[]>([]);
33
+ const [isLoading, setIsLoading] = useState(false);
34
+ const [error, setError] = useState<Error | null>(null);
35
+ const [fetchKey, setFetchKey] = useState(0);
36
+
37
+ const refetch = useCallback(() => setFetchKey((k) => k + 1), []);
38
+
39
+ useEffect(() => {
40
+ if (!sessionId) {
41
+ setExecutions([]);
42
+ setIsLoading(false);
43
+ setError(null);
44
+ return;
45
+ }
46
+
47
+ const cancelled = { current: false };
48
+ setIsLoading(true);
49
+ setError(null);
50
+
51
+ stigmer.agentExecution
52
+ .listBySession(
53
+ create(ListAgentExecutionsBySessionRequestSchema, {
54
+ sessionId,
55
+ pageSize: 100,
56
+ }),
57
+ )
58
+ .then(
59
+ (result) => {
60
+ if (cancelled.current) return;
61
+ setExecutions(result.entries);
62
+ setIsLoading(false);
63
+ },
64
+ (err) => {
65
+ if (cancelled.current) return;
66
+ setError(toError(err));
67
+ setIsLoading(false);
68
+ },
69
+ );
70
+
71
+ return () => {
72
+ cancelled.current = true;
73
+ };
74
+ }, [sessionId, stigmer, fetchKey]);
75
+
76
+ return { executions, isLoading, error, refetch };
77
+ }