@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,407 +0,0 @@
1
- import { parse as parseYaml } from "yaml";
2
- /**
3
- * Parses a Stigmer resource YAML string into the corresponding SDK input
4
- * type for use with `stigmer.agent.apply()` or `stigmer.mcpServer.apply()`.
5
- *
6
- * Handles the conversion from proto-style snake_case YAML field names to
7
- * the camelCase TypeScript SDK input types, including nested structures
8
- * like `mcp_server_usages`, `sub_agents`, and `env`.
9
- *
10
- * The `org` parameter **always overrides** `metadata.org` in the YAML.
11
- * This matches the UX intent of "Apply to [my-org]" — the user explicitly
12
- * chooses the target organization.
13
- *
14
- * **Throws** with descriptive, user-facing error messages when the YAML
15
- * is malformed or missing required fields. These messages are designed
16
- * for display in error UI components.
17
- *
18
- * @param content - Raw YAML content string (typically from {@link useArtifactContent}).
19
- * @param org - Target organization slug. Overrides `metadata.org` in the YAML.
20
- * @returns A discriminated union with the parsed SDK input.
21
- * @throws {Error} When the content is not valid YAML, not a recognized
22
- * Stigmer resource, or is missing required fields.
23
- *
24
- * @example
25
- * ```ts
26
- * import { parseResourceYaml } from "@stigmer/react";
27
- *
28
- * const parsed = parseResourceYaml(yamlContent, "my-org");
29
- * if (parsed.kind === "Agent") {
30
- * await stigmer.agent.apply(parsed.input);
31
- * } else {
32
- * await stigmer.mcpServer.apply(parsed.input);
33
- * }
34
- * ```
35
- *
36
- * @see {@link useApplyResource} for the React hook that wraps this function
37
- * @see {@link detectStigmerResource} for lightweight detection without full parsing
38
- */
39
- export function parseResourceYaml(content, org) {
40
- const doc = parseYamlDocument(content);
41
- const { kind, metadata, spec } = validateResourceStructure(doc);
42
- const name = extractRequiredString(metadata, "name", "metadata.name");
43
- const slug = extractOptionalString(metadata, "slug");
44
- const labels = extractOptionalStringRecord(metadata, "labels");
45
- switch (kind) {
46
- case "Agent":
47
- return {
48
- kind: "Agent",
49
- input: buildAgentInput(name, slug, org, labels, spec),
50
- };
51
- case "McpServer":
52
- return {
53
- kind: "McpServer",
54
- input: buildMcpServerInput(name, slug, org, labels, spec),
55
- };
56
- default:
57
- throw new Error(`Unsupported resource kind: "${kind}". ` +
58
- "Only Agent and McpServer can be applied from artifacts.");
59
- }
60
- }
61
- // ---------------------------------------------------------------------------
62
- // YAML parsing
63
- // ---------------------------------------------------------------------------
64
- function parseYamlDocument(content) {
65
- let parsed;
66
- try {
67
- parsed = parseYaml(content);
68
- }
69
- catch {
70
- throw new Error("Failed to parse artifact content as YAML.");
71
- }
72
- if (!isPlainObject(parsed)) {
73
- throw new Error("Failed to parse artifact content as YAML: expected a mapping document.");
74
- }
75
- return parsed;
76
- }
77
- const STIGMER_API_VERSION_PATTERN = /^[a-z]+\.stigmer\.ai\/v\d+$/;
78
- const APPLICABLE_KINDS = new Set([
79
- "Agent",
80
- "McpServer",
81
- ]);
82
- function validateResourceStructure(doc) {
83
- const apiVersion = doc.apiVersion ?? doc.api_version;
84
- if (typeof apiVersion !== "string" ||
85
- !STIGMER_API_VERSION_PATTERN.test(apiVersion)) {
86
- throw new Error("Resource YAML is missing required field: apiVersion " +
87
- "(expected pattern: *.stigmer.ai/v*).");
88
- }
89
- const kind = doc.kind;
90
- if (typeof kind !== "string" || kind.length === 0) {
91
- throw new Error("Resource YAML is missing required field: kind.");
92
- }
93
- if (!APPLICABLE_KINDS.has(kind)) {
94
- throw new Error(`Unsupported resource kind: "${kind}". ` +
95
- "Only Agent and McpServer can be applied from artifacts.");
96
- }
97
- const metadata = doc.metadata;
98
- if (!isPlainObject(metadata)) {
99
- throw new Error("Resource YAML is missing required field: metadata.");
100
- }
101
- const spec = doc.spec;
102
- if (!isPlainObject(spec)) {
103
- throw new Error("Resource YAML is missing required field: spec.");
104
- }
105
- return { kind, metadata, spec };
106
- }
107
- // ---------------------------------------------------------------------------
108
- // Agent conversion
109
- // ---------------------------------------------------------------------------
110
- function buildAgentInput(name, slug, org, labels, spec) {
111
- return {
112
- name,
113
- org,
114
- ...(slug !== undefined && { slug }),
115
- ...(labels !== undefined && { labels }),
116
- ...optionalString(spec, "description", "description"),
117
- ...optionalSnakeToCamel(spec, "icon_url", "iconUrl"),
118
- ...optionalString(spec, "instructions", "instructions"),
119
- ...optionalField("mcpServerUsages", extractMcpServerUsages(spec)),
120
- ...optionalField("skillRefs", extractResourceRefs(spec, "skill_refs")),
121
- ...optionalField("subAgents", extractSubAgents(spec)),
122
- ...optionalField("env", extractEnv(spec)),
123
- };
124
- }
125
- function extractMcpServerUsages(spec) {
126
- const raw = spec.mcp_server_usages ?? spec.mcpServerUsages;
127
- if (!Array.isArray(raw) || raw.length === 0)
128
- return undefined;
129
- return raw.filter(isPlainObject).map((entry) => {
130
- const refObj = entry.mcp_server_ref ?? entry.mcpServerRef;
131
- if (!isPlainObject(refObj)) {
132
- throw new Error("Agent YAML: each mcp_server_usages entry must have a mcp_server_ref.");
133
- }
134
- return {
135
- mcpServerRef: extractResourceRef(refObj),
136
- ...optionalStringArray(entry, "enabled_tools", "enabledTools"),
137
- ...optionalMappedArray(entry, "tool_approval_overrides", "toolApprovalOverrides", extractToolApprovalOverride),
138
- };
139
- });
140
- }
141
- function extractToolApprovalOverride(raw) {
142
- return {
143
- ...optionalSnakeToCamel(raw, "tool_name", "toolName"),
144
- ...optionalSnakeToCamelBool(raw, "requires_approval", "requiresApproval"),
145
- ...optionalString(raw, "message", "message"),
146
- };
147
- }
148
- function extractSubAgents(spec) {
149
- const raw = spec.sub_agents ?? spec.subAgents;
150
- if (!Array.isArray(raw) || raw.length === 0)
151
- return undefined;
152
- return raw.filter(isPlainObject).map((entry) => {
153
- const entryName = entry.name;
154
- if (typeof entryName !== "string" || entryName.length === 0) {
155
- throw new Error("Agent YAML: each sub_agents entry must have a non-empty name.");
156
- }
157
- return {
158
- name: entryName,
159
- ...optionalString(entry, "description", "description"),
160
- ...optionalString(entry, "instructions", "instructions"),
161
- ...optionalSnakeToCamel(entry, "model_override", "modelOverride"),
162
- ...optionalMappedArray(entry, "mcp_access", "mcpAccess", extractMcpAccess),
163
- ...optionalField("skillRefs", extractResourceRefs(entry, "skill_refs")),
164
- };
165
- });
166
- }
167
- function extractMcpAccess(raw) {
168
- const mcpServer = raw.mcp_server ?? raw.mcpServer;
169
- if (typeof mcpServer !== "string" || mcpServer.length === 0) {
170
- throw new Error("Agent YAML: each mcp_access entry must have a non-empty mcp_server.");
171
- }
172
- return {
173
- mcpServer,
174
- ...optionalStringArray(raw, "enabled_tools", "enabledTools"),
175
- };
176
- }
177
- // ---------------------------------------------------------------------------
178
- // McpServer conversion
179
- // ---------------------------------------------------------------------------
180
- function buildMcpServerInput(name, slug, org, labels, spec) {
181
- const stdio = extractStdioConfig(spec);
182
- const http = extractHttpConfig(spec);
183
- if (!stdio && !http) {
184
- throw new Error("McpServer YAML must specify either spec.stdio or spec.http.");
185
- }
186
- return {
187
- name,
188
- org,
189
- ...(slug !== undefined && { slug }),
190
- ...(labels !== undefined && { labels }),
191
- ...optionalString(spec, "description", "description"),
192
- ...optionalSnakeToCamel(spec, "icon_url", "iconUrl"),
193
- ...optionalField("stdio", stdio),
194
- ...optionalField("http", http),
195
- ...optionalStringArrayFromSnake(spec, "default_enabled_tools", "defaultEnabledTools"),
196
- ...optionalMappedArray(spec, "pinned_tool_approvals", "pinnedToolApprovals", extractToolApprovalPolicy),
197
- ...optionalField("env", extractEnv(spec)),
198
- };
199
- }
200
- function extractStdioConfig(spec) {
201
- const raw = spec.stdio;
202
- if (!isPlainObject(raw))
203
- return undefined;
204
- const command = raw.command;
205
- if (typeof command !== "string" || command.length === 0) {
206
- throw new Error("McpServer YAML: spec.stdio must have a non-empty command.");
207
- }
208
- return {
209
- command,
210
- ...optionalStringArray(raw, "args", "args"),
211
- ...optionalSnakeToCamel(raw, "working_dir", "workingDir"),
212
- };
213
- }
214
- function extractHttpConfig(spec) {
215
- const raw = spec.http;
216
- if (!isPlainObject(raw))
217
- return undefined;
218
- const url = raw.url;
219
- if (typeof url !== "string" || url.length === 0) {
220
- throw new Error("McpServer YAML: spec.http must have a non-empty url.");
221
- }
222
- return {
223
- url,
224
- ...optionalStringRecord(raw, "headers", "headers"),
225
- ...optionalStringRecordSnake(raw, "query_params", "queryParams"),
226
- ...optionalSnakeToCamelNumber(raw, "timeout_seconds", "timeoutSeconds"),
227
- };
228
- }
229
- function extractToolApprovalPolicy(raw) {
230
- return {
231
- ...optionalSnakeToCamel(raw, "tool_name", "toolName"),
232
- ...optionalString(raw, "message", "message"),
233
- };
234
- }
235
- // ---------------------------------------------------------------------------
236
- // Shared extractors
237
- // ---------------------------------------------------------------------------
238
- function extractEnv(spec) {
239
- // Support both new flat `env` and legacy nested `env_spec.data` / `envSpec.data`.
240
- let envMap;
241
- const envRaw = spec.env;
242
- if (isPlainObject(envRaw)) {
243
- envMap = envRaw;
244
- }
245
- else {
246
- const envSpecRaw = spec.env_spec ?? spec.envSpec;
247
- if (isPlainObject(envSpecRaw)) {
248
- const data = envSpecRaw.data ?? envSpecRaw.variables;
249
- if (isPlainObject(data)) {
250
- envMap = data;
251
- }
252
- }
253
- }
254
- if (!envMap)
255
- return undefined;
256
- const result = {};
257
- let hasEntries = false;
258
- for (const [key, val] of Object.entries(envMap)) {
259
- if (!isPlainObject(val))
260
- continue;
261
- const isSecret = val.is_secret ?? val.isSecret;
262
- const description = val.description;
263
- const optional = val.optional;
264
- result[key] = {
265
- ...(typeof isSecret === "boolean" && { isSecret }),
266
- ...(typeof description === "string" && { description }),
267
- ...(typeof optional === "boolean" && { optional }),
268
- };
269
- hasEntries = true;
270
- }
271
- return hasEntries ? result : undefined;
272
- }
273
- function extractResourceRef(raw) {
274
- const org = raw.org;
275
- const slug = raw.slug;
276
- if (typeof org !== "string" || org.length === 0) {
277
- throw new Error("Resource reference must have a non-empty org.");
278
- }
279
- if (typeof slug !== "string" || slug.length === 0) {
280
- throw new Error("Resource reference must have a non-empty slug.");
281
- }
282
- return {
283
- org,
284
- slug,
285
- ...(typeof raw.version === "string" &&
286
- raw.version.length > 0 && { version: raw.version }),
287
- ...(typeof raw.kind === "number" && { kind: raw.kind }),
288
- };
289
- }
290
- function extractResourceRefs(container, snakeKey) {
291
- const camelKey = snakeToCamel(snakeKey);
292
- const raw = container[snakeKey] ?? container[camelKey];
293
- if (!Array.isArray(raw) || raw.length === 0)
294
- return undefined;
295
- return raw.filter(isPlainObject).map(extractResourceRef);
296
- }
297
- // ---------------------------------------------------------------------------
298
- // Field extraction helpers — return spreadable partials
299
- // ---------------------------------------------------------------------------
300
- function optionalField(key, value) {
301
- if (value === undefined)
302
- return undefined;
303
- return { [key]: value };
304
- }
305
- function optionalString(obj, sourceKey, targetKey) {
306
- const val = obj[sourceKey];
307
- if (typeof val !== "string")
308
- return undefined;
309
- return { [targetKey]: val };
310
- }
311
- function optionalSnakeToCamel(obj, snakeKey, camelKey) {
312
- const val = obj[snakeKey] ?? obj[camelKey];
313
- if (typeof val !== "string")
314
- return undefined;
315
- return { [camelKey]: val };
316
- }
317
- function optionalSnakeToCamelBool(obj, snakeKey, camelKey) {
318
- const val = obj[snakeKey] ?? obj[camelKey];
319
- if (typeof val !== "boolean")
320
- return undefined;
321
- return { [camelKey]: val };
322
- }
323
- function optionalSnakeToCamelNumber(obj, snakeKey, camelKey) {
324
- const val = obj[snakeKey] ?? obj[camelKey];
325
- if (typeof val !== "number" || !Number.isFinite(val))
326
- return undefined;
327
- return { [camelKey]: val };
328
- }
329
- function optionalStringArray(obj, sourceKey, targetKey) {
330
- const val = obj[sourceKey] ?? obj[targetKey];
331
- if (!Array.isArray(val))
332
- return undefined;
333
- const filtered = val.filter((v) => typeof v === "string");
334
- if (filtered.length === 0)
335
- return undefined;
336
- return { [targetKey]: filtered };
337
- }
338
- function optionalStringArrayFromSnake(obj, snakeKey, camelKey) {
339
- const val = obj[snakeKey] ?? obj[camelKey];
340
- if (!Array.isArray(val))
341
- return undefined;
342
- const filtered = val.filter((v) => typeof v === "string");
343
- if (filtered.length === 0)
344
- return undefined;
345
- return { [camelKey]: filtered };
346
- }
347
- function optionalStringRecord(obj, sourceKey, targetKey) {
348
- const val = obj[sourceKey];
349
- if (!isPlainObject(val))
350
- return undefined;
351
- return { [targetKey]: toStringRecord(val) };
352
- }
353
- function optionalStringRecordSnake(obj, snakeKey, camelKey) {
354
- const val = obj[snakeKey] ?? obj[camelKey];
355
- if (!isPlainObject(val))
356
- return undefined;
357
- return { [camelKey]: toStringRecord(val) };
358
- }
359
- function optionalMappedArray(obj, snakeKey, camelKey, mapper) {
360
- const raw = obj[snakeKey] ?? obj[camelKey];
361
- if (!Array.isArray(raw) || raw.length === 0)
362
- return undefined;
363
- const mapped = raw.filter(isPlainObject).map(mapper);
364
- if (mapped.length === 0)
365
- return undefined;
366
- return { [camelKey]: mapped };
367
- }
368
- // ---------------------------------------------------------------------------
369
- // Primitive helpers
370
- // ---------------------------------------------------------------------------
371
- function extractRequiredString(obj, key, displayPath) {
372
- const val = obj[key];
373
- if (typeof val !== "string" || val.length === 0) {
374
- throw new Error(`Resource YAML is missing required field: ${displayPath}.`);
375
- }
376
- return val;
377
- }
378
- function extractOptionalString(obj, key) {
379
- const val = obj[key];
380
- return typeof val === "string" && val.length > 0 ? val : undefined;
381
- }
382
- function extractOptionalStringRecord(obj, key) {
383
- const val = obj[key];
384
- if (!isPlainObject(val))
385
- return undefined;
386
- return toStringRecord(val);
387
- }
388
- // ---------------------------------------------------------------------------
389
- // Utilities
390
- // ---------------------------------------------------------------------------
391
- function isPlainObject(value) {
392
- return typeof value === "object" && value !== null && !Array.isArray(value);
393
- }
394
- function toStringRecord(obj) {
395
- const result = {};
396
- for (const [k, v] of Object.entries(obj)) {
397
- if (typeof v === "string")
398
- result[k] = v;
399
- else if (v !== null && v !== undefined)
400
- result[k] = String(v);
401
- }
402
- return result;
403
- }
404
- function snakeToCamel(key) {
405
- return key.replace(/_([a-z])/g, (_, c) => c.toUpperCase());
406
- }
407
- //# sourceMappingURL=parse-resource-yaml.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-resource-yaml.js","sourceRoot":"","sources":["../../src/library/parse-resource-yaml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAyC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAe,EACf,GAAW;IAEX,MAAM,GAAG,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAC;IAEhE,MAAM,IAAI,GAAG,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE/D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC;aACtD,CAAC;QACJ,KAAK,WAAW;YACd,OAAO;gBACL,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC;aAC1D,C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entic/agent/v1/api_pb";
3
- import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
4
- /**
5
- * Serializes a proto `Agent` into the canonical Stigmer YAML format.
6
- *
7
- * This is the inverse of {@link parseResourceYaml} — the serialized YAML
8
- * is round-trip compatible and can be fed back through `parseResourceYaml`
9
- * to produce a valid `AgentInput`.
10
- *
11
- * Only emits `apiVersion`, `kind`, `metadata`, and `spec`. The `status`
12
- * field is system-managed and never included in the YAML output.
13
- *
14
- * Uses snake_case field names in the YAML to match the proto canonical form,
15
- * which is the format expected by both the backend and `parseResourceYaml`.
16
- *
17
- * @param agent - The proto `Agent` resource to serialize.
18
- * @returns A YAML string suitable for editing and re-applying.
19
- *
20
- * @example
21
- * ```ts
22
- * import { serializeAgentYaml } from "@stigmer/react";
23
- *
24
- * const yaml = serializeAgentYaml(agent);
25
- * const file = new File([yaml], "my-agent.yaml", { type: "text/yaml" });
26
- * ```
27
- *
28
- * @see {@link parseResourceYaml} for the inverse operation
29
- */
30
- export declare function serializeAgentYaml(agent: Agent): string;
31
- /**
32
- * Serializes a proto `McpServer` into the canonical Stigmer YAML format.
33
- *
34
- * This is the inverse of {@link parseResourceYaml} for McpServer resources.
35
- * Same round-trip guarantee and snake_case convention as {@link serializeAgentYaml}.
36
- *
37
- * @param mcpServer - The proto `McpServer` resource to serialize.
38
- * @returns A YAML string suitable for editing and re-applying.
39
- *
40
- * @example
41
- * ```ts
42
- * import { serializeMcpServerYaml } from "@stigmer/react";
43
- *
44
- * const yaml = serializeMcpServerYaml(mcpServer);
45
- * const file = new File([yaml], "my-server.yaml", { type: "text/yaml" });
46
- * ```
47
- *
48
- * @see {@link parseResourceYaml} for the inverse operation
49
- */
50
- export declare function serializeMcpServerYaml(mcpServer: McpServer): string;
51
- /**
52
- * Serializes an {@link AgentInput} (SDK input type) into the canonical
53
- * Stigmer YAML format.
54
- *
55
- * Unlike {@link serializeAgentYaml} which takes a proto `Agent`, this
56
- * function works from the SDK input type — the same shape used by
57
- * `stigmer.agent.apply()`. This is used by the creation wizard to
58
- * preview the YAML before submission.
59
- *
60
- * The output is round-trip compatible with {@link parseResourceYaml}.
61
- *
62
- * @param input - The SDK `AgentInput` to serialize.
63
- * @returns A YAML string in the canonical Stigmer resource format.
64
- *
65
- * @example
66
- * ```ts
67
- * import { serializeAgentInputYaml } from "@stigmer/react";
68
- *
69
- * const yaml = serializeAgentInputYaml({
70
- * name: "my-agent",
71
- * org: "acme",
72
- * instructions: "You are a helpful assistant.",
73
- * });
74
- * ```
75
- */
76
- export declare function serializeAgentInputYaml(input: AgentInput): string;
77
- /**
78
- * Serializes a {@link McpServerInput} (SDK input type) into the canonical
79
- * Stigmer YAML format.
80
- *
81
- * Unlike {@link serializeMcpServerYaml} which takes a proto `McpServer`,
82
- * this function works from the SDK input type — the same shape used by
83
- * `stigmer.mcpServer.apply()`. This is used by the creation wizard to
84
- * preview the YAML before submission.
85
- *
86
- * The output is round-trip compatible with {@link parseResourceYaml}.
87
- *
88
- * @param input - The SDK `McpServerInput` to serialize.
89
- * @returns A YAML string in the canonical Stigmer resource format.
90
- *
91
- * @example
92
- * ```ts
93
- * import { serializeMcpServerInputYaml } from "@stigmer/react";
94
- *
95
- * const yaml = serializeMcpServerInputYaml({
96
- * name: "github",
97
- * org: "acme",
98
- * http: { url: "https://mcp.github.com/sse" },
99
- * });
100
- * ```
101
- */
102
- export declare function serializeMcpServerInputYaml(input: McpServerInput): string;
103
- //# sourceMappingURL=serialize-resource-yaml.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialize-resource-yaml.d.ts","sourceRoot":"","sources":["../../src/library/serialize-resource-yaml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EAMf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAQhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAUxF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CASvD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CASnE;AAiUD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CASjE;AA8KD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CASzE"}