@stigmer/react 3.2.3 → 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 (402) hide show
  1. package/agent/steps/ReviewStep.d.ts.map +1 -1
  2. package/agent/steps/ReviewStep.js +2 -3
  3. package/agent/steps/ReviewStep.js.map +1 -1
  4. package/billing/BaselineEditor.d.ts +9 -0
  5. package/billing/BaselineEditor.d.ts.map +1 -0
  6. package/billing/BaselineEditor.js +253 -0
  7. package/billing/BaselineEditor.js.map +1 -0
  8. package/billing/ModelCatalogPanel.d.ts +28 -0
  9. package/billing/ModelCatalogPanel.d.ts.map +1 -0
  10. package/billing/ModelCatalogPanel.js +102 -0
  11. package/billing/ModelCatalogPanel.js.map +1 -0
  12. package/billing/ModelGovernanceDetail.d.ts +8 -0
  13. package/billing/ModelGovernanceDetail.d.ts.map +1 -0
  14. package/billing/ModelGovernanceDetail.js +64 -0
  15. package/billing/ModelGovernanceDetail.js.map +1 -0
  16. package/billing/OperatorAccessNotice.d.ts +12 -0
  17. package/billing/OperatorAccessNotice.d.ts.map +1 -0
  18. package/billing/OperatorAccessNotice.js +15 -0
  19. package/billing/OperatorAccessNotice.js.map +1 -0
  20. package/billing/PricingGovernanceConsole.d.ts +57 -0
  21. package/billing/PricingGovernanceConsole.d.ts.map +1 -0
  22. package/billing/PricingGovernanceConsole.js +164 -0
  23. package/billing/PricingGovernanceConsole.js.map +1 -0
  24. package/billing/PricingGovernancePanel.d.ts +26 -0
  25. package/billing/PricingGovernancePanel.d.ts.map +1 -0
  26. package/billing/PricingGovernancePanel.js +64 -0
  27. package/billing/PricingGovernancePanel.js.map +1 -0
  28. package/billing/RetireConfirm.d.ts +9 -0
  29. package/billing/RetireConfirm.d.ts.map +1 -0
  30. package/billing/RetireConfirm.js +19 -0
  31. package/billing/RetireConfirm.js.map +1 -0
  32. package/billing/form-primitives.d.ts +18 -0
  33. package/billing/form-primitives.d.ts.map +1 -0
  34. package/billing/form-primitives.js +19 -0
  35. package/billing/form-primitives.js.map +1 -0
  36. package/billing/governance-primitives.d.ts +33 -0
  37. package/billing/governance-primitives.d.ts.map +1 -0
  38. package/billing/governance-primitives.js +43 -0
  39. package/billing/governance-primitives.js.map +1 -0
  40. package/billing/index.d.ts +18 -0
  41. package/billing/index.d.ts.map +1 -1
  42. package/billing/index.js +9 -0
  43. package/billing/index.js.map +1 -1
  44. package/billing/pricing-format.d.ts +12 -0
  45. package/billing/pricing-format.d.ts.map +1 -0
  46. package/billing/pricing-format.js +50 -0
  47. package/billing/pricing-format.js.map +1 -0
  48. package/billing/useDecidePricingOverride.d.ts +46 -0
  49. package/billing/useDecidePricingOverride.d.ts.map +1 -0
  50. package/billing/useDecidePricingOverride.js +44 -0
  51. package/billing/useDecidePricingOverride.js.map +1 -0
  52. package/billing/useModelGovernanceView.d.ts +103 -0
  53. package/billing/useModelGovernanceView.d.ts.map +1 -0
  54. package/billing/useModelGovernanceView.js +144 -0
  55. package/billing/useModelGovernanceView.js.map +1 -0
  56. package/billing/useModelPricingBaselines.d.ts +40 -0
  57. package/billing/useModelPricingBaselines.d.ts.map +1 -0
  58. package/billing/useModelPricingBaselines.js +32 -0
  59. package/billing/useModelPricingBaselines.js.map +1 -0
  60. package/billing/usePricingGovernance.d.ts +39 -0
  61. package/billing/usePricingGovernance.d.ts.map +1 -0
  62. package/billing/usePricingGovernance.js +31 -0
  63. package/billing/usePricingGovernance.js.map +1 -0
  64. package/billing/useRetireModelPricingBaseline.d.ts +31 -0
  65. package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
  66. package/billing/useRetireModelPricingBaseline.js +36 -0
  67. package/billing/useRetireModelPricingBaseline.js.map +1 -0
  68. package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
  69. package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
  70. package/billing/useUpsertModelPricingBaseline.js +37 -0
  71. package/billing/useUpsertModelPricingBaseline.js.map +1 -0
  72. package/channel/AgentChannelsPanel.d.ts.map +1 -1
  73. package/channel/AgentChannelsPanel.js +11 -5
  74. package/channel/AgentChannelsPanel.js.map +1 -1
  75. package/composer/SessionComposer.d.ts +1 -1
  76. package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
  77. package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
  78. package/cursor-accounts/CursorAccountEditor.js +51 -0
  79. package/cursor-accounts/CursorAccountEditor.js.map +1 -0
  80. package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
  81. package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
  82. package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
  83. package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
  84. package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
  85. package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
  86. package/cursor-accounts/CursorAccountsConsole.js +275 -0
  87. package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
  88. package/cursor-accounts/cursor-account-format.d.ts +10 -0
  89. package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
  90. package/cursor-accounts/cursor-account-format.js +26 -0
  91. package/cursor-accounts/cursor-account-format.js.map +1 -0
  92. package/cursor-accounts/index.d.ts +18 -0
  93. package/cursor-accounts/index.d.ts.map +1 -0
  94. package/cursor-accounts/index.js +13 -0
  95. package/cursor-accounts/index.js.map +1 -0
  96. package/cursor-accounts/useCursorAccountView.d.ts +30 -0
  97. package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
  98. package/cursor-accounts/useCursorAccountView.js +25 -0
  99. package/cursor-accounts/useCursorAccountView.js.map +1 -0
  100. package/cursor-accounts/useCursorAccounts.d.ts +33 -0
  101. package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
  102. package/cursor-accounts/useCursorAccounts.js +25 -0
  103. package/cursor-accounts/useCursorAccounts.js.map +1 -0
  104. package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
  105. package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
  106. package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
  107. package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
  108. package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
  109. package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
  110. package/cursor-accounts/useDeleteCursorAccount.js +32 -0
  111. package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
  112. package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
  113. package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
  114. package/cursor-accounts/useSyncCursorAccount.js +31 -0
  115. package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
  116. package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
  117. package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
  118. package/cursor-accounts/useUpsertCursorAccount.js +34 -0
  119. package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
  120. package/datastore/CollectionRecordsBrowser.d.ts +34 -0
  121. package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
  122. package/datastore/CollectionRecordsBrowser.js +209 -0
  123. package/datastore/CollectionRecordsBrowser.js.map +1 -0
  124. package/datastore/CollectionSchemaView.d.ts +29 -0
  125. package/datastore/CollectionSchemaView.d.ts.map +1 -0
  126. package/datastore/CollectionSchemaView.js +93 -0
  127. package/datastore/CollectionSchemaView.js.map +1 -0
  128. package/datastore/DatastoreDetailView.d.ts +44 -0
  129. package/datastore/DatastoreDetailView.d.ts.map +1 -0
  130. package/datastore/DatastoreDetailView.js +76 -0
  131. package/datastore/DatastoreDetailView.js.map +1 -0
  132. package/datastore/DatastoreSyncReport.d.ts +19 -0
  133. package/datastore/DatastoreSyncReport.d.ts.map +1 -0
  134. package/datastore/DatastoreSyncReport.js +45 -0
  135. package/datastore/DatastoreSyncReport.js.map +1 -0
  136. package/datastore/DeleteDatastoreDialog.d.ts +35 -0
  137. package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
  138. package/datastore/DeleteDatastoreDialog.js +90 -0
  139. package/datastore/DeleteDatastoreDialog.js.map +1 -0
  140. package/datastore/FieldValueControl.d.ts +55 -0
  141. package/datastore/FieldValueControl.d.ts.map +1 -0
  142. package/datastore/FieldValueControl.js +138 -0
  143. package/datastore/FieldValueControl.js.map +1 -0
  144. package/datastore/RecordFilterBuilder.d.ts +30 -0
  145. package/datastore/RecordFilterBuilder.d.ts.map +1 -0
  146. package/datastore/RecordFilterBuilder.js +122 -0
  147. package/datastore/RecordFilterBuilder.js.map +1 -0
  148. package/datastore/RecordFormPanel.d.ts +45 -0
  149. package/datastore/RecordFormPanel.d.ts.map +1 -0
  150. package/datastore/RecordFormPanel.js +215 -0
  151. package/datastore/RecordFormPanel.js.map +1 -0
  152. package/datastore/index.d.ts +43 -0
  153. package/datastore/index.d.ts.map +1 -0
  154. package/datastore/index.js +22 -0
  155. package/datastore/index.js.map +1 -0
  156. package/datastore/recordFilter.d.ts +54 -0
  157. package/datastore/recordFilter.d.ts.map +1 -0
  158. package/datastore/recordFilter.js +93 -0
  159. package/datastore/recordFilter.js.map +1 -0
  160. package/datastore/recordValues.d.ts +85 -0
  161. package/datastore/recordValues.d.ts.map +1 -0
  162. package/datastore/recordValues.js +282 -0
  163. package/datastore/recordValues.js.map +1 -0
  164. package/datastore/useDatastore.d.ts +39 -0
  165. package/datastore/useDatastore.d.ts.map +1 -0
  166. package/datastore/useDatastore.js +44 -0
  167. package/datastore/useDatastore.js.map +1 -0
  168. package/datastore/useDatastoreCount.d.ts +48 -0
  169. package/datastore/useDatastoreCount.d.ts.map +1 -0
  170. package/datastore/useDatastoreCount.js +27 -0
  171. package/datastore/useDatastoreCount.js.map +1 -0
  172. package/datastore/useDatastoreDescription.d.ts +54 -0
  173. package/datastore/useDatastoreDescription.d.ts.map +1 -0
  174. package/datastore/useDatastoreDescription.js +50 -0
  175. package/datastore/useDatastoreDescription.js.map +1 -0
  176. package/datastore/useDatastoreList.d.ts +57 -0
  177. package/datastore/useDatastoreList.d.ts.map +1 -0
  178. package/datastore/useDatastoreList.js +29 -0
  179. package/datastore/useDatastoreList.js.map +1 -0
  180. package/datastore/useDatastoreSearch.d.ts +19 -0
  181. package/datastore/useDatastoreSearch.d.ts.map +1 -0
  182. package/datastore/useDatastoreSearch.js +22 -0
  183. package/datastore/useDatastoreSearch.js.map +1 -0
  184. package/datastore/useDeleteDatastore.d.ts +53 -0
  185. package/datastore/useDeleteDatastore.d.ts.map +1 -0
  186. package/datastore/useDeleteDatastore.js +40 -0
  187. package/datastore/useDeleteDatastore.js.map +1 -0
  188. package/datastore/useDeleteRecord.d.ts +34 -0
  189. package/datastore/useDeleteRecord.d.ts.map +1 -0
  190. package/datastore/useDeleteRecord.js +43 -0
  191. package/datastore/useDeleteRecord.js.map +1 -0
  192. package/datastore/useInsertRecord.d.ts +50 -0
  193. package/datastore/useInsertRecord.d.ts.map +1 -0
  194. package/datastore/useInsertRecord.js +55 -0
  195. package/datastore/useInsertRecord.js.map +1 -0
  196. package/datastore/useRecordCollection.d.ts +104 -0
  197. package/datastore/useRecordCollection.d.ts.map +1 -0
  198. package/datastore/useRecordCollection.js +136 -0
  199. package/datastore/useRecordCollection.js.map +1 -0
  200. package/datastore/useRecordList.d.ts +66 -0
  201. package/datastore/useRecordList.d.ts.map +1 -0
  202. package/datastore/useRecordList.js +58 -0
  203. package/datastore/useRecordList.js.map +1 -0
  204. package/datastore/useUpdateRecord.d.ts +52 -0
  205. package/datastore/useUpdateRecord.d.ts.map +1 -0
  206. package/datastore/useUpdateRecord.js +55 -0
  207. package/datastore/useUpdateRecord.js.map +1 -0
  208. package/environment/EnvironmentListPanel.d.ts.map +1 -1
  209. package/environment/EnvironmentListPanel.js +12 -7
  210. package/environment/EnvironmentListPanel.js.map +1 -1
  211. package/iam-policy/index.d.ts +1 -1
  212. package/iam-policy/index.d.ts.map +1 -1
  213. package/iam-policy/index.js.map +1 -1
  214. package/iam-policy/useCheckPermission.d.ts +32 -11
  215. package/iam-policy/useCheckPermission.d.ts.map +1 -1
  216. package/iam-policy/useCheckPermission.js +24 -19
  217. package/iam-policy/useCheckPermission.js.map +1 -1
  218. package/index.d.ts +12 -6
  219. package/index.d.ts.map +1 -1
  220. package/index.js +14 -3
  221. package/index.js.map +1 -1
  222. package/library/index.d.ts +0 -7
  223. package/library/index.d.ts.map +1 -1
  224. package/library/index.js +0 -4
  225. package/library/index.js.map +1 -1
  226. package/library/useApplyResource.d.ts +12 -12
  227. package/library/useApplyResource.d.ts.map +1 -1
  228. package/library/useApplyResource.js +16 -25
  229. package/library/useApplyResource.js.map +1 -1
  230. package/library/useExportResource.d.ts +13 -9
  231. package/library/useExportResource.d.ts.map +1 -1
  232. package/library/useExportResource.js +18 -36
  233. package/library/useExportResource.js.map +1 -1
  234. package/manifest/ApplyManifestDialog.d.ts +48 -0
  235. package/manifest/ApplyManifestDialog.d.ts.map +1 -0
  236. package/manifest/ApplyManifestDialog.js +135 -0
  237. package/manifest/ApplyManifestDialog.js.map +1 -0
  238. package/manifest/EditResourceYamlDialog.d.ts +51 -0
  239. package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
  240. package/manifest/EditResourceYamlDialog.js +104 -0
  241. package/manifest/EditResourceYamlDialog.js.map +1 -0
  242. package/manifest/RedactedSecretsNotice.d.ts +14 -0
  243. package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
  244. package/manifest/RedactedSecretsNotice.js +14 -0
  245. package/manifest/RedactedSecretsNotice.js.map +1 -0
  246. package/manifest/YamlEditor.d.ts +44 -0
  247. package/manifest/YamlEditor.d.ts.map +1 -0
  248. package/manifest/YamlEditor.js +216 -0
  249. package/manifest/YamlEditor.js.map +1 -0
  250. package/manifest/index.d.ts +13 -0
  251. package/manifest/index.d.ts.map +1 -0
  252. package/manifest/index.js +13 -0
  253. package/manifest/index.js.map +1 -0
  254. package/manifest/useApplyManifest.d.ts +82 -0
  255. package/manifest/useApplyManifest.d.ts.map +1 -0
  256. package/manifest/useApplyManifest.js +180 -0
  257. package/manifest/useApplyManifest.js.map +1 -0
  258. package/manifest/useEditResourceYaml.d.ts +106 -0
  259. package/manifest/useEditResourceYaml.d.ts.map +1 -0
  260. package/manifest/useEditResourceYaml.js +168 -0
  261. package/manifest/useEditResourceYaml.js.map +1 -0
  262. package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
  263. package/mcp-server/steps/ReviewStep.js +2 -3
  264. package/mcp-server/steps/ReviewStep.js.map +1 -1
  265. package/package.json +4 -4
  266. package/resource-creation/templates/workflow-templates.js +4 -4
  267. package/session/useEditSessionPrep.js +3 -3
  268. package/session/useEditSessionPrep.js.map +1 -1
  269. package/settings/index.d.ts +2 -1
  270. package/settings/index.d.ts.map +1 -1
  271. package/settings/index.js +2 -1
  272. package/settings/index.js.map +1 -1
  273. package/settings/settings-nav.d.ts +22 -0
  274. package/settings/settings-nav.d.ts.map +1 -1
  275. package/settings/settings-nav.js +32 -1
  276. package/settings/settings-nav.js.map +1 -1
  277. package/settings/useSettingsNavGroups.d.ts +29 -0
  278. package/settings/useSettingsNavGroups.d.ts.map +1 -0
  279. package/settings/useSettingsNavGroups.js +61 -0
  280. package/settings/useSettingsNavGroups.js.map +1 -0
  281. package/src/agent/steps/ReviewStep.tsx +2 -3
  282. package/src/billing/BaselineEditor.tsx +619 -0
  283. package/src/billing/ModelCatalogPanel.tsx +283 -0
  284. package/src/billing/ModelGovernanceDetail.tsx +289 -0
  285. package/src/billing/OperatorAccessNotice.tsx +32 -0
  286. package/src/billing/PricingGovernanceConsole.tsx +465 -0
  287. package/src/billing/PricingGovernancePanel.tsx +166 -0
  288. package/src/billing/RetireConfirm.tsx +82 -0
  289. package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
  290. package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
  291. package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
  292. package/src/billing/form-primitives.tsx +68 -0
  293. package/src/billing/governance-primitives.tsx +133 -0
  294. package/src/billing/index.ts +37 -0
  295. package/src/billing/pricing-format.ts +53 -0
  296. package/src/billing/useDecidePricingOverride.ts +78 -0
  297. package/src/billing/useModelGovernanceView.ts +290 -0
  298. package/src/billing/useModelPricingBaselines.ts +69 -0
  299. package/src/billing/usePricingGovernance.ts +57 -0
  300. package/src/billing/useRetireModelPricingBaseline.ts +65 -0
  301. package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
  302. package/src/channel/AgentChannelsPanel.tsx +27 -1
  303. package/src/composer/SessionComposer.tsx +1 -1
  304. package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
  305. package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
  306. package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
  307. package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
  308. package/src/cursor-accounts/cursor-account-format.ts +29 -0
  309. package/src/cursor-accounts/index.ts +29 -0
  310. package/src/cursor-accounts/useCursorAccountView.ts +49 -0
  311. package/src/cursor-accounts/useCursorAccounts.ts +49 -0
  312. package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
  313. package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
  314. package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
  315. package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
  316. package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
  317. package/src/datastore/CollectionSchemaView.tsx +247 -0
  318. package/src/datastore/DatastoreDetailView.tsx +201 -0
  319. package/src/datastore/DatastoreSyncReport.tsx +105 -0
  320. package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
  321. package/src/datastore/FieldValueControl.tsx +289 -0
  322. package/src/datastore/RecordFilterBuilder.tsx +411 -0
  323. package/src/datastore/RecordFormPanel.tsx +432 -0
  324. package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
  325. package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
  326. package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
  327. package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
  328. package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
  329. package/src/datastore/__tests__/recordFilter.test.ts +156 -0
  330. package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
  331. package/src/datastore/__tests__/recordValues.test.ts +359 -0
  332. package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
  333. package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
  334. package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
  335. package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
  336. package/src/datastore/index.ts +111 -0
  337. package/src/datastore/recordFilter.ts +140 -0
  338. package/src/datastore/recordValues.ts +327 -0
  339. package/src/datastore/useDatastore.ts +67 -0
  340. package/src/datastore/useDatastoreCount.ts +67 -0
  341. package/src/datastore/useDatastoreDescription.ts +90 -0
  342. package/src/datastore/useDatastoreList.ts +79 -0
  343. package/src/datastore/useDatastoreSearch.ts +39 -0
  344. package/src/datastore/useDeleteDatastore.ts +87 -0
  345. package/src/datastore/useDeleteRecord.ts +77 -0
  346. package/src/datastore/useInsertRecord.ts +92 -0
  347. package/src/datastore/useRecordCollection.ts +256 -0
  348. package/src/datastore/useRecordList.ts +131 -0
  349. package/src/datastore/useUpdateRecord.ts +95 -0
  350. package/src/environment/EnvironmentListPanel.tsx +24 -0
  351. package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
  352. package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
  353. package/src/iam-policy/index.ts +1 -0
  354. package/src/iam-policy/useCheckPermission.ts +45 -19
  355. package/src/index.ts +163 -13
  356. package/src/library/index.ts +0 -20
  357. package/src/library/useApplyResource.ts +27 -34
  358. package/src/library/useExportResource.ts +21 -40
  359. package/src/manifest/ApplyManifestDialog.tsx +315 -0
  360. package/src/manifest/EditResourceYamlDialog.tsx +265 -0
  361. package/src/manifest/RedactedSecretsNotice.tsx +30 -0
  362. package/src/manifest/YamlEditor.tsx +272 -0
  363. package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
  364. package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
  365. package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
  366. package/src/manifest/index.ts +33 -0
  367. package/src/manifest/useApplyManifest.ts +270 -0
  368. package/src/manifest/useEditResourceYaml.ts +273 -0
  369. package/src/mcp-server/steps/ReviewStep.tsx +2 -3
  370. package/src/resource-creation/templates/workflow-templates.ts +4 -4
  371. package/src/session/useEditSessionPrep.ts +3 -3
  372. package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
  373. package/src/settings/index.ts +5 -1
  374. package/src/settings/settings-nav.ts +43 -0
  375. package/src/settings/useSettingsNavGroups.ts +81 -0
  376. package/src/workflow/WorkflowYamlEditor.tsx +6 -270
  377. package/styles.css +1 -1
  378. package/workflow/CanvasTransitionEdge.d.ts +1 -1
  379. package/workflow/WorkflowYamlEditor.d.ts +2 -42
  380. package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
  381. package/workflow/WorkflowYamlEditor.js +5 -214
  382. package/workflow/WorkflowYamlEditor.js.map +1 -1
  383. package/library/ImportResourceDialog.d.ts +0 -43
  384. package/library/ImportResourceDialog.d.ts.map +0 -1
  385. package/library/ImportResourceDialog.js +0 -90
  386. package/library/ImportResourceDialog.js.map +0 -1
  387. package/library/parse-resource-yaml.d.ts +0 -63
  388. package/library/parse-resource-yaml.d.ts.map +0 -1
  389. package/library/parse-resource-yaml.js +0 -407
  390. package/library/parse-resource-yaml.js.map +0 -1
  391. package/library/serialize-resource-yaml.d.ts +0 -103
  392. package/library/serialize-resource-yaml.d.ts.map +0 -1
  393. package/library/serialize-resource-yaml.js +0 -565
  394. package/library/serialize-resource-yaml.js.map +0 -1
  395. package/library/useImportResource.d.ts +0 -84
  396. package/library/useImportResource.d.ts.map +0 -1
  397. package/library/useImportResource.js +0 -188
  398. package/library/useImportResource.js.map +0 -1
  399. package/src/library/ImportResourceDialog.tsx +0 -227
  400. package/src/library/parse-resource-yaml.ts +0 -630
  401. package/src/library/serialize-resource-yaml.ts +0 -756
  402. package/src/library/useImportResource.ts +0 -253
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAA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,CAAC;AAElG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EACV,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EACV,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,YAAY,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,YAAY,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC"}
package/library/index.js CHANGED
@@ -7,13 +7,9 @@ export { isSkillPackage, detectSkillPackage, } from "./detect-skill-package.js";
7
7
  export { isPlanArtifact, isPlanArtifactName, findPlanArtifact, findLatestSessionPlan, PLAN_ARTIFACT_NAME, PLAN_ARTIFACT_SUFFIX, } from "./detect-plan-artifact.js";
