@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
@@ -14,7 +14,7 @@ import type { CanvasTransitionEdgeData } from "./workflow-graph-conversions.js";
14
14
  *
15
15
  * @since T15 (Visual Canvas Editor), T06 (Branch Highlighting)
16
16
  */
17
- export declare const CanvasTransitionEdge: import("react").NamedExoticComponent<Pick<import("@xyflow/react").Edge<Record<string, unknown>, string | undefined>, "id" | "source" | "data" | "type" | "style" | "target" | "selected" | "selectable" | "deletable" | "animated"> & import("@xyflow/system").EdgePosition & import("@xyflow/react").EdgeLabelOptions & {
17
+ export declare const CanvasTransitionEdge: import("react").NamedExoticComponent<Pick<import("@xyflow/react").Edge<Record<string, unknown>, string | undefined>, "id" | "source" | "type" | "data" | "style" | "target" | "selected" | "selectable" | "deletable" | "animated"> & import("@xyflow/system").EdgePosition & import("@xyflow/react").EdgeLabelOptions & {
18
18
  sourceHandleId?: string | null;
19
19
  targetHandleId?: string | null;
20
20
  markerStart?: string;
@@ -1,43 +1,3 @@
1
- import { type CSSProperties } from "react";
2
- import { type Diagnostic } from "@codemirror/lint";
3
- /** Props for {@link WorkflowYamlEditor}. */
4
- export interface WorkflowYamlEditorProps {
5
- /** Current YAML content. */
6
- readonly value: string;
7
- /** Called when the editor content changes. */
8
- readonly onChange?: (value: string) => void;
9
- /** Validation diagnostics to display as inline markers. */
10
- readonly diagnostics?: readonly Diagnostic[];
11
- /** Whether the editor is read-only. @default false */
12
- readonly readOnly?: boolean;
13
- /** Additional CSS class names for the root container. */
14
- readonly className?: string;
15
- /** Additional inline styles for the root container. */
16
- readonly style?: CSSProperties;
17
- }
18
- /**
19
- * Schema-aware YAML editor built on CodeMirror 6.
20
- *
21
- * Provides syntax highlighting, line numbers, bracket matching,
22
- * code folding, undo/redo, and inline diagnostic markers driven by
23
- * external validation (via the `diagnostics` prop).
24
- *
25
- * Themed via `--stgm-*` CSS custom properties to respect the host
26
- * application's design tokens.
27
- *
28
- * This is an optional SDK component — it requires CodeMirror peer
29
- * dependencies which are tree-shaken when not imported (DD-013).
30
- *
31
- * @example
32
- * ```tsx
33
- * <WorkflowYamlEditor
34
- * value={yaml}
35
- * onChange={setYaml}
36
- * diagnostics={diagnostics}
37
- * />
38
- * ```
39
- *
40
- * @since T10 (YAML Editor with Graph Preview)
41
- */
42
- export declare const WorkflowYamlEditor: import("react").NamedExoticComponent<WorkflowYamlEditorProps>;
1
+ export { YamlEditor as WorkflowYamlEditor } from "../manifest/YamlEditor.js";
2
+ export type { YamlEditorProps as WorkflowYamlEditorProps } from "../manifest/YamlEditor.js";
43
3
  //# sourceMappingURL=WorkflowYamlEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowYamlEditor.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowYamlEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAc,KAAK,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAI/E,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7C,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,+DAwH7B,CAAC"}
1
+ {"version":3,"file":"WorkflowYamlEditor.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowYamlEditor.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,YAAY,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,215 +1,6 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useRef, useEffect, memo, } from "react";
4
- import { cn } from "@stigmer/theme";
5
- import { EditorState, Compartment } from "@codemirror/state";
6
- import { EditorView, keymap, lineNumbers, highlightActiveLine, drawSelection, highlightSpecialChars } from "@codemirror/view";
7
- import { yaml } from "@codemirror/lang-yaml";
8
- import { syntaxHighlighting, HighlightStyle, bracketMatching, indentOnInput, foldGutter } from "@codemirror/language";
9
- import { tags } from "@lezer/highlight";
10
- import { lintGutter, setDiagnostics } from "@codemirror/lint";
11
- import { defaultKeymap, indentWithTab, history, historyKeymap } from "@codemirror/commands";
12
- import { autocompletion } from "@codemirror/autocomplete";
13
- /**
14
- * Schema-aware YAML editor built on CodeMirror 6.
15
- *
16
- * Provides syntax highlighting, line numbers, bracket matching,
17
- * code folding, undo/redo, and inline diagnostic markers driven by
18
- * external validation (via the `diagnostics` prop).
19
- *
20
- * Themed via `--stgm-*` CSS custom properties to respect the host
21
- * application's design tokens.
22
- *
23
- * This is an optional SDK component — it requires CodeMirror peer
24
- * dependencies which are tree-shaken when not imported (DD-013).
25
- *
26
- * @example
27
- * ```tsx
28
- * <WorkflowYamlEditor
29
- * value={yaml}
30
- * onChange={setYaml}
31
- * diagnostics={diagnostics}
32
- * />
33
- * ```
34
- *
35
- * @since T10 (YAML Editor with Graph Preview)
36
- */
37
- export const WorkflowYamlEditor = memo(function WorkflowYamlEditor({ value, onChange, diagnostics, readOnly = false, className, style, }) {
38
- const containerRef = useRef(null);
39
- const viewRef = useRef(null);
40
- const readOnlyCompartment = useRef(new Compartment());
41
- const onChangeRef = useRef(onChange);
42
- onChangeRef.current = onChange;
43
- const isInternalUpdate = useRef(false);
44
- useEffect(() => {
45
- if (!containerRef.current)
46
- return;
47
- const updateListener = EditorView.updateListener.of((update) => {
48
- if (update.docChanged) {
49
- isInternalUpdate.current = true;
50
- onChangeRef.current?.(update.state.doc.toString());
51
- }
52
- });
53
- const state = EditorState.create({
54
- doc: value,
55
- extensions: [
56
- lineNumbers(),
57
- highlightActiveLine(),
58
- highlightSpecialChars(),
59
- drawSelection(),
60
- bracketMatching(),
61
- indentOnInput(),
62
- foldGutter(),
63
- history(),
64
- yaml(),
65
- syntaxHighlighting(stigmerHighlightStyle, { fallback: true }),
66
- autocompletion(),
67
- lintGutter(),
68
- keymap.of([...defaultKeymap, ...historyKeymap, indentWithTab]),
69
- readOnlyCompartment.current.of(EditorState.readOnly.of(readOnly)),
70
- stigmerTheme,
71
- updateListener,
72
- ],
73
- });
74
- const view = new EditorView({
75
- state,
76
- parent: containerRef.current,
77
- });
78
- viewRef.current = view;
79
- return () => {
80
- view.destroy();
81
- viewRef.current = null;
82
- };
83
- }, []);
84
- // Sync external value changes into the editor
85
- useEffect(() => {
86
- const view = viewRef.current;
87
- if (!view)
88
- return;
89
- if (isInternalUpdate.current) {
90
- isInternalUpdate.current = false;
91
- return;
92
- }
93
- const currentDoc = view.state.doc.toString();
94
- if (currentDoc !== value) {
95
- view.dispatch({
96
- changes: {
97
- from: 0,
98
- to: currentDoc.length,
99
- insert: value,
100
- },
101
- });
102
- }
103
- }, [value]);
104
- useEffect(() => {
105
- const view = viewRef.current;
106
- if (!view)
107
- return;
108
- view.dispatch({
109
- effects: readOnlyCompartment.current.reconfigure(EditorState.readOnly.of(readOnly)),
110
- });
111
- }, [readOnly]);
112
- // Sync diagnostics into CodeMirror's lint system
113
- useEffect(() => {
114
- const view = viewRef.current;
115
- if (!view)
116
- return;
117
- const cmDiags = diagnostics
118
- ? diagnostics.map((d) => ({
119
- ...d,
120
- from: Math.min(d.from, view.state.doc.length),
121
- to: Math.min(d.to, view.state.doc.length),
122
- }))
123
- : [];
124
- view.dispatch(setDiagnostics(view.state, cmDiags));
125
- }, [diagnostics]);
126
- return (_jsx("div", { ref: containerRef, className: cn("stgm-yaml-editor overflow-auto rounded-md border border-border bg-background font-mono text-sm", className), style: style }));
127
- });
128
- // ---------------------------------------------------------------------------
129
- // Syntax highlighting: maps lezer tags to --stgm-syntax-* CSS variables
130
- // ---------------------------------------------------------------------------
131
- const stigmerHighlightStyle = HighlightStyle.define([
132
- { tag: tags.propertyName, color: "var(--stgm-syntax-property, #0550ae)" },
133
- { tag: tags.tagName, color: "var(--stgm-syntax-tag, #cf222e)" },
134
- { tag: tags.keyword, color: "var(--stgm-syntax-keyword, #8250df)", fontWeight: "bold" },
135
- { tag: tags.string, color: "var(--stgm-syntax-string, #0a3069)" },
136
- { tag: tags.number, color: "var(--stgm-syntax-number, #953800)" },
137
- { tag: [tags.bool, tags.null], color: "var(--stgm-syntax-bool, #8250df)" },
138
- { tag: tags.atom, color: "var(--stgm-syntax-atom, #cf222e)" },
139
- { tag: tags.comment, color: "var(--stgm-syntax-comment, #6e7781)", fontStyle: "italic" },
140
- { tag: tags.meta, color: "var(--stgm-syntax-meta, #8250df)" },
141
- { tag: tags.name, color: "var(--stgm-foreground, #1a1a2e)" },
142
- { tag: tags.definition(tags.name), color: "var(--stgm-syntax-property, #0550ae)" },
143
- { tag: tags.separator, color: "var(--stgm-muted-foreground, #737373)" },
144
- { tag: tags.punctuation, color: "var(--stgm-muted-foreground, #737373)" },
145
- ]);
146
- // ---------------------------------------------------------------------------
147
- // CodeMirror theme bridge: maps --stgm-* tokens to editor styles
148
- // ---------------------------------------------------------------------------
149
- const stigmerTheme = EditorView.theme({
150
- "&": {
151
- height: "100%",
152
- backgroundColor: "var(--stgm-background, #fff)",
153
- color: "var(--stgm-foreground, #1a1a2e)",
154
- fontSize: "13px",
155
- },
156
- ".cm-content": {
157
- caretColor: "var(--stgm-foreground, #1a1a2e)",
158
- fontFamily: "var(--stgm-font-mono, ui-monospace, monospace)",
159
- padding: "8px 0",
160
- },
161
- ".cm-cursor, .cm-dropCursor": {
162
- borderLeftColor: "var(--stgm-foreground, #1a1a2e)",
163
- },
164
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": {
165
- backgroundColor: "var(--stgm-accent, #e0e7ff)",
166
- },
167
- ".cm-gutters": {
168
- backgroundColor: "var(--stgm-muted, #f5f5f5)",
169
- color: "var(--stgm-muted-foreground, #737373)",
170
- border: "none",
171
- borderRight: "1px solid var(--stgm-border, #e5e5e5)",
172
- },
173
- ".cm-activeLineGutter": {
174
- backgroundColor: "var(--stgm-accent, #e0e7ff)",
175
- },
176
- ".cm-activeLine": {
177
- backgroundColor: "color-mix(in srgb, var(--stgm-accent, #e0e7ff) 30%, transparent)",
178
- },
179
- ".cm-foldPlaceholder": {
180
- backgroundColor: "var(--stgm-muted, #f5f5f5)",
181
- border: "1px solid var(--stgm-border, #e5e5e5)",
182
- color: "var(--stgm-muted-foreground, #737373)",
183
- },
184
- ".cm-tooltip": {
185
- backgroundColor: "var(--stgm-popover, #fff)",
186
- color: "var(--stgm-popover-foreground, #1a1a2e)",
187
- border: "1px solid var(--stgm-border, #e5e5e5)",
188
- borderRadius: "6px",
189
- boxShadow: "0 2px 8px rgba(0,0,0,0.08)",
190
- },
191
- ".cm-tooltip-autocomplete": {
192
- "& > ul > li[aria-selected]": {
193
- backgroundColor: "var(--stgm-accent, #e0e7ff)",
194
- color: "var(--stgm-accent-foreground, #1a1a2e)",
195
- },
196
- },
197
- ".cm-diagnostic-error": {
198
- borderLeft: "3px solid var(--stgm-destructive, #ef4444)",
199
- },
200
- ".cm-diagnostic-warning": {
201
- borderLeft: "3px solid var(--stgm-warning, #f59e0b)",
202
- },
203
- ".cm-diagnostic-info": {
204
- borderLeft: "3px solid var(--stgm-primary, #6366f1)",
205
- },
206
- ".cm-lint-marker-error": {
207
- content: "'●'",
208
- color: "var(--stgm-destructive, #ef4444)",
209
- },
210
- ".cm-lint-marker-warning": {
211
- content: "'●'",
212
- color: "var(--stgm-warning, #f59e0b)",
213
- },
214
- });
1
+ // The schema-aware YAML editor started life here (T10) and was promoted to
2
+ // the manifest domain when resource YAML editing became a cross-kind
3
+ // concern. These aliases keep the original workflow-scoped names stable —
4
+ // both are public API (exported from the package index).
5
+ export { YamlEditor as WorkflowYamlEditor } from "../manifest/YamlEditor.js";
215
6
  //# sourceMappingURL=WorkflowYamlEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowYamlEditor.js","sourceRoot":"","sources":["../../src/workflow/WorkflowYamlEditor.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,MAAM,EACN,SAAS,EACT,IAAI,GAEL,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9H,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAkB1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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WorkflowYamlEditor.tsx"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,qEAAqE;AACrE,0EAA0E;AAC1E,yDAAyD;AAEzD,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,43 +0,0 @@
1
- import type { ApplyResourceResult } from "./useApplyResource.js";
2
- /** Props for {@link ImportResourceDialog}. */
3
- export interface ImportResourceDialogProps {
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 to apply the imported resource to. */
9
- readonly org: string;
10
- /** Called after a successful import. Use for navigation or list refresh. */
11
- readonly onSuccess?: (result: ApplyResourceResult) => void;
12
- }
13
- /**
14
- * Modal dialog for importing a Stigmer resource from a YAML or JSON file.
15
- *
16
- * Workflow:
17
- * 1. User selects a `.yaml`, `.yml`, or `.json` file via the file picker
18
- * 2. The file is validated and a preview card shows the detected resource
19
- * 3. User confirms the import, which calls `apply()` on the target org
20
- * 4. On success: toast notification and `onSuccess` callback
21
- * 5. On error: inline error message with guidance
22
- *
23
- * Uses the native `<dialog>` element for built-in focus trapping, Escape
24
- * key handling, and backdrop — consistent with {@link ConfirmDialog}.
25
- *
26
- * Zero Console dependencies — safe for platform builder embedding.
27
- *
28
- * @example
29
- * ```tsx
30
- * const [open, setOpen] = useState(false);
31
- *
32
- * <ImportResourceDialog
33
- * open={open}
34
- * onOpenChange={setOpen}
35
- * org={activeOrg}
36
- * onSuccess={(result) => {
37
- * router.push(`/library/${result.kind === "Agent" ? "agents" : "mcp-servers"}`);
38
- * }}
39
- * />
40
- * ```
41
- */
42
- export declare function ImportResourceDialog({ open, onOpenChange, org, onSuccess, }: ImportResourceDialogProps): import("react/jsx-runtime").JSX.Element;
43
- //# sourceMappingURL=ImportResourceDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportResourceDialog.d.ts","sourceRoot":"","sources":["../../src/library/ImportResourceDialog.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAMjE,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,kEAAkE;IAClE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC5D;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,SAAS,GACV,EAAE,yBAAyB,2CAoK3B"}
@@ -1,90 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useRef } from "react";
4
- import { cn } from "@stigmer/theme";
5
- import { toast } from "../feedback/toast.js";
6
- import { useImportResource } from "./useImportResource.js";
7
- // ---------------------------------------------------------------------------
8
- // Component
9
- // ---------------------------------------------------------------------------
10
- /**
11
- * Modal dialog for importing a Stigmer resource from a YAML or JSON file.
12
- *
13
- * Workflow:
14
- * 1. User selects a `.yaml`, `.yml`, or `.json` file via the file picker
15
- * 2. The file is validated and a preview card shows the detected resource
16
- * 3. User confirms the import, which calls `apply()` on the target org
17
- * 4. On success: toast notification and `onSuccess` callback
18
- * 5. On error: inline error message with guidance
19
- *
20
- * Uses the native `<dialog>` element for built-in focus trapping, Escape
21
- * key handling, and backdrop — consistent with {@link ConfirmDialog}.
22
- *
23
- * Zero Console dependencies — safe for platform builder embedding.
24
- *
25
- * @example
26
- * ```tsx
27
- * const [open, setOpen] = useState(false);
28
- *
29
- * <ImportResourceDialog
30
- * open={open}
31
- * onOpenChange={setOpen}
32
- * org={activeOrg}
33
- * onSuccess={(result) => {
34
- * router.push(`/library/${result.kind === "Agent" ? "agents" : "mcp-servers"}`);
35
- * }}
36
- * />
37
- * ```
38
- */
39
- export function ImportResourceDialog({ open, onOpenChange, org, onSuccess, }) {
40
- const dialogRef = useRef(null);
41
- const fileInputRef = useRef(null);
42
- const { readFile, preview, error, reset, apply, isApplying } = useImportResource();
43
- // Sync dialog open state with the native <dialog> element.
44
- useEffect(() => {
45
- const dialog = dialogRef.current;
46
- if (!dialog)
47
- return;
48
- if (open && !dialog.open) {
49
- dialog.showModal();
50
- }
51
- else if (!open && dialog.open) {
52
- dialog.close();
53
- }
54
- }, [open]);
55
- // Reset state when the dialog opens.
56
- useEffect(() => {
57
- if (open) {
58
- reset();
59
- if (fileInputRef.current) {
60
- fileInputRef.current.value = "";
61
- }
62
- }
63
- }, [open, reset]);
64
- const handleCancel = useCallback((e) => {
65
- e.preventDefault();
66
- onOpenChange(false);
67
- }, [onOpenChange]);
68
- const handleClose = useCallback(() => {
69
- onOpenChange(false);
70
- }, [onOpenChange]);
71
- const handleFileChange = useCallback((e) => {
72
- const file = e.target.files?.[0];
73
- if (file) {
74
- readFile(file);
75
- }
76
- }, [readFile]);
77
- const handleConfirm = useCallback(async () => {
78
- try {
79
- const result = await apply(org);
80
- toast.success(`${result.kind === "Agent" ? "Agent" : "MCP Server"} "${result.name}" imported successfully`);
81
- onOpenChange(false);
82
- onSuccess?.(result);
83
- }
84
- catch {
85
- // error is set by the hook
86
- }
87
- }, [apply, org, onOpenChange, onSuccess]);
88
- return (_jsx("dialog", { ref: dialogRef, onCancel: handleCancel, className: cn("fixed inset-0 z-50 m-auto w-full max-w-md 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-5 p-6", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h3", { className: "text-base font-semibold text-foreground", children: "Import resource" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Select a YAML or JSON file containing a Stigmer Agent or MCP Server definition." })] }), _jsx("div", { children: _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 resource file" }) }), error && (_jsx("div", { role: "alert", className: "rounded-md border border-destructive bg-card px-3 py-2.5 text-sm text-destructive", children: error })), preview && !error && (_jsxs("div", { className: "rounded-md border border-border bg-card px-4 py-3", 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: preview.kind === "Agent" ? "Agent" : "MCP Server" }), _jsx("span", { className: "inline-flex rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground uppercase", children: preview.format })] }), _jsx("p", { className: "mt-1.5 text-sm font-medium text-foreground", children: preview.name }), preview.slug && preview.slug !== preview.name && (_jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: preview.slug })), _jsxs("p", { className: "mt-1.5 text-xs text-muted-foreground", children: ["Will be applied to ", _jsx("span", { className: "font-medium text-foreground", children: org })] })] })), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx("button", { type: "button", onClick: handleClose, disabled: 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: handleConfirm, disabled: !preview || !!error || isApplying, 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: isApplying ? "Importing\u2026" : "Import" })] })] }) }));
89
- }
90
- //# sourceMappingURL=ImportResourceDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportResourceDialog.js","sourceRoot":"","sources":["../../src/library/ImportResourceDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAmB3D,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,SAAS,GACiB;IAC1B,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IACpD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAEnF,2DAA2D;IAC3D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACzB,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,CAAC;aAAM,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,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C,IAAI,KAAK,OAAO,CAAC,IAAI,IAAI,CAChD,YAAG,SAAS,EAAC,sCAAsC,YAChD,OAAO,CAAC,IAAI,GACX,CACL,EACD,aAAG,SAAS,EAAC,sCAAsC,oCAC9B,eAAM,SAAS,EAAC,6BAA6B,YAAE,GAAG,GAAQ,IAC3E,IACA,CACP,EAGD,eAAK,SAAS,EAAC,wBAAwB,aACrC,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,8DAA8D,EAC9D,mDAAmD,EACnD,8CAA8C,EAC9C,yEAAyE,EACzE,kDAAkD,CACnD,uBAGM,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,OAAO,IAAI,CAAC,CAAC,KAAK,IAAI,UAAU,EAC3C,SAAS,EAAE,EAAE,CACX,8DAA8D,EAC9D,2DAA2D,EAC3D,yEAAyE,EACzE,kDAAkD,CACnD,YAEA,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,GACnC,IACL,IACF,GACC,CACV,CAAC;AACJ,CAAC"}
@@ -1,63 +0,0 @@
1
- import type { AgentInput, McpServerInput } from "@stigmer/sdk";
2
- /**
3
- * Result of parsing a Stigmer resource YAML into an SDK input type.
4
- *
5
- * Discriminated on `kind` so consumers can narrow to the specific input:
6
- *
7
- * ```ts
8
- * const parsed = parseResourceYaml(content, "my-org");
9
- * if (parsed.kind === "Agent") {
10
- * // parsed.input is AgentInput
11
- * }
12
- * ```
13
- */
14
- export type ParsedResource = {
15
- /** The parsed resource is an Agent blueprint. */
16
- readonly kind: "Agent";
17
- /** SDK input suitable for `stigmer.agent.apply()`. */
18
- readonly input: AgentInput;
19
- } | {
20
- /** The parsed resource is an MCP server definition. */
21
- readonly kind: "McpServer";
22
- /** SDK input suitable for `stigmer.mcpServer.apply()`. */
23
- readonly input: McpServerInput;
24
- };
25
- /**
26
- * Parses a Stigmer resource YAML string into the corresponding SDK input
27
- * type for use with `stigmer.agent.apply()` or `stigmer.mcpServer.apply()`.
28
- *
29
- * Handles the conversion from proto-style snake_case YAML field names to
30
- * the camelCase TypeScript SDK input types, including nested structures
31
- * like `mcp_server_usages`, `sub_agents`, and `env`.
32
- *
33
- * The `org` parameter **always overrides** `metadata.org` in the YAML.
34
- * This matches the UX intent of "Apply to [my-org]" — the user explicitly
35
- * chooses the target organization.
36
- *
37
- * **Throws** with descriptive, user-facing error messages when the YAML
38
- * is malformed or missing required fields. These messages are designed
39
- * for display in error UI components.
40
- *
41
- * @param content - Raw YAML content string (typically from {@link useArtifactContent}).
42
- * @param org - Target organization slug. Overrides `metadata.org` in the YAML.
43
- * @returns A discriminated union with the parsed SDK input.
44
- * @throws {Error} When the content is not valid YAML, not a recognized
45
- * Stigmer resource, or is missing required fields.
46
- *
47
- * @example
48
- * ```ts
49
- * import { parseResourceYaml } from "@stigmer/react";
50
- *
51
- * const parsed = parseResourceYaml(yamlContent, "my-org");
52
- * if (parsed.kind === "Agent") {
53
- * await stigmer.agent.apply(parsed.input);
54
- * } else {
55
- * await stigmer.mcpServer.apply(parsed.input);
56
- * }
57
- * ```
58
- *
59
- * @see {@link useApplyResource} for the React hook that wraps this function
60
- * @see {@link detectStigmerResource} for lightweight detection without full parsing
61
- */
62
- export declare function parseResourceYaml(content: string, org: string): ParsedResource;
63
- //# sourceMappingURL=parse-resource-yaml.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-resource-yaml.d.ts","sourceRoot":"","sources":["../../src/library/parse-resource-yaml.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EASf,MAAM,cAAc,CAAC;AAGtB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GACtB;IACE,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B,GACD;IACE,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CAChC,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,cAAc,CAyBhB"}