@stigmer/react 3.2.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (513) hide show
  1. package/agent/AgentDetailView.d.ts.map +1 -1
  2. package/agent/AgentDetailView.js +6 -3
  3. package/agent/AgentDetailView.js.map +1 -1
  4. package/agent/steps/ReviewStep.d.ts.map +1 -1
  5. package/agent/steps/ReviewStep.js +2 -3
  6. package/agent/steps/ReviewStep.js.map +1 -1
  7. package/billing/BaselineEditor.d.ts +9 -0
  8. package/billing/BaselineEditor.d.ts.map +1 -0
  9. package/billing/BaselineEditor.js +253 -0
  10. package/billing/BaselineEditor.js.map +1 -0
  11. package/billing/ModelCatalogPanel.d.ts +28 -0
  12. package/billing/ModelCatalogPanel.d.ts.map +1 -0
  13. package/billing/ModelCatalogPanel.js +102 -0
  14. package/billing/ModelCatalogPanel.js.map +1 -0
  15. package/billing/ModelGovernanceDetail.d.ts +8 -0
  16. package/billing/ModelGovernanceDetail.d.ts.map +1 -0
  17. package/billing/ModelGovernanceDetail.js +64 -0
  18. package/billing/ModelGovernanceDetail.js.map +1 -0
  19. package/billing/OperatorAccessNotice.d.ts +12 -0
  20. package/billing/OperatorAccessNotice.d.ts.map +1 -0
  21. package/billing/OperatorAccessNotice.js +15 -0
  22. package/billing/OperatorAccessNotice.js.map +1 -0
  23. package/billing/PricingGovernanceConsole.d.ts +57 -0
  24. package/billing/PricingGovernanceConsole.d.ts.map +1 -0
  25. package/billing/PricingGovernanceConsole.js +164 -0
  26. package/billing/PricingGovernanceConsole.js.map +1 -0
  27. package/billing/PricingGovernancePanel.d.ts +26 -0
  28. package/billing/PricingGovernancePanel.d.ts.map +1 -0
  29. package/billing/PricingGovernancePanel.js +64 -0
  30. package/billing/PricingGovernancePanel.js.map +1 -0
  31. package/billing/RetireConfirm.d.ts +9 -0
  32. package/billing/RetireConfirm.d.ts.map +1 -0
  33. package/billing/RetireConfirm.js +19 -0
  34. package/billing/RetireConfirm.js.map +1 -0
  35. package/billing/form-primitives.d.ts +18 -0
  36. package/billing/form-primitives.d.ts.map +1 -0
  37. package/billing/form-primitives.js +19 -0
  38. package/billing/form-primitives.js.map +1 -0
  39. package/billing/governance-primitives.d.ts +33 -0
  40. package/billing/governance-primitives.d.ts.map +1 -0
  41. package/billing/governance-primitives.js +43 -0
  42. package/billing/governance-primitives.js.map +1 -0
  43. package/billing/index.d.ts +18 -0
  44. package/billing/index.d.ts.map +1 -1
  45. package/billing/index.js +9 -0
  46. package/billing/index.js.map +1 -1
  47. package/billing/pricing-format.d.ts +12 -0
  48. package/billing/pricing-format.d.ts.map +1 -0
  49. package/billing/pricing-format.js +50 -0
  50. package/billing/pricing-format.js.map +1 -0
  51. package/billing/useDecidePricingOverride.d.ts +46 -0
  52. package/billing/useDecidePricingOverride.d.ts.map +1 -0
  53. package/billing/useDecidePricingOverride.js +44 -0
  54. package/billing/useDecidePricingOverride.js.map +1 -0
  55. package/billing/useModelGovernanceView.d.ts +103 -0
  56. package/billing/useModelGovernanceView.d.ts.map +1 -0
  57. package/billing/useModelGovernanceView.js +144 -0
  58. package/billing/useModelGovernanceView.js.map +1 -0
  59. package/billing/useModelPricingBaselines.d.ts +40 -0
  60. package/billing/useModelPricingBaselines.d.ts.map +1 -0
  61. package/billing/useModelPricingBaselines.js +32 -0
  62. package/billing/useModelPricingBaselines.js.map +1 -0
  63. package/billing/usePricingGovernance.d.ts +39 -0
  64. package/billing/usePricingGovernance.d.ts.map +1 -0
  65. package/billing/usePricingGovernance.js +31 -0
  66. package/billing/usePricingGovernance.js.map +1 -0
  67. package/billing/useRetireModelPricingBaseline.d.ts +31 -0
  68. package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
  69. package/billing/useRetireModelPricingBaseline.js +36 -0
  70. package/billing/useRetireModelPricingBaseline.js.map +1 -0
  71. package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
  72. package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
  73. package/billing/useUpsertModelPricingBaseline.js +37 -0
  74. package/billing/useUpsertModelPricingBaseline.js.map +1 -0
  75. package/channel/AgentChannelsPanel.d.ts.map +1 -1
  76. package/channel/AgentChannelsPanel.js +11 -5
  77. package/channel/AgentChannelsPanel.js.map +1 -1
  78. package/composer/SessionComposer.d.ts +1 -1
  79. package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
  80. package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
  81. package/cursor-accounts/CursorAccountEditor.js +51 -0
  82. package/cursor-accounts/CursorAccountEditor.js.map +1 -0
  83. package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
  84. package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
  85. package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
  86. package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
  87. package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
  88. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
  89. package/cursor-accounts/CursorAccountsConsole.js +275 -0
  90. package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
  91. package/cursor-accounts/cursor-account-format.d.ts +10 -0
  92. package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
  93. package/cursor-accounts/cursor-account-format.js +26 -0
  94. package/cursor-accounts/cursor-account-format.js.map +1 -0
  95. package/cursor-accounts/index.d.ts +18 -0
  96. package/cursor-accounts/index.d.ts.map +1 -0
  97. package/cursor-accounts/index.js +13 -0
  98. package/cursor-accounts/index.js.map +1 -0
  99. package/cursor-accounts/useCursorAccountView.d.ts +30 -0
  100. package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
  101. package/cursor-accounts/useCursorAccountView.js +25 -0
  102. package/cursor-accounts/useCursorAccountView.js.map +1 -0
  103. package/cursor-accounts/useCursorAccounts.d.ts +33 -0
  104. package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
  105. package/cursor-accounts/useCursorAccounts.js +25 -0
  106. package/cursor-accounts/useCursorAccounts.js.map +1 -0
  107. package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
  108. package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
  109. package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
  110. package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
  111. package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
  112. package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
  113. package/cursor-accounts/useDeleteCursorAccount.js +32 -0
  114. package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
  115. package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
  116. package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
  117. package/cursor-accounts/useSyncCursorAccount.js +31 -0
  118. package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
  119. package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
  120. package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
  121. package/cursor-accounts/useUpsertCursorAccount.js +34 -0
  122. package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
  123. package/datastore/CollectionRecordsBrowser.d.ts +34 -0
  124. package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
  125. package/datastore/CollectionRecordsBrowser.js +209 -0
  126. package/datastore/CollectionRecordsBrowser.js.map +1 -0
  127. package/datastore/CollectionSchemaView.d.ts +29 -0
  128. package/datastore/CollectionSchemaView.d.ts.map +1 -0
  129. package/datastore/CollectionSchemaView.js +93 -0
  130. package/datastore/CollectionSchemaView.js.map +1 -0
  131. package/datastore/DatastoreDetailView.d.ts +44 -0
  132. package/datastore/DatastoreDetailView.d.ts.map +1 -0
  133. package/datastore/DatastoreDetailView.js +76 -0
  134. package/datastore/DatastoreDetailView.js.map +1 -0
  135. package/datastore/DatastoreSyncReport.d.ts +19 -0
  136. package/datastore/DatastoreSyncReport.d.ts.map +1 -0
  137. package/datastore/DatastoreSyncReport.js +45 -0
  138. package/datastore/DatastoreSyncReport.js.map +1 -0
  139. package/datastore/DeleteDatastoreDialog.d.ts +35 -0
  140. package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
  141. package/datastore/DeleteDatastoreDialog.js +90 -0
  142. package/datastore/DeleteDatastoreDialog.js.map +1 -0
  143. package/datastore/FieldValueControl.d.ts +55 -0
  144. package/datastore/FieldValueControl.d.ts.map +1 -0
  145. package/datastore/FieldValueControl.js +138 -0
  146. package/datastore/FieldValueControl.js.map +1 -0
  147. package/datastore/RecordFilterBuilder.d.ts +30 -0
  148. package/datastore/RecordFilterBuilder.d.ts.map +1 -0
  149. package/datastore/RecordFilterBuilder.js +122 -0
  150. package/datastore/RecordFilterBuilder.js.map +1 -0
  151. package/datastore/RecordFormPanel.d.ts +45 -0
  152. package/datastore/RecordFormPanel.d.ts.map +1 -0
  153. package/datastore/RecordFormPanel.js +215 -0
  154. package/datastore/RecordFormPanel.js.map +1 -0
  155. package/datastore/index.d.ts +43 -0
  156. package/datastore/index.d.ts.map +1 -0
  157. package/datastore/index.js +22 -0
  158. package/datastore/index.js.map +1 -0
  159. package/datastore/recordFilter.d.ts +54 -0
  160. package/datastore/recordFilter.d.ts.map +1 -0
  161. package/datastore/recordFilter.js +93 -0
  162. package/datastore/recordFilter.js.map +1 -0
  163. package/datastore/recordValues.d.ts +85 -0
  164. package/datastore/recordValues.d.ts.map +1 -0
  165. package/datastore/recordValues.js +282 -0
  166. package/datastore/recordValues.js.map +1 -0
  167. package/datastore/useDatastore.d.ts +39 -0
  168. package/datastore/useDatastore.d.ts.map +1 -0
  169. package/datastore/useDatastore.js +44 -0
  170. package/datastore/useDatastore.js.map +1 -0
  171. package/datastore/useDatastoreCount.d.ts +48 -0
  172. package/datastore/useDatastoreCount.d.ts.map +1 -0
  173. package/datastore/useDatastoreCount.js +27 -0
  174. package/datastore/useDatastoreCount.js.map +1 -0
  175. package/datastore/useDatastoreDescription.d.ts +54 -0
  176. package/datastore/useDatastoreDescription.d.ts.map +1 -0
  177. package/datastore/useDatastoreDescription.js +50 -0
  178. package/datastore/useDatastoreDescription.js.map +1 -0
  179. package/datastore/useDatastoreList.d.ts +57 -0
  180. package/datastore/useDatastoreList.d.ts.map +1 -0
  181. package/datastore/useDatastoreList.js +29 -0
  182. package/datastore/useDatastoreList.js.map +1 -0
  183. package/datastore/useDatastoreSearch.d.ts +19 -0
  184. package/datastore/useDatastoreSearch.d.ts.map +1 -0
  185. package/datastore/useDatastoreSearch.js +22 -0
  186. package/datastore/useDatastoreSearch.js.map +1 -0
  187. package/datastore/useDeleteDatastore.d.ts +53 -0
  188. package/datastore/useDeleteDatastore.d.ts.map +1 -0
  189. package/datastore/useDeleteDatastore.js +40 -0
  190. package/datastore/useDeleteDatastore.js.map +1 -0
  191. package/datastore/useDeleteRecord.d.ts +34 -0
  192. package/datastore/useDeleteRecord.d.ts.map +1 -0
  193. package/datastore/useDeleteRecord.js +43 -0
  194. package/datastore/useDeleteRecord.js.map +1 -0
  195. package/datastore/useInsertRecord.d.ts +50 -0
  196. package/datastore/useInsertRecord.d.ts.map +1 -0
  197. package/datastore/useInsertRecord.js +55 -0
  198. package/datastore/useInsertRecord.js.map +1 -0
  199. package/datastore/useRecordCollection.d.ts +104 -0
  200. package/datastore/useRecordCollection.d.ts.map +1 -0
  201. package/datastore/useRecordCollection.js +136 -0
  202. package/datastore/useRecordCollection.js.map +1 -0
  203. package/datastore/useRecordList.d.ts +66 -0
  204. package/datastore/useRecordList.d.ts.map +1 -0
  205. package/datastore/useRecordList.js +58 -0
  206. package/datastore/useRecordList.js.map +1 -0
  207. package/datastore/useUpdateRecord.d.ts +52 -0
  208. package/datastore/useUpdateRecord.d.ts.map +1 -0
  209. package/datastore/useUpdateRecord.js +55 -0
  210. package/datastore/useUpdateRecord.js.map +1 -0
  211. package/environment/EnvironmentListPanel.d.ts.map +1 -1
  212. package/environment/EnvironmentListPanel.js +12 -7
  213. package/environment/EnvironmentListPanel.js.map +1 -1
  214. package/execution/index.d.ts +1 -2
  215. package/execution/index.d.ts.map +1 -1
  216. package/execution/index.js +0 -1
  217. package/execution/index.js.map +1 -1
  218. package/execution/useLiveAgentExecution.d.ts +17 -1
  219. package/execution/useLiveAgentExecution.d.ts.map +1 -1
  220. package/execution/useLiveAgentExecution.js +19 -4
  221. package/execution/useLiveAgentExecution.js.map +1 -1
  222. package/iam-policy/index.d.ts +1 -1
  223. package/iam-policy/index.d.ts.map +1 -1
  224. package/iam-policy/index.js.map +1 -1
  225. package/iam-policy/useCheckPermission.d.ts +32 -11
  226. package/iam-policy/useCheckPermission.d.ts.map +1 -1
  227. package/iam-policy/useCheckPermission.js +24 -19
  228. package/iam-policy/useCheckPermission.js.map +1 -1
  229. package/index.d.ts +16 -10
  230. package/index.d.ts.map +1 -1
  231. package/index.js +16 -5
  232. package/index.js.map +1 -1
  233. package/internal/useInViewport.d.ts +24 -0
  234. package/internal/useInViewport.d.ts.map +1 -0
  235. package/internal/useInViewport.js +49 -0
  236. package/internal/useInViewport.js.map +1 -0
  237. package/library/VisibilitySelector.d.ts +22 -6
  238. package/library/VisibilitySelector.d.ts.map +1 -1
  239. package/library/VisibilitySelector.js +12 -4
  240. package/library/VisibilitySelector.js.map +1 -1
  241. package/library/index.d.ts +1 -8
  242. package/library/index.d.ts.map +1 -1
  243. package/library/index.js +0 -4
  244. package/library/index.js.map +1 -1
  245. package/library/useApplyResource.d.ts +12 -12
  246. package/library/useApplyResource.d.ts.map +1 -1
  247. package/library/useApplyResource.js +16 -25
  248. package/library/useApplyResource.js.map +1 -1
  249. package/library/useExportResource.d.ts +13 -9
  250. package/library/useExportResource.d.ts.map +1 -1
  251. package/library/useExportResource.js +18 -36
  252. package/library/useExportResource.js.map +1 -1
  253. package/manifest/ApplyManifestDialog.d.ts +48 -0
  254. package/manifest/ApplyManifestDialog.d.ts.map +1 -0
  255. package/manifest/ApplyManifestDialog.js +135 -0
  256. package/manifest/ApplyManifestDialog.js.map +1 -0
  257. package/manifest/EditResourceYamlDialog.d.ts +51 -0
  258. package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
  259. package/manifest/EditResourceYamlDialog.js +104 -0
  260. package/manifest/EditResourceYamlDialog.js.map +1 -0
  261. package/manifest/RedactedSecretsNotice.d.ts +14 -0
  262. package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
  263. package/manifest/RedactedSecretsNotice.js +14 -0
  264. package/manifest/RedactedSecretsNotice.js.map +1 -0
  265. package/manifest/YamlEditor.d.ts +44 -0
  266. package/manifest/YamlEditor.d.ts.map +1 -0
  267. package/manifest/YamlEditor.js +216 -0
  268. package/manifest/YamlEditor.js.map +1 -0
  269. package/manifest/index.d.ts +13 -0
  270. package/manifest/index.d.ts.map +1 -0
  271. package/manifest/index.js +13 -0
  272. package/manifest/index.js.map +1 -0
  273. package/manifest/useApplyManifest.d.ts +82 -0
  274. package/manifest/useApplyManifest.d.ts.map +1 -0
  275. package/manifest/useApplyManifest.js +180 -0
  276. package/manifest/useApplyManifest.js.map +1 -0
  277. package/manifest/useEditResourceYaml.d.ts +106 -0
  278. package/manifest/useEditResourceYaml.d.ts.map +1 -0
  279. package/manifest/useEditResourceYaml.js +168 -0
  280. package/manifest/useEditResourceYaml.js.map +1 -0
  281. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  282. package/mcp-server/McpServerDetailView.js +4 -3
  283. package/mcp-server/McpServerDetailView.js.map +1 -1
  284. package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
  285. package/mcp-server/steps/ReviewStep.js +2 -3
  286. package/mcp-server/steps/ReviewStep.js.map +1 -1
  287. package/package.json +4 -4
  288. package/resource-creation/templates/workflow-templates.js +4 -4
  289. package/session/SessionViewer.js +8 -1
  290. package/session/SessionViewer.js.map +1 -1
  291. package/session/audience.d.ts +6 -1
  292. package/session/audience.d.ts.map +1 -1
  293. package/session/useEditSessionPrep.js +3 -3
  294. package/session/useEditSessionPrep.js.map +1 -1
  295. package/settings/index.d.ts +2 -1
  296. package/settings/index.d.ts.map +1 -1
  297. package/settings/index.js +2 -1
  298. package/settings/index.js.map +1 -1
  299. package/settings/settings-nav.d.ts +22 -0
  300. package/settings/settings-nav.d.ts.map +1 -1
  301. package/settings/settings-nav.js +32 -1
  302. package/settings/settings-nav.js.map +1 -1
  303. package/settings/useSettingsNavGroups.d.ts +29 -0
  304. package/settings/useSettingsNavGroups.d.ts.map +1 -0
  305. package/settings/useSettingsNavGroups.js +61 -0
  306. package/settings/useSettingsNavGroups.js.map +1 -0
  307. package/skill/SkillDetailView.d.ts.map +1 -1
  308. package/skill/SkillDetailView.js +4 -3
  309. package/skill/SkillDetailView.js.map +1 -1
  310. package/src/access/__tests__/useManageAccess.test.tsx +104 -0
  311. package/src/agent/AgentDetailView.tsx +9 -3
  312. package/src/agent/steps/ReviewStep.tsx +2 -3
  313. package/src/billing/BaselineEditor.tsx +619 -0
  314. package/src/billing/ModelCatalogPanel.tsx +283 -0
  315. package/src/billing/ModelGovernanceDetail.tsx +289 -0
  316. package/src/billing/OperatorAccessNotice.tsx +32 -0
  317. package/src/billing/PricingGovernanceConsole.tsx +465 -0
  318. package/src/billing/PricingGovernancePanel.tsx +166 -0
  319. package/src/billing/RetireConfirm.tsx +82 -0
  320. package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
  321. package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
  322. package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
  323. package/src/billing/form-primitives.tsx +68 -0
  324. package/src/billing/governance-primitives.tsx +133 -0
  325. package/src/billing/index.ts +37 -0
  326. package/src/billing/pricing-format.ts +53 -0
  327. package/src/billing/useDecidePricingOverride.ts +78 -0
  328. package/src/billing/useModelGovernanceView.ts +290 -0
  329. package/src/billing/useModelPricingBaselines.ts +69 -0
  330. package/src/billing/usePricingGovernance.ts +57 -0
  331. package/src/billing/useRetireModelPricingBaseline.ts +65 -0
  332. package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
  333. package/src/channel/AgentChannelsPanel.tsx +27 -1
  334. package/src/composer/SessionComposer.tsx +1 -1
  335. package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
  336. package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
  337. package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
  338. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
  339. package/src/cursor-accounts/cursor-account-format.ts +29 -0
  340. package/src/cursor-accounts/index.ts +29 -0
  341. package/src/cursor-accounts/useCursorAccountView.ts +49 -0
  342. package/src/cursor-accounts/useCursorAccounts.ts +49 -0
  343. package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
  344. package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
  345. package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
  346. package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
  347. package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
  348. package/src/datastore/CollectionSchemaView.tsx +247 -0
  349. package/src/datastore/DatastoreDetailView.tsx +201 -0
  350. package/src/datastore/DatastoreSyncReport.tsx +105 -0
  351. package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
  352. package/src/datastore/FieldValueControl.tsx +289 -0
  353. package/src/datastore/RecordFilterBuilder.tsx +411 -0
  354. package/src/datastore/RecordFormPanel.tsx +432 -0
  355. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
  356. package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
  357. package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
  358. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
  359. package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
  360. package/src/datastore/__tests__/recordFilter.test.ts +156 -0
  361. package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
  362. package/src/datastore/__tests__/recordValues.test.ts +359 -0
  363. package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
  364. package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
  365. package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
  366. package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
  367. package/src/datastore/index.ts +111 -0
  368. package/src/datastore/recordFilter.ts +140 -0
  369. package/src/datastore/recordValues.ts +327 -0
  370. package/src/datastore/useDatastore.ts +67 -0
  371. package/src/datastore/useDatastoreCount.ts +67 -0
  372. package/src/datastore/useDatastoreDescription.ts +90 -0
  373. package/src/datastore/useDatastoreList.ts +79 -0
  374. package/src/datastore/useDatastoreSearch.ts +39 -0
  375. package/src/datastore/useDeleteDatastore.ts +87 -0
  376. package/src/datastore/useDeleteRecord.ts +77 -0
  377. package/src/datastore/useInsertRecord.ts +92 -0
  378. package/src/datastore/useRecordCollection.ts +256 -0
  379. package/src/datastore/useRecordList.ts +131 -0
  380. package/src/datastore/useUpdateRecord.ts +95 -0
  381. package/src/environment/EnvironmentListPanel.tsx +24 -0
  382. package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
  383. package/src/execution/__tests__/useLiveAgentExecution.test.tsx +125 -0
  384. package/src/execution/index.ts +4 -7
  385. package/src/execution/useLiveAgentExecution.ts +41 -3
  386. package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
  387. package/src/iam-policy/index.ts +1 -0
  388. package/src/iam-policy/useCheckPermission.ts +45 -19
  389. package/src/index.ts +167 -18
  390. package/src/internal/__tests__/useInViewport.test.tsx +115 -0
  391. package/src/internal/useInViewport.ts +63 -0
  392. package/src/library/VisibilitySelector.tsx +50 -9
  393. package/src/library/__tests__/VisibilitySelector.test.tsx +38 -0
  394. package/src/library/index.ts +4 -21
  395. package/src/library/useApplyResource.ts +27 -34
  396. package/src/library/useExportResource.ts +21 -40
  397. package/src/manifest/ApplyManifestDialog.tsx +315 -0
  398. package/src/manifest/EditResourceYamlDialog.tsx +265 -0
  399. package/src/manifest/RedactedSecretsNotice.tsx +30 -0
  400. package/src/manifest/YamlEditor.tsx +272 -0
  401. package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
  402. package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
  403. package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
  404. package/src/manifest/index.ts +33 -0
  405. package/src/manifest/useApplyManifest.ts +270 -0
  406. package/src/manifest/useEditResourceYaml.ts +273 -0
  407. package/src/mcp-server/McpServerDetailView.tsx +7 -3
  408. package/src/mcp-server/steps/ReviewStep.tsx +2 -3
  409. package/src/resource-creation/templates/workflow-templates.ts +4 -4
  410. package/src/session/SessionViewer.tsx +7 -1
  411. package/src/session/__tests__/audienceWiring.test.tsx +31 -1
  412. package/src/session/audience.ts +6 -1
  413. package/src/session/useEditSessionPrep.ts +3 -3
  414. package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
  415. package/src/settings/index.ts +5 -1
  416. package/src/settings/settings-nav.ts +43 -0
  417. package/src/settings/useSettingsNavGroups.ts +81 -0
  418. package/src/skill/SkillDetailView.tsx +7 -3
  419. package/src/workflow/WorkflowAgentCallTranscript.tsx +279 -0
  420. package/src/workflow/WorkflowDetailView.tsx +7 -3
  421. package/src/workflow/WorkflowExecutionViewer.tsx +20 -77
  422. package/src/workflow/WorkflowTaskApprovalSummary.tsx +45 -8
  423. package/src/workflow/WorkflowYamlEditor.tsx +6 -270
  424. package/src/workflow/__tests__/WorkflowAgentCallTranscript.liveregion.test.tsx +124 -0
  425. package/src/workflow/__tests__/{WorkflowAgentExecutionDocument.test.tsx → WorkflowAgentCallTranscript.test.tsx} +146 -121
  426. package/src/workflow/__tests__/WorkflowExecutionViewer.approvals.test.tsx +81 -220
  427. package/src/workflow/__tests__/WorkflowExecutionViewer.reconciliation.test.tsx +17 -16
  428. package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +52 -2
  429. package/src/workflow/__tests__/WorkflowTaskThread.test.tsx +168 -185
  430. package/src/workflow/__tests__/agent-call-live-experience.test.ts +4 -4
  431. package/src/workflow/__tests__/task-approval.test.ts +119 -0
  432. package/src/workflow/__tests__/task-presentation.test.ts +35 -1
  433. package/src/workflow/__tests__/useWorkflowExecutionPanel.test.ts +0 -57
  434. package/src/workflow/index.ts +6 -3
  435. package/src/workflow/task-detail/index.ts +3 -0
  436. package/src/workflow/task-detail/task-approval.ts +95 -1
  437. package/src/workflow/thread/WorkflowTaskThread.tsx +96 -252
  438. package/src/workflow/thread/task-presentation.ts +8 -2
  439. package/src/workflow/useWorkflowExecutionPanel.ts +0 -47
  440. package/styles.css +1 -1
  441. package/workflow/CanvasTransitionEdge.d.ts +1 -1
  442. package/workflow/WorkflowAgentCallTranscript.d.ts +87 -0
  443. package/workflow/WorkflowAgentCallTranscript.d.ts.map +1 -0
  444. package/workflow/WorkflowAgentCallTranscript.js +98 -0
  445. package/workflow/WorkflowAgentCallTranscript.js.map +1 -0
  446. package/workflow/WorkflowDetailView.d.ts.map +1 -1
  447. package/workflow/WorkflowDetailView.js +4 -3
  448. package/workflow/WorkflowDetailView.js.map +1 -1
  449. package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
  450. package/workflow/WorkflowExecutionViewer.js +23 -52
  451. package/workflow/WorkflowExecutionViewer.js.map +1 -1
  452. package/workflow/WorkflowTaskApprovalSummary.d.ts +1 -1
  453. package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
  454. package/workflow/WorkflowTaskApprovalSummary.js +18 -1
  455. package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
  456. package/workflow/WorkflowYamlEditor.d.ts +2 -42
  457. package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
  458. package/workflow/WorkflowYamlEditor.js +5 -214
  459. package/workflow/WorkflowYamlEditor.js.map +1 -1
  460. package/workflow/index.d.ts +2 -2
  461. package/workflow/index.d.ts.map +1 -1
  462. package/workflow/index.js +2 -2
  463. package/workflow/index.js.map +1 -1
  464. package/workflow/task-detail/index.d.ts +1 -1
  465. package/workflow/task-detail/index.d.ts.map +1 -1
  466. package/workflow/task-detail/index.js +1 -1
  467. package/workflow/task-detail/index.js.map +1 -1
  468. package/workflow/task-detail/task-approval.d.ts +44 -1
  469. package/workflow/task-detail/task-approval.d.ts.map +1 -1
  470. package/workflow/task-detail/task-approval.js +47 -0
  471. package/workflow/task-detail/task-approval.js.map +1 -1
  472. package/workflow/thread/WorkflowTaskThread.d.ts +17 -25
  473. package/workflow/thread/WorkflowTaskThread.d.ts.map +1 -1
  474. package/workflow/thread/WorkflowTaskThread.js +60 -105
  475. package/workflow/thread/WorkflowTaskThread.js.map +1 -1
  476. package/workflow/thread/task-presentation.d.ts.map +1 -1
  477. package/workflow/thread/task-presentation.js +7 -2
  478. package/workflow/thread/task-presentation.js.map +1 -1
  479. package/workflow/useWorkflowExecutionPanel.d.ts +0 -12
  480. package/workflow/useWorkflowExecutionPanel.d.ts.map +1 -1
  481. package/workflow/useWorkflowExecutionPanel.js +0 -12
  482. package/workflow/useWorkflowExecutionPanel.js.map +1 -1
  483. package/execution/agent-execution-document.d.ts +0 -31
  484. package/execution/agent-execution-document.d.ts.map +0 -1
  485. package/execution/agent-execution-document.js +0 -48
  486. package/execution/agent-execution-document.js.map +0 -1
  487. package/library/ImportResourceDialog.d.ts +0 -43
  488. package/library/ImportResourceDialog.d.ts.map +0 -1
  489. package/library/ImportResourceDialog.js +0 -90
  490. package/library/ImportResourceDialog.js.map +0 -1
  491. package/library/parse-resource-yaml.d.ts +0 -63
  492. package/library/parse-resource-yaml.d.ts.map +0 -1
  493. package/library/parse-resource-yaml.js +0 -407
  494. package/library/parse-resource-yaml.js.map +0 -1
  495. package/library/serialize-resource-yaml.d.ts +0 -103
  496. package/library/serialize-resource-yaml.d.ts.map +0 -1
  497. package/library/serialize-resource-yaml.js +0 -565
  498. package/library/serialize-resource-yaml.js.map +0 -1
  499. package/library/useImportResource.d.ts +0 -84
  500. package/library/useImportResource.d.ts.map +0 -1
  501. package/library/useImportResource.js +0 -188
  502. package/library/useImportResource.js.map +0 -1
  503. package/src/execution/__tests__/agent-execution-document.test.ts +0 -45
  504. package/src/execution/agent-execution-document.ts +0 -54
  505. package/src/library/ImportResourceDialog.tsx +0 -227
  506. package/src/library/parse-resource-yaml.ts +0 -630
  507. package/src/library/serialize-resource-yaml.ts +0 -756
  508. package/src/library/useImportResource.ts +0 -253
  509. package/src/workflow/WorkflowAgentExecutionDocument.tsx +0 -283
  510. package/workflow/WorkflowAgentExecutionDocument.d.ts +0 -79
  511. package/workflow/WorkflowAgentExecutionDocument.d.ts.map +0 -1
  512. package/workflow/WorkflowAgentExecutionDocument.js +0 -87
  513. package/workflow/WorkflowAgentExecutionDocument.js.map +0 -1