8
8
  export { findStreamingPlan } from "./detect-streaming-plan.js";
9
9
  export { useDetectSkillPackage } from "./useDetectSkillPackage.js";
10
- export { parseResourceYaml } from "./parse-resource-yaml.js";
11
- export { serializeAgentYaml, serializeMcpServerYaml, serializeAgentInputYaml, serializeMcpServerInputYaml, } from "./serialize-resource-yaml.js";
12
10
  export { serializeWorkflowYaml, parseWorkflowYaml } from "../workflow/serialize-workflow-yaml.js";
13
11
  export { useApplyResource } from "./useApplyResource.js";
14
12
  export { useExportResource } from "./useExportResource.js";
15
- export { useImportResource } from "./useImportResource.js";
16
- export { ImportResourceDialog } from "./ImportResourceDialog.js";
17
13
  export { VisibilitySelector, VisibilityBadge } from "./VisibilitySelector.js";
18
14
  export { blueprintVisibilityLevels, INSTANCE_VISIBILITY_LEVELS, visibilityLabel, visibilityOption, } from "./visibilityLevels.js";
19
15
  export { ResourceVisibilityControl } from "./ResourceVisibilityControl.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAMrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,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AO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAElG,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM3D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM9E,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAM/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -5,8 +5,8 @@
5
5
  * link to the resource in the Library (e.g., `/library/agents`).
6
6
  */
7
7
  export interface ApplyResourceResult {
8
- /** The resource kind that was applied. */
9
- readonly kind: "Agent" | "McpServer" | "Skill";
8
+ /** The resource kind that was applied (`"Agent"`, `"McpServer"`, `"Skill"`, …). */
9
+ readonly kind: string;
10
10
  /** The resource name (from response metadata). */
11
11
  readonly name: string;
12
12
  /** The organization the resource was applied to. */
@@ -33,14 +33,14 @@ export interface PushSkillParams {
33
33
  /** Return value of {@link useApplyResource}. */
34
34
  export interface UseApplyResourceReturn {
35
35
  /**
36
- * Apply a Stigmer resource YAML (Agent or McpServer) to an organization.
36
+ * Apply a Stigmer resource YAML to an organization.
37
37
  *
38
- * Parses the YAML content, converts it to the appropriate SDK input type,
39
- * and calls `stigmer.agent.apply()` or `stigmer.mcpServer.apply()` based
40
- * on the detected `kind`.
38
+ * Parses the YAML against the kind's generated proto schema via the SDK
39
+ * manifest engine and applies it through `stigmer.manifest.apply()`
40
+ * any registry-supported kind, full fidelity.
41
41
  *
42
- * The `org` parameter overrides `metadata.org` in the YAML — matching
43
- * the "Apply to [my-org]" UX intent.
42
+ * The `org` parameter fills in `metadata.org` when the YAML omits it
43
+ * matching the "Apply to [my-org]" UX intent.
44
44
  *
45
45
  * @throws Re-throws the original error after setting `error` state, so
46
46
  * callers can optionally catch for flow control.
@@ -72,9 +72,9 @@ export interface UseApplyResourceReturn {
72
72
  *
73
73
  * Handles two parallel apply paths:
74
74
  *
75
- * 1. **YAML resources** (Agent, McpServer): `applyYamlResource(content, org)`
76
- * parses the YAML, converts snake_case fields to SDK input types, and
77
- * calls the appropriate `apply()` method.
75
+ * 1. **YAML resources**: `applyYamlResource(content, org)` parses the YAML
76
+ * against the generated proto schema (SDK manifest engine) and applies
77
+ * it through the kind's `apply` RPC.
78
78
  *
79
79
  * 2. **Skill packages** (directory artifacts): `pushSkillPackage(params)`
80
80
  * delegates to the server-side `pushFromExecutionArtifact` RPC.
@@ -108,7 +108,7 @@ export interface UseApplyResourceReturn {
108
108
  * };
109
109
  * ```
110
110
  *
111
- * @see {@link parseResourceYaml} for the pure YAML-to-input conversion
111
+ * @see {@link parseManifest} for the YAML-to-proto conversion
112
112
  * @see {@link detectStigmerResource} for YAML resource detection
113
113
  * @see {@link useDetectSkillPackage} for skill package detection
114
114
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useApplyResource.d.ts","sourceRoot":"","sources":["../../src/library/useApplyResource.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,OAAO,CAAC;IAC/C,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,QAAQ,CAAC,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,4CAA4C;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,gDAAgD;AAChD,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,iBAAiB,EAAE,CAC1B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,KACR,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAElC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gBAAgB,EAAE,CACzB,MAAM,EAAE,eAAe,KACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAElC,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAE7B,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CAqEzD"}
@@ -2,9 +2,9 @@
2
2
  import { useCallback, useState } from "react";
3
3
  import { create } from "@bufbuild/protobuf";
4
4
  import { PushSkillFromExecutionArtifactRequestSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
5
+ import { parseManifest } from "@stigmer/sdk";
5
6
  import { useStigmer } from "../hooks.js";
6
7
  import { toError } from "../internal/toError.js";
7
- import { parseResourceYaml } from "./parse-resource-yaml.js";
8
8
  /**
9
9
  * Behavior hook for applying detected Stigmer resources to an organization.
10
10
  *
@@ -14,9 +14,9 @@ import { parseResourceYaml } from "./parse-resource-yaml.js";
14
14
  *
15
15
  * Handles two parallel apply paths:
16
16
  *
17
- * 1. **YAML resources** (Agent, McpServer): `applyYamlResource(content, org)`
18
- * parses the YAML, converts snake_case fields to SDK input types, and
19
- * calls the appropriate `apply()` method.
17
+ * 1. **YAML resources**: `applyYamlResource(content, org)` parses the YAML
18
+ * against the generated proto schema (SDK manifest engine) and applies
19
+ * it through the kind's `apply` RPC.
20
20
  *
21
21
  * 2. **Skill packages** (directory artifacts): `pushSkillPackage(params)`
22
22
  * delegates to the server-side `pushFromExecutionArtifact` RPC.
@@ -50,7 +50,7 @@ import { parseResourceYaml } from "./parse-resource-yaml.js";
50
50
  * };
51
51
  * ```
52
52
  *
53
- * @see {@link parseResourceYaml} for the pure YAML-to-input conversion
53
+ * @see {@link parseManifest} for the YAML-to-proto conversion
54
54
  * @see {@link detectStigmerResource} for YAML resource detection
55
55
  * @see {@link useDetectSkillPackage} for skill package detection
56
56
  */
@@ -63,27 +63,18 @@ export function useApplyResource() {
63
63
  setIsApplying(true);
64
64
  setError(null);
65
65
  try {
66
- const parsed = parseResourceYaml(content, org);
67
- switch (parsed.kind) {
68
- case "Agent": {
69
- const agent = await stigmer.agent.apply(parsed.input);
70
- return {
71
- kind: "Agent",
72
- name: agent.metadata?.name ?? parsed.input.name,
73
- org: agent.metadata?.org ?? org,
74
- slug: agent.metadata?.slug ?? parsed.input.name,
75
- };
76
- }
77
- case "McpServer": {
78
- const mcpServer = await stigmer.mcpServer.apply(parsed.input);
79
- return {
80
- kind: "McpServer",
81
- name: mcpServer.metadata?.name ?? parsed.input.name,
82
- org: mcpServer.metadata?.org ?? org,
83
- slug: mcpServer.metadata?.slug ?? parsed.input.name,
84
- };
85
- }
66
+ const documents = parseManifest(content, { org });
67
+ if (documents.length > 1) {
68
+ throw new Error("This artifact contains multiple resource documents. " +
69
+ "Use Apply YAML in the Library to apply multi-document manifests.");
86
70
  }
71
+ const applied = await stigmer.manifest.apply(documents[0]);
72
+ return {
73
+ kind: applied.yamlKind,
74
+ name: applied.name,
75
+ org: applied.org,
76
+ slug: applied.slug,
77
+ };
87
78
  }
88
79
  catch (err) {
89
80
  setError(toError(err));
@@ -1 +1 @@
1
- {"version":3,"file":"useApplyResource.js","sourceRoot":"","sources":["../../src/library/useApplyResource.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,2CAA2C,EAAE,MAAM,mDAAmD,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AA+E7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,iBAAiB,GAAG,WAAW,CACnC,KAAK,EAAE,OAAe,EAAE,GAAW,EAAgC,EAAE;QACnE,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAE/C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,OAAO,C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;AAChF,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
2
+ import type { Datastore } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/api_pb";
2
3
  import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
3
4
  import type { Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
4
5
  /** Options for {@link useExportResource}. */
5
6
  export interface UseExportResourceOptions {
6
7
  /** The resource kind — determines which serializer is used. */
7
- readonly kind: "Agent" | "McpServer" | "Workflow";
8
+ readonly kind: "Agent" | "McpServer" | "Workflow" | "Datastore";
8
9
  /** The proto resource to export, or `null` when not yet loaded. */
9
- readonly resource: Agent | McpServer | Workflow | null;
10
+ readonly resource: Agent | McpServer | Workflow | Datastore | null;
10
11
  }
11
12
  /** Return value of {@link useExportResource}. */
12
13
  export interface UseExportResourceReturn {
@@ -24,16 +25,19 @@ export interface UseExportResourceReturn {
24
25
  readonly json: string | null;
25
26
  }
26
27
  /**
27
- * Headless export hook for Stigmer resources (Agent, McpServer).
28
+ * Headless export hook for Stigmer resources (Agent, McpServer,
29
+ * Workflow, Datastore).
28
30
  *
29
31
  * Serializes the resource into YAML and JSON formats and provides
30
32
  * stable callbacks for copying to clipboard or triggering a file
31
33
  * download. All operations are client-side — no additional API calls.
32
34
  *
33
- * The serialized output uses the canonical Stigmer resource format
34
- * (`apiVersion`, `kind`, `metadata`, `spec`) with snake_case field
35
- * names, identical to what the CLI produces and what `parseResourceYaml`
36
- * accepts ensuring full round-trip compatibility.
35
+ * Non-workflow kinds serialize through the SDK manifest engine
36
+ * ({@link serializeManifest}) the canonical Stigmer resource format
37
+ * (`apiVersion`, `kind`, `metadata`, `spec`, snake_case fields) that
38
+ * round-trips through `parseManifest` and `stigmer apply -f`. Workflows
39
+ * use their own canonical serializer, shared with the workflow Editor
40
+ * tab, so one workflow has exactly one YAML shape across the product.
37
41
  *
38
42
  * @param options - Resource kind and the proto resource object.
39
43
  * @returns Stable callbacks and memoized serialized strings.
@@ -50,8 +54,8 @@ export interface UseExportResourceReturn {
50
54
  * <ActionMenu.Item onSelect={downloadYaml}>Download YAML</ActionMenu.Item>
51
55
  * ```
52
56
  *
53
- * @see {@link serializeAgentYaml} for the underlying Agent serializer
54
- * @see {@link serializeMcpServerYaml} for the underlying McpServer serializer
57
+ * @see {@link serializeManifest} for the underlying Agent/McpServer serializer
58
+ * @see {@link serializeWorkflowYaml} for the workflow-canonical serializer
55
59
  */
56
60
  export declare function useExportResource({ kind, resource, }: UseExportResourceOptions): UseExportResourceReturn;
57
61
  //# sourceMappingURL=useExportResource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useExportResource.d.ts","sourceRoot":"","sources":["../../src/library/useExportResource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uDAAuD,CAAC;AAStF,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;IAClD,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;CACxD;AAED,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;IAClC,+CAA+C;IAC/C,QAAQ,CAAC,YA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C7E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,GACT,EAAE,wBAAwB,GAAG,uBAAuB,CA8CpD"}
@@ -1,23 +1,26 @@
1
1
  "use client";
2
2
  import { useCallback, useMemo } from "react";
3
3
  import { parse as parseYaml } from "yaml";
4
+ import { serializeManifest } from "@stigmer/sdk";
4
5
  import { toast } from "../feedback/toast.js";
5
- import { serializeAgentYaml, serializeMcpServerYaml } from "./serialize-resource-yaml.js";
6
6
  import { serializeWorkflowYaml } from "../workflow/serialize-workflow-yaml.js";
7
7
  // ---------------------------------------------------------------------------
8
8
  // Hook
9
9
  // ---------------------------------------------------------------------------
10
10
  /**
11
- * Headless export hook for Stigmer resources (Agent, McpServer).
11
+ * Headless export hook for Stigmer resources (Agent, McpServer,
12
+ * Workflow, Datastore).
12
13
  *
13
14
  * Serializes the resource into YAML and JSON formats and provides
14
15
  * stable callbacks for copying to clipboard or triggering a file
15
16
  * download. All operations are client-side — no additional API calls.
16
17
  *
17
- * The serialized output uses the canonical Stigmer resource format
18
- * (`apiVersion`, `kind`, `metadata`, `spec`) with snake_case field
19
- * names, identical to what the CLI produces and what `parseResourceYaml`
20
- * accepts ensuring full round-trip compatibility.
18
+ * Non-workflow kinds serialize through the SDK manifest engine
19
+ * ({@link serializeManifest}) the canonical Stigmer resource format
20
+ * (`apiVersion`, `kind`, `metadata`, `spec`, snake_case fields) that
21
+ * round-trips through `parseManifest` and `stigmer apply -f`. Workflows
22
+ * use their own canonical serializer, shared with the workflow Editor
23
+ * tab, so one workflow has exactly one YAML shape across the product.
21
24
  *
22
25
  * @param options - Resource kind and the proto resource object.
23
26
  * @returns Stable callbacks and memoized serialized strings.
@@ -34,24 +37,25 @@ import { serializeWorkflowYaml } from "../workflow/serialize-workflow-yaml.js";
34
37
  * <ActionMenu.Item onSelect={downloadYaml}>Download YAML</ActionMenu.Item>
35
38
  * ```
36
39
  *
37
- * @see {@link serializeAgentYaml} for the underlying Agent serializer
38
- * @see {@link serializeMcpServerYaml} for the underlying McpServer serializer
40
+ * @see {@link serializeManifest} for the underlying Agent/McpServer serializer
41
+ * @see {@link serializeWorkflowYaml} for the workflow-canonical serializer
39
42
  */
40
43
  export function useExportResource({ kind, resource, }) {
41
44
  const yaml = useMemo(() => {
42
45
  if (!resource)
43
46
  return null;
44
- if (kind === "Agent")
45
- return serializeAgentYaml(resource);
46
47
  if (kind === "Workflow")
47
48
  return serializeWorkflowYaml(resource);
48
- return serializeMcpServerYaml(resource);
49
+ return serializeManifest(resource);
49
50
  }, [kind, resource]);
50
51
  const json = useMemo(() => {
51
- if (!resource)
52
+ if (!yaml)
52
53
  return null;
53
- return serializeResourceJson(resource, kind);
54
- }, [kind, resource]);
54
+ // Parse the YAML output to re-stringify as JSON — this guarantees the
55
+ // JSON structure is identical to the YAML structure (snake_case
56
+ // fields, no status).
57
+ return JSON.stringify(parseYaml(yaml), null, 2);
58
+ }, [yaml]);
55
59
  const slug = useMemo(() => {
56
60
  if (!resource)
57
61
  return "resource";
@@ -82,28 +86,6 @@ export function useExportResource({ kind, resource, }) {
82
86
  return useMemo(() => ({ copyYaml, copyJson, downloadYaml, downloadJson, yaml, json }), [copyYaml, copyJson, downloadYaml, downloadJson, yaml, json]);
83
87
  }
84
88
  // ---------------------------------------------------------------------------
85
- // JSON serialization
86
- // ---------------------------------------------------------------------------
87
- /**
88
- * Produces a JSON representation of the resource using the same canonical
89
- * structure as the YAML export (apiVersion, kind, metadata, spec).
90
- *
91
- * Internally parses the YAML output to get a clean plain object, then
92
- * re-stringifies as JSON. This guarantees the JSON structure is identical
93
- * to the YAML structure (snake_case fields, no status).
94
- */
95
- function serializeResourceJson(resource, kind) {
96
- let yamlStr;
97
- if (kind === "Agent")
98
- yamlStr = serializeAgentYaml(resource);
99
- else if (kind === "Workflow")
100
- yamlStr = serializeWorkflowYaml(resource);
101
- else
102
- yamlStr = serializeMcpServerYaml(resource);
103
- const doc = parseYaml(yamlStr);
104
- return JSON.stringify(doc, null, 2);
105
- }
106
- // ---------------------------------------------------------------------------
107
89
  // Clipboard
108
90
  // ---------------------------------------------------------------------------
109
91
  async function copyToClipboard(text) {
@@ -1 +1 @@
1
- {"version":3,"file":"useExportResource.js","sourceRoot":"","sources":["../../src/library/useExportResource.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAI1C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AA8B/E,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,QAAQ,GACiB;IACzB,MAAM,IAAI,GAAG,OAAO,CAAgB,GAAG,EAAE;QACvC,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC3B,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,kBAAkB,CAAC,QAAiB,CAAC,CAAC;QACnE,IAAI,IAAI,KAAK,UAAU;YAAE,OAAO,qBAAqB,CAAC,QAAoB,CAAC,CAAC;QAC5E,OAAO,sBAAsB,CAAC,QAAqB,CAAC,CAAC;IACvD,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAErB,MAAM,IAAI,GAAG,OAAO,CAAgB,GAAG,E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CAAC,IAAI,CAAC,CAAC;IAChC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { type ManifestPreviewEntry } from "./useApplyManifest.js";
2
+ /** Props for {@link ApplyManifestDialog}. */
3
+ export interface ApplyManifestDialogProps {
4
+ /** Whether the dialog is open. */
5
+ readonly open: boolean;
6
+ /** Called when the dialog should open or close. */
7
+ readonly onOpenChange: (open: boolean) => void;
8
+ /** Target organization slug for documents that omit `metadata.org`. */
9
+ readonly org: string;
10
+ /**
11
+ * Called after every document applied successfully, with the per-document
12
+ * results in apply order. Use for navigation or list refresh.
13
+ */
14
+ readonly onSuccess?: (entries: readonly ManifestPreviewEntry[]) => void;
15
+ }
16
+ /**
17
+ * Modal dialog for applying a Stigmer resource manifest — paste YAML or
18
+ * upload a file, review what will change, and apply. The console
19
+ * counterpart of `stigmer apply -f`, for every supported resource kind.
20
+ *
21
+ * Workflow:
22
+ * 1. Paste manifest YAML (or JSON) into the editor, or pick a file
23
+ * 2. Each document is validated against its kind's generated proto schema
24
+ * and previewed with a create-or-update badge resolved from server state
25
+ * 3. Apply runs the documents sequentially in dependency order with live
26
+ * per-document status; a failure stops the run and renders inline
27
+ *
28
+ * Multi-document manifests (`---` separators) are supported. Documents
29
+ * that omit `metadata.org` are applied to the active org; documents naming
30
+ * a different org are honored with a warning (matching `stigmer apply`).
31
+ *
32
+ * Uses the native `<dialog>` element for built-in focus trapping, Escape
33
+ * key handling, and backdrop — consistent with {@link ConfirmDialog}.
34
+ *
35
+ * Zero Console dependencies — safe for platform builder embedding.
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * <ApplyManifestDialog
40
+ * open={open}
41
+ * onOpenChange={setOpen}
42
+ * org={activeOrg}
43
+ * onSuccess={() => refetchList()}
44
+ * />
45
+ * ```
46
+ */
47
+ export declare function ApplyManifestDialog({ open, onOpenChange, org, onSuccess, }: ApplyManifestDialogProps): import("react/jsx-runtime").JSX.Element;
48
+ //# sourceMappingURL=ApplyManifestDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApplyManifestDialog.d.ts","sourceRoot":"","sources":["../../src/manifest/ApplyManifestDialog.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAO/B,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,KAAK,IAAI,CAAC;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,SAAS,GACV,EAAE,wBAAwB,2CAqK1B"}
@@ -0,0 +1,135 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { lazy, Suspense, useCallback, useEffect, useRef } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { toast } from "../feedback/toast.js";
6
+ import { RedactedSecretsNotice } from "./RedactedSecretsNotice.js";
7
+ import { useApplyManifest, } from "./useApplyManifest.js";
8
+ // CodeMirror loads only when the dialog actually opens (DD-013).
9
+ const LazyYamlEditor = lazy(() => import("./YamlEditor.js").then((m) => ({ default: m.YamlEditor })));
10
+ /**
11
+ * Modal dialog for applying a Stigmer resource manifest — paste YAML or
12
+ * upload a file, review what will change, and apply. The console
13
+ * counterpart of `stigmer apply -f`, for every supported resource kind.
14
+ *
15
+ * Workflow:
16
+ * 1. Paste manifest YAML (or JSON) into the editor, or pick a file
17
+ * 2. Each document is validated against its kind's generated proto schema
18
+ * and previewed with a create-or-update badge resolved from server state
19
+ * 3. Apply runs the documents sequentially in dependency order with live
20
+ * per-document status; a failure stops the run and renders inline
21
+ *
22
+ * Multi-document manifests (`---` separators) are supported. Documents
23
+ * that omit `metadata.org` are applied to the active org; documents naming
24
+ * a different org are honored with a warning (matching `stigmer apply`).
25
+ *
26
+ * Uses the native `<dialog>` element for built-in focus trapping, Escape
27
+ * key handling, and backdrop — consistent with {@link ConfirmDialog}.
28
+ *
29
+ * Zero Console dependencies — safe for platform builder embedding.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * <ApplyManifestDialog
34
+ * open={open}
35
+ * onOpenChange={setOpen}
36
+ * org={activeOrg}
37
+ * onSuccess={() => refetchList()}
38
+ * />
39
+ * ```
40
+ */
41
+ export function ApplyManifestDialog({ open, onOpenChange, org, onSuccess, }) {
42
+ const dialogRef = useRef(null);
43
+ const fileInputRef = useRef(null);
44
+ const manifest = useApplyManifest(org);
45
+ const { reset } = manifest;
46
+ // Sync dialog open state with the native <dialog> element.
47
+ useEffect(() => {
48
+ const dialog = dialogRef.current;
49
+ if (!dialog)
50
+ return;
51
+ if (open && !dialog.open) {
52
+ dialog.showModal();
53
+ }
54
+ else if (!open && dialog.open) {
55
+ dialog.close();
56
+ }
57
+ }, [open]);
58
+ // Start each session clean.
59
+ useEffect(() => {
60
+ if (open) {
61
+ reset();
62
+ if (fileInputRef.current)
63
+ fileInputRef.current.value = "";
64
+ }
65
+ }, [open, reset]);
66
+ const handleCancel = useCallback((e) => {
67
+ e.preventDefault();
68
+ onOpenChange(false);
69
+ }, [onOpenChange]);
70
+ const handleFileChange = useCallback((e) => {
71
+ const file = e.target.files?.[0];
72
+ if (file)
73
+ manifest.readFile(file);
74
+ }, [manifest]);
75
+ const handleApply = useCallback(async () => {
76
+ const allApplied = await manifest.applyAll();
77
+ if (allApplied && manifest.entries) {
78
+ const count = manifest.entries.length;
79
+ toast.success(count === 1 ? "Resource applied" : `${count} resources applied`);
80
+ onOpenChange(false);
81
+ onSuccess?.(manifest.entries);
82
+ }
83
+ // On failure the dialog stays open — per-entry status shows what
84
+ // applied and what failed.
85
+ }, [manifest, onOpenChange, onSuccess]);
86
+ const canApply = manifest.entries !== null &&
87
+ manifest.entries.length > 0 &&
88
+ !manifest.isValidating &&
89
+ !manifest.isApplying;
90
+ return (_jsx("dialog", { ref: dialogRef, onCancel: handleCancel, className: cn("fixed inset-0 z-50 m-auto w-full max-w-3xl rounded-lg border border-border bg-popover p-0 text-popover-foreground shadow-lg", "backdrop:bg-black/50", "open:animate-in open:fade-in-0 open:zoom-in-95"), children: _jsxs("div", { className: "flex flex-col gap-4 p-6", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h3", { className: "text-base font-semibold text-foreground", children: "Apply YAML" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Paste a resource manifest or upload a file. Resources are created when new and updated when they already exist." })] }), _jsx("input", { ref: fileInputRef, type: "file", accept: ".yaml,.yml,.json", onChange: handleFileChange, className: cn("w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground", "file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-2.5 file:py-1 file:text-xs file:font-medium file:text-primary-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), "aria-label": "Select manifest file" }), _jsx(Suspense, { fallback: _jsx(EditorLoading, {}), children: _jsx(LazyYamlEditor, { value: manifest.content, onChange: manifest.setContent, className: "h-56" }) }), manifest.hasRedactedSecrets && _jsx(RedactedSecretsNotice, {}), manifest.validationError && (_jsx("div", { role: "alert", className: "rounded-md border border-destructive bg-card px-3 py-2.5 text-sm text-destructive", children: manifest.validationError })), manifest.entries && manifest.entries.length > 0 && (_jsx("ul", { className: "flex max-h-48 flex-col gap-2 overflow-y-auto", "aria-label": "Resources to apply", children: manifest.entries.map((entry, index) => (_jsx(PreviewRow, { entry: entry }, `${entry.document.handler.yamlKind}/${entry.document.org}/${entry.document.slug}/${index}`))) })), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", "aria-live": "polite", children: manifest.isValidating ? "Validating…" : "" }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", onClick: () => onOpenChange(false), disabled: manifest.isApplying, className: cn("rounded-md px-3 py-1.5 text-sm font-medium transition-colors", "border border-input bg-background text-foreground", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: "Cancel" }), _jsx("button", { type: "button", onClick: handleApply, disabled: !canApply, className: cn("rounded-md px-3 py-1.5 text-sm font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: manifest.isApplying
91
+ ? "Applying…"
92
+ : applyLabel(manifest.entries?.length ?? 0) })] })] })] }) }));
93
+ }
94
+ function applyLabel(count) {
95
+ if (count <= 1)
96
+ return "Apply";
97
+ return `Apply ${count} resources`;
98
+ }
99
+ function EditorLoading() {
100
+ return (_jsx("div", { className: "flex h-56 items-center justify-center rounded-md border border-border bg-muted text-sm text-muted-foreground", children: "Loading editor\u2026" }));
101
+ }
102
+ // ---------------------------------------------------------------------------
103
+ // Per-document preview row
104
+ // ---------------------------------------------------------------------------
105
+ function PreviewRow({ entry }) {
106
+ return (_jsxs("li", { className: "rounded-md border border-border bg-card px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "inline-flex rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground", children: entry.document.handler.displayName }), _jsx("span", { className: "text-sm font-medium text-foreground", children: entry.document.name }), _jsx(ActionBadge, { entry: entry }), _jsx("span", { className: "ml-auto text-xs text-muted-foreground", children: entry.document.org })] }), entry.document.warning && (_jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: entry.document.warning })), entry.status === "failed" && entry.errorMessage && (_jsx("p", { role: "alert", className: "mt-1 text-xs text-destructive", children: entry.errorMessage }))] }));
107
+ }
108
+ function ActionBadge({ entry }) {
109
+ const label = badgeLabel(entry);
110
+ return (_jsx("span", { className: cn("inline-flex rounded px-1.5 py-0.5 text-xs font-medium", entry.status === "failed"
111
+ ? "bg-card text-destructive border border-destructive"
112
+ : "bg-muted text-muted-foreground"), children: label }));
113
+ }
114
+ function badgeLabel(entry) {
115
+ switch (entry.status) {
116
+ case "applying":
117
+ return "Applying…";
118
+ case "applied":
119
+ return "Applied";
120
+ case "failed":
121
+ return "Failed";
122
+ case "skipped":
123
+ return "Skipped";
124
+ case "pending":
125
+ switch (entry.action) {
126
+ case "create":
127
+ return "Will create";
128
+ case "update":
129
+ return "Will update";
130
+ case "unknown":
131
+ return "Create or update";
132
+ }
133
+ }
134
+ }
135
+ //# sourceMappingURL=ApplyManifestDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApplyManifestDialog.js","sourceRoot":"","sources":["../../src/manifest/ApplyManifestDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAE/B,iEAAiE;AACjE,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAC/B,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CACn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,CAAC,GAAG,GACd,IACH,EACL,KAAK,CAAC,QAAQ,CAAC,OAAO,IAAI,CACzB,YAAG,SAAS,EAAC,oCAAoC,YAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAK,CAC/E,EACA,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,YAAY,IAAI,CAClD,YAAG,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,+BAA+B,YACtD,KAAK,CAAC,YAAY,GACjB,CACL,IACE,CACN,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,KAAK,EAA4C;IACtE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,uDAAuD,EACvD,KAAK,CAAC,MAAM,KAAK,QAAQ;YACvB,CAAC,CAAC,oDAAoD;YACtD,CAAC,CAAC,gCAAgC,CACrC,YAEA,KAAK,GACD,CACR,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,KAA2B;IAC7C,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,UAAU;YACb,OAAO,WAAW,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;gBACrB,KAAK,QAAQ;oBACX,OAAO,aAAa,CAAC;gBACvB,KAAK,QAAQ;oBACX,OAAO,aAAa,CAAC;gBACvB,KAAK,SAAS;oBACZ,OAAO,kBAAkB,CAAC;YAC9B,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { Message } from "@bufbuild/protobuf";
2
+ import { type AppliedManifest } from "@stigmer/sdk";
3
+ /** Props for {@link EditResourceYamlDialog}. */
4
+ export interface EditResourceYamlDialogProps {
5
+ /** Whether the dialog is open. */
6
+ readonly open: boolean;
7
+ /** Called when the dialog should open or close. */
8
+ readonly onOpenChange: (open: boolean) => void;
9
+ /**
10
+ * The resource to edit, as returned by the server. `null` while loading —
11
+ * the dialog shows the editor as soon as the resource arrives.
12
+ */
13
+ readonly resource: Message | null;
14
+ /** Called after a successful apply. Use for refetching or navigation. */
15
+ readonly onApplied?: (result: AppliedManifest) => void;
16
+ }
17
+ /**
18
+ * Modal dialog for editing a resource as YAML and applying the changes —
19
+ * the kind-agnostic "Edit YAML" experience for detail pages and panels.
20
+ *
21
+ * Workflow:
22
+ * 1. The resource is serialized to canonical YAML (system-managed state
23
+ * stripped) and seeded into a CodeMirror editor
24
+ * 2. Every edit is validated against the kind's generated proto schema;
25
+ * errors render inline with the exact schema complaint
26
+ * 3. A live summary states what applying will do ("update X" / "create Y"),
27
+ * resolved against server state — so a rename reads as a create
28
+ * 4. Apply calls the kind's `apply` RPC (create-or-update by slug)
29
+ *
30
+ * Redacted secret values (`***REDACTED***`) are explained inline: applying
31
+ * them preserves the stored secrets (the server's marker contract).
32
+ *
33
+ * Uses the native `<dialog>` element for built-in focus trapping, Escape
34
+ * key handling, and backdrop — consistent with {@link ConfirmDialog}.
35
+ *
36
+ * Zero Console dependencies — safe for platform builder embedding.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * const { agent, refetch } = useAgent(org, slug);
41
+ *
42
+ * <EditResourceYamlDialog
43
+ * open={editOpen}
44
+ * onOpenChange={setEditOpen}
45
+ * resource={agent}
46
+ * onApplied={() => refetch()}
47
+ * />
48
+ * ```
49
+ */
50
+ export declare function EditResourceYamlDialog({ open, onOpenChange, resource, onApplied, }: EditResourceYamlDialogProps): import("react/jsx-runtime").JSX.Element;
51
+ //# sourceMappingURL=EditResourceYamlDialog.d.ts.map