@@ -1,565 +0,0 @@
1
- import { stringify as stringifyYaml } from "yaml";
2
- /**
3
- * Serializes a proto `Agent` into the canonical Stigmer YAML format.
4
- *
5
- * This is the inverse of {@link parseResourceYaml} — the serialized YAML
6
- * is round-trip compatible and can be fed back through `parseResourceYaml`
7
- * to produce a valid `AgentInput`.
8
- *
9
- * Only emits `apiVersion`, `kind`, `metadata`, and `spec`. The `status`
10
- * field is system-managed and never included in the YAML output.
11
- *
12
- * Uses snake_case field names in the YAML to match the proto canonical form,
13
- * which is the format expected by both the backend and `parseResourceYaml`.
14
- *
15
- * @param agent - The proto `Agent` resource to serialize.
16
- * @returns A YAML string suitable for editing and re-applying.
17
- *
18
- * @example
19
- * ```ts
20
- * import { serializeAgentYaml } from "@stigmer/react";
21
- *
22
- * const yaml = serializeAgentYaml(agent);
23
- * const file = new File([yaml], "my-agent.yaml", { type: "text/yaml" });
24
- * ```
25
- *
26
- * @see {@link parseResourceYaml} for the inverse operation
27
- */
28
- export function serializeAgentYaml(agent) {
29
- const doc = {
30
- apiVersion: agent.apiVersion || "agentic.stigmer.ai/v1",
31
- kind: agent.kind || "Agent",
32
- metadata: buildMetadata(agent.metadata),
33
- spec: buildAgentSpec(agent.spec),
34
- };
35
- return stringifyYaml(doc, { lineWidth: 0, blockQuote: "literal" });
36
- }
37
- /**
38
- * Serializes a proto `McpServer` into the canonical Stigmer YAML format.
39
- *
40
- * This is the inverse of {@link parseResourceYaml} for McpServer resources.
41
- * Same round-trip guarantee and snake_case convention as {@link serializeAgentYaml}.
42
- *
43
- * @param mcpServer - The proto `McpServer` resource to serialize.
44
- * @returns A YAML string suitable for editing and re-applying.
45
- *
46
- * @example
47
- * ```ts
48
- * import { serializeMcpServerYaml } from "@stigmer/react";
49
- *
50
- * const yaml = serializeMcpServerYaml(mcpServer);
51
- * const file = new File([yaml], "my-server.yaml", { type: "text/yaml" });
52
- * ```
53
- *
54
- * @see {@link parseResourceYaml} for the inverse operation
55
- */
56
- export function serializeMcpServerYaml(mcpServer) {
57
- const doc = {
58
- apiVersion: mcpServer.apiVersion || "agentic.stigmer.ai/v1",
59
- kind: mcpServer.kind || "McpServer",
60
- metadata: buildMetadata(mcpServer.metadata),
61
- spec: buildMcpServerSpec(mcpServer.spec),
62
- };
63
- return stringifyYaml(doc, { lineWidth: 0, blockQuote: "literal" });
64
- }
65
- // ---------------------------------------------------------------------------
66
- // Metadata
67
- // ---------------------------------------------------------------------------
68
- function buildMetadata(metadata) {
69
- if (!metadata)
70
- return {};
71
- const result = {
72
- name: metadata.name,
73
- };
74
- if (metadata.org) {
75
- result.org = metadata.org;
76
- }
77
- if (metadata.slug && metadata.slug !== metadata.name) {
78
- result.slug = metadata.slug;
79
- }
80
- if (hasEntries(metadata.labels)) {
81
- result.labels = { ...metadata.labels };
82
- }
83
- return result;
84
- }
85
- // ---------------------------------------------------------------------------
86
- // Agent spec
87
- // ---------------------------------------------------------------------------
88
- function buildAgentSpec(spec) {
89
- if (!spec)
90
- return {};
91
- const result = {};
92
- if (spec.description) {
93
- result.description = spec.description;
94
- }
95
- if (spec.iconUrl) {
96
- result.icon_url = spec.iconUrl;
97
- }
98
- if (spec.instructions) {
99
- result.instructions = spec.instructions;
100
- }
101
- if (spec.mcpServerUsages.length > 0) {
102
- result.mcp_server_usages = spec.mcpServerUsages.map(serializeMcpServerUsage);
103
- }
104
- if (spec.skillRefs.length > 0) {
105
- result.skill_refs = spec.skillRefs.map(serializeResourceRef);
106
- }
107
- if (spec.subAgents.length > 0) {
108
- result.sub_agents = spec.subAgents.map(serializeSubAgent);
109
- }
110
- if (hasEntries(spec.env)) {
111
- const env = serializeEnv(spec.env);
112
- if (env) {
113
- result.env = env;
114
- }
115
- }
116
- return result;
117
- }
118
- function serializeMcpServerUsage(usage) {
119
- const result = {};
120
- if (usage.mcpServerRef) {
121
- result.mcp_server_ref = serializeResourceRef(usage.mcpServerRef);
122
- }
123
- if (usage.enabledTools.length > 0) {
124
- result.enabled_tools = [...usage.enabledTools];
125
- }
126
- if (usage.toolApprovalOverrides.length > 0) {
127
- result.tool_approval_overrides =
128
- usage.toolApprovalOverrides.map(serializeToolApprovalOverride);
129
- }
130
- return result;
131
- }
132
- function serializeToolApprovalOverride(override) {
133
- const result = {
134
- tool_name: override.toolName,
135
- requires_approval: override.requiresApproval,
136
- };
137
- if (override.message) {
138
- result.message = override.message;
139
- }
140
- return result;
141
- }
142
- function serializeSubAgent(sub) {
143
- const result = {
144
- name: sub.name,
145
- };
146
- if (sub.description) {
147
- result.description = sub.description;
148
- }
149
- if (sub.instructions) {
150
- result.instructions = sub.instructions;
151
- }
152
- if (sub.modelOverride) {
153
- result.model_override = sub.modelOverride;
154
- }
155
- if (sub.mcpAccess.length > 0) {
156
- result.mcp_access = sub.mcpAccess.map(serializeMcpAccess);
157
- }
158
- if (sub.skillRefs.length > 0) {
159
- result.skill_refs = sub.skillRefs.map(serializeResourceRef);
160
- }
161
- return result;
162
- }
163
- function serializeMcpAccess(access) {
164
- const result = {
165
- mcp_server: access.mcpServer,
166
- };
167
- if (access.enabledTools.length > 0) {
168
- result.enabled_tools = [...access.enabledTools];
169
- }
170
- return result;
171
- }
172
- // ---------------------------------------------------------------------------
173
- // McpServer spec
174
- // ---------------------------------------------------------------------------
175
- function buildMcpServerSpec(spec) {
176
- if (!spec)
177
- return {};
178
- const result = {};
179
- if (spec.description) {
180
- result.description = spec.description;
181
- }
182
- if (spec.iconUrl) {
183
- result.icon_url = spec.iconUrl;
184
- }
185
- if (spec.tags.length > 0) {
186
- result.tags = [...spec.tags];
187
- }
188
- if (spec.serverType.case === "stdio") {
189
- result.stdio = serializeStdioConfig(spec.serverType.value);
190
- }
191
- else if (spec.serverType.case === "http") {
192
- result.http = serializeHttpConfig(spec.serverType.value);
193
- }
194
- if (spec.defaultEnabledTools.length > 0) {
195
- result.default_enabled_tools = [...spec.defaultEnabledTools];
196
- }
197
- if (spec.pinnedToolApprovals.length > 0) {
198
- result.pinned_tool_approvals =
199
- spec.pinnedToolApprovals.map(serializeToolApprovalPolicy);
200
- }
201
- if (hasEntries(spec.env)) {
202
- const env = serializeEnv(spec.env);
203
- if (env) {
204
- result.env = env;
205
- }
206
- }
207
- return result;
208
- }
209
- function serializeStdioConfig(config) {
210
- const result = {
211
- command: config.command,
212
- };
213
- if (config.args.length > 0) {
214
- result.args = [...config.args];
215
- }
216
- if (config.workingDir) {
217
- result.working_dir = config.workingDir;
218
- }
219
- return result;
220
- }
221
- function serializeHttpConfig(config) {
222
- const result = {
223
- url: config.url,
224
- };
225
- if (hasEntries(config.headers)) {
226
- result.headers = { ...config.headers };
227
- }
228
- if (hasEntries(config.queryParams)) {
229
- result.query_params = { ...config.queryParams };
230
- }
231
- if (config.timeoutSeconds > 0) {
232
- result.timeout_seconds = config.timeoutSeconds;
233
- }
234
- return result;
235
- }
236
- function serializeToolApprovalPolicy(policy) {
237
- const result = {
238
- tool_name: policy.toolName,
239
- };
240
- if (policy.message) {
241
- result.message = policy.message;
242
- }
243
- return result;
244
- }
245
- // ---------------------------------------------------------------------------
246
- // Shared serializers
247
- // ---------------------------------------------------------------------------
248
- function serializeResourceRef(ref) {
249
- const result = {};
250
- if (ref.org) {
251
- result.org = ref.org;
252
- }
253
- if (ref.kind) {
254
- result.kind = ref.kind;
255
- }
256
- result.slug = ref.slug;
257
- if (ref.version) {
258
- result.version = ref.version;
259
- }
260
- return result;
261
- }
262
- function serializeEnv(env) {
263
- const keys = Object.keys(env);
264
- if (keys.length === 0)
265
- return undefined;
266
- const result = {};
267
- for (const [key, val] of Object.entries(env)) {
268
- const entry = {};
269
- if (val.isSecret) {
270
- entry.is_secret = val.isSecret;
271
- }
272
- if (val.description) {
273
- entry.description = val.description;
274
- }
275
- if (val.optional) {
276
- entry.optional = val.optional;
277
- }
278
- result[key] = entry;
279
- }
280
- return result;
281
- }
282
- // ---------------------------------------------------------------------------
283
- // Utilities
284
- // ---------------------------------------------------------------------------
285
- function hasEntries(obj) {
286
- if (!obj)
287
- return false;
288
- return Object.keys(obj).length > 0;
289
- }
290
- // ===========================================================================
291
- // AgentInput serialization (from SDK input type, not proto)
292
- // ===========================================================================
293
- /**
294
- * Serializes an {@link AgentInput} (SDK input type) into the canonical
295
- * Stigmer YAML format.
296
- *
297
- * Unlike {@link serializeAgentYaml} which takes a proto `Agent`, this
298
- * function works from the SDK input type — the same shape used by
299
- * `stigmer.agent.apply()`. This is used by the creation wizard to
300
- * preview the YAML before submission.
301
- *
302
- * The output is round-trip compatible with {@link parseResourceYaml}.
303
- *
304
- * @param input - The SDK `AgentInput` to serialize.
305
- * @returns A YAML string in the canonical Stigmer resource format.
306
- *
307
- * @example
308
- * ```ts
309
- * import { serializeAgentInputYaml } from "@stigmer/react";
310
- *
311
- * const yaml = serializeAgentInputYaml({
312
- * name: "my-agent",
313
- * org: "acme",
314
- * instructions: "You are a helpful assistant.",
315
- * });
316
- * ```
317
- */
318
- export function serializeAgentInputYaml(input) {
319
- const doc = {
320
- apiVersion: "agentic.stigmer.ai/v1",
321
- kind: "Agent",
322
- metadata: buildInputMetadata(input),
323
- spec: buildAgentInputSpec(input),
324
- };
325
- return stringifyYaml(doc, { lineWidth: 0, blockQuote: "literal" });
326
- }
327
- function buildInputMetadata(input) {
328
- const result = {
329
- name: input.name,
330
- };
331
- if (input.org) {
332
- result.org = input.org;
333
- }
334
- if (input.slug && input.slug !== input.name) {
335
- result.slug = input.slug;
336
- }
337
- if (input.labels && Object.keys(input.labels).length > 0) {
338
- result.labels = { ...input.labels };
339
- }
340
- return result;
341
- }
342
- function buildAgentInputSpec(input) {
343
- const result = {};
344
- if (input.description) {
345
- result.description = input.description;
346
- }
347
- if (input.iconUrl) {
348
- result.icon_url = input.iconUrl;
349
- }
350
- if (input.instructions) {
351
- result.instructions = input.instructions;
352
- }
353
- if (input.mcpServerUsages && input.mcpServerUsages.length > 0) {
354
- result.mcp_server_usages = input.mcpServerUsages.map(serializeInputMcpUsage);
355
- }
356
- if (input.skillRefs && input.skillRefs.length > 0) {
357
- result.skill_refs = input.skillRefs.map(serializeInputRef);
358
- }
359
- if (input.subAgents && input.subAgents.length > 0) {
360
- result.sub_agents = input.subAgents.map(serializeInputSubAgent);
361
- }
362
- if (input.env && Object.keys(input.env).length > 0) {
363
- result.env = serializeInputEnv(input.env);
364
- }
365
- return result;
366
- }
367
- function serializeInputMcpUsage(usage) {
368
- const result = {
369
- mcp_server_ref: serializeInputRef(usage.mcpServerRef),
370
- };
371
- if (usage.enabledTools && usage.enabledTools.length > 0) {
372
- result.enabled_tools = [...usage.enabledTools];
373
- }
374
- if (usage.toolApprovalOverrides && usage.toolApprovalOverrides.length > 0) {
375
- result.tool_approval_overrides =
376
- usage.toolApprovalOverrides.map(serializeInputApprovalOverride);
377
- }
378
- return result;
379
- }
380
- function serializeInputApprovalOverride(override) {
381
- const result = {};
382
- if (override.toolName) {
383
- result.tool_name = override.toolName;
384
- }
385
- if (override.requiresApproval != null) {
386
- result.requires_approval = override.requiresApproval;
387
- }
388
- if (override.message) {
389
- result.message = override.message;
390
- }
391
- return result;
392
- }
393
- function serializeInputSubAgent(sub) {
394
- const result = {
395
- name: sub.name,
396
- };
397
- if (sub.description) {
398
- result.description = sub.description;
399
- }
400
- if (sub.instructions) {
401
- result.instructions = sub.instructions;
402
- }
403
- if (sub.modelOverride) {
404
- result.model_override = sub.modelOverride;
405
- }
406
- if (sub.mcpAccess && sub.mcpAccess.length > 0) {
407
- result.mcp_access = sub.mcpAccess.map(serializeInputMcpAccess);
408
- }
409
- if (sub.skillRefs && sub.skillRefs.length > 0) {
410
- result.skill_refs = sub.skillRefs.map(serializeInputRef);
411
- }
412
- return result;
413
- }
414
- function serializeInputMcpAccess(access) {
415
- const result = {
416
- mcp_server: access.mcpServer,
417
- };
418
- if (access.enabledTools && access.enabledTools.length > 0) {
419
- result.enabled_tools = [...access.enabledTools];
420
- }
421
- return result;
422
- }
423
- function serializeInputRef(ref) {
424
- const result = {};
425
- if (ref.org) {
426
- result.org = ref.org;
427
- }
428
- result.slug = ref.slug;
429
- if (ref.version) {
430
- result.version = ref.version;
431
- }
432
- return result;
433
- }
434
- function serializeInputEnv(env) {
435
- const result = {};
436
- for (const [key, val] of Object.entries(env)) {
437
- const entry = {};
438
- if (val.isSecret) {
439
- entry.is_secret = val.isSecret;
440
- }
441
- if (val.description) {
442
- entry.description = val.description;
443
- }
444
- if (val.optional) {
445
- entry.optional = val.optional;
446
- }
447
- result[key] = entry;
448
- }
449
- return result;
450
- }
451
- // ===========================================================================
452
- // McpServerInput serialization (from SDK input type, not proto)
453
- // ===========================================================================
454
- /**
455
- * Serializes a {@link McpServerInput} (SDK input type) into the canonical
456
- * Stigmer YAML format.
457
- *
458
- * Unlike {@link serializeMcpServerYaml} which takes a proto `McpServer`,
459
- * this function works from the SDK input type — the same shape used by
460
- * `stigmer.mcpServer.apply()`. This is used by the creation wizard to
461
- * preview the YAML before submission.
462
- *
463
- * The output is round-trip compatible with {@link parseResourceYaml}.
464
- *
465
- * @param input - The SDK `McpServerInput` to serialize.
466
- * @returns A YAML string in the canonical Stigmer resource format.
467
- *
468
- * @example
469
- * ```ts
470
- * import { serializeMcpServerInputYaml } from "@stigmer/react";
471
- *
472
- * const yaml = serializeMcpServerInputYaml({
473
- * name: "github",
474
- * org: "acme",
475
- * http: { url: "https://mcp.github.com/sse" },
476
- * });
477
- * ```
478
- */
479
- export function serializeMcpServerInputYaml(input) {
480
- const doc = {
481
- apiVersion: "agentic.stigmer.ai/v1",
482
- kind: "McpServer",
483
- metadata: buildMcpServerInputMetadata(input),
484
- spec: buildMcpServerInputSpec(input),
485
- };
486
- return stringifyYaml(doc, { lineWidth: 0, blockQuote: "literal" });
487
- }
488
- function buildMcpServerInputMetadata(input) {
489
- const result = {
490
- name: input.name,
491
- };
492
- if (input.org) {
493
- result.org = input.org;
494
- }
495
- if (input.slug && input.slug !== input.name) {
496
- result.slug = input.slug;
497
- }
498
- if (input.labels && Object.keys(input.labels).length > 0) {
499
- result.labels = { ...input.labels };
500
- }
501
- return result;
502
- }
503
- function buildMcpServerInputSpec(input) {
504
- const result = {};
505
- if (input.description) {
506
- result.description = input.description;
507
- }
508
- if (input.iconUrl) {
509
- result.icon_url = input.iconUrl;
510
- }
511
- if (input.stdio) {
512
- const stdio = {
513
- command: input.stdio.command,
514
- };
515
- if (input.stdio.args && input.stdio.args.length > 0) {
516
- stdio.args = [...input.stdio.args];
517
- }
518
- if (input.stdio.workingDir) {
519
- stdio.working_dir = input.stdio.workingDir;
520
- }
521
- result.stdio = stdio;
522
- }
523
- if (input.http) {
524
- const http = {
525
- url: input.http.url,
526
- };
527
- if (input.http.headers && Object.keys(input.http.headers).length > 0) {
528
- http.headers = { ...input.http.headers };
529
- }
530
- if (input.http.queryParams && Object.keys(input.http.queryParams).length > 0) {
531
- http.query_params = { ...input.http.queryParams };
532
- }
533
- if (input.http.timeoutSeconds && input.http.timeoutSeconds > 0) {
534
- http.timeout_seconds = input.http.timeoutSeconds;
535
- }
536
- result.http = http;
537
- }
538
- if (input.env && Object.keys(input.env).length > 0) {
539
- result.env = serializeInputEnv(input.env);
540
- }
541
- if (input.auth) {
542
- result.auth = serializeInputMcpServerAuth(input.auth);
543
- }
544
- return result;
545
- }
546
- function serializeInputMcpServerAuth(auth) {
547
- const result = {};
548
- if (auth.oauthAppRef) {
549
- result.oauth_app_ref = serializeInputRef(auth.oauthAppRef);
550
- }
551
- if (auth.targetEnvVar) {
552
- result.target_env_var = auth.targetEnvVar;
553
- }
554
- if (auth.tokenLifetimeHint) {
555
- result.token_lifetime_hint = auth.tokenLifetimeHint;
556
- }
557
- if (auth.scopeHints && auth.scopeHints.length > 0) {
558
- result.scope_hints = [...auth.scopeHints];
559
- }
560
- if (auth.discoveryUrl) {
561
- result.discovery_url = auth.discoveryUrl;
562
- }
563
- return result;
564
- }
565
- //# sourceMappingURL=serialize-resource-yaml.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize-resource-yaml.js","sourceRoot":"","sources":["../../src/library/serialize-resource-yaml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AA4BlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAY;IAC7C,MAAM,GAAG,GAA4B;QACnC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,uBAAuB;QACvD,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,OAAO;QAC3B,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;QACvC,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC;KACjC,CAAC;IAEF,OAAO,aAAa,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAoB;IACzD,MAAM,GAAG,GAA4B;QACnC,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,uBAAuB;QAC3D,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,WAAW;QACnC,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC3C,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC;KACzC,CAAC;IAEF,OAAO,aAAa,CAAC,GAAG,EAAE,EAA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AO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,84 +0,0 @@
1
- import type { ApplyResourceResult } from "./useApplyResource.js";
2
- /** Detected format of the imported file content. */
3
- export type ImportFormat = "yaml" | "json";
4
- /**
5
- * Validated preview of an imported resource, shown to the user before
6
- * they confirm the apply operation.
7
- */
8
- export interface ImportPreview {
9
- /** The detected resource kind. */
10
- readonly kind: "Agent" | "McpServer";
11
- /** The resource name from `metadata.name`. */
12
- readonly name: string;
13
- /** The resource slug from `metadata.slug`, if present. */
14
- readonly slug?: string;
15
- /** The detected file format. */
16
- readonly format: ImportFormat;
17
- /** The raw file content (for potential display or debugging). */
18
- readonly rawContent: string;
19
- }
20
- /** Return value of {@link useImportResource}. */
21
- export interface UseImportResourceReturn {
22
- /**
23
- * Read and validate a file selected by the user. On success, populates
24
- * `preview`. On failure, populates `error`. In both cases, clears the
25
- * previous state first.
26
- */
27
- readonly readFile: (file: File) => Promise<void>;
28
- /** The validation preview, or `null` when no file has been validated. */
29
- readonly preview: ImportPreview | null;
30
- /** Validation or apply error message, or `null` when healthy. */
31
- readonly error: string | null;
32
- /** Clear all state (preview, error, internal content). */
33
- readonly reset: () => void;
34
- /**
35
- * Apply the previewed resource to the given organization.
36
- * Only callable when `preview` is non-null.
37
- *
38
- * @throws Re-throws the original error after setting `error` state.
39
- */
40
- readonly apply: (org: string) => Promise<ApplyResourceResult>;
41
- /** `true` while the apply RPC is in-flight. */
42
- readonly isApplying: boolean;
43
- }
44
- /**
45
- * Headless import hook for Stigmer resources.
46
- *
47
- * Orchestrates the file import workflow:
48
- * 1. User selects a `.yaml`, `.yml`, or `.json` file
49
- * 2. `readFile` reads the content, detects the format, and validates
50
- * the structure via `parseResourceYaml`
51
- * 3. On success, `preview` is populated with kind, name, slug, format
52
- * 4. On validation error, `error` is populated with a user-facing message
53
- * 5. User confirms → `apply(org)` calls the appropriate SDK `apply()` method
54
- *
55
- * Follows the established mutation-hook pattern: `isApplying` + `error` +
56
- * `reset`. The `preview` state enables a confirmation step before committing
57
- * (Nielsen heuristic #3: user control, #5: error prevention).
58
- *
59
- * @example
60
- * ```tsx
61
- * const { readFile, preview, error, reset, apply, isApplying } = useImportResource();
62
- *
63
- * const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
64
- * const file = e.target.files?.[0];
65
- * if (file) readFile(file);
66
- * };
67
- *
68
- * if (preview) {
69
- * return (
70
- * <div>
71
- * <p>Import {preview.kind}: {preview.name}</p>
72
- * <button onClick={() => apply(org)} disabled={isApplying}>
73
- * Confirm
74
- * </button>
75
- * </div>
76
- * );
77
- * }
78
- * ```
79
- *
80
- * @see {@link parseResourceYaml} for the validation logic
81
- * @see {@link ImportResourceDialog} for the styled component that composes this hook
82
- */
83
- export declare function useImportResource(): UseImportResourceReturn;
84
- //# sourceMappingURL=useImportResource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useImportResource.d.ts","sourceRoot":"","sources":["../../src/library/useImportResource.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAMjE,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CAAC;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAA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