@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.
- package/agent/steps/ReviewStep.d.ts.map +1 -1
- package/agent/steps/ReviewStep.js +2 -3
- package/agent/steps/ReviewStep.js.map +1 -1
- package/billing/BaselineEditor.d.ts +9 -0
- package/billing/BaselineEditor.d.ts.map +1 -0
- package/billing/BaselineEditor.js +253 -0
- package/billing/BaselineEditor.js.map +1 -0
- package/billing/ModelCatalogPanel.d.ts +28 -0
- package/billing/ModelCatalogPanel.d.ts.map +1 -0
- package/billing/ModelCatalogPanel.js +102 -0
- package/billing/ModelCatalogPanel.js.map +1 -0
- package/billing/ModelGovernanceDetail.d.ts +8 -0
- package/billing/ModelGovernanceDetail.d.ts.map +1 -0
- package/billing/ModelGovernanceDetail.js +64 -0
- package/billing/ModelGovernanceDetail.js.map +1 -0
- package/billing/OperatorAccessNotice.d.ts +12 -0
- package/billing/OperatorAccessNotice.d.ts.map +1 -0
- package/billing/OperatorAccessNotice.js +15 -0
- package/billing/OperatorAccessNotice.js.map +1 -0
- package/billing/PricingGovernanceConsole.d.ts +57 -0
- package/billing/PricingGovernanceConsole.d.ts.map +1 -0
- package/billing/PricingGovernanceConsole.js +164 -0
- package/billing/PricingGovernanceConsole.js.map +1 -0
- package/billing/PricingGovernancePanel.d.ts +26 -0
- package/billing/PricingGovernancePanel.d.ts.map +1 -0
- package/billing/PricingGovernancePanel.js +64 -0
- package/billing/PricingGovernancePanel.js.map +1 -0
- package/billing/RetireConfirm.d.ts +9 -0
- package/billing/RetireConfirm.d.ts.map +1 -0
- package/billing/RetireConfirm.js +19 -0
- package/billing/RetireConfirm.js.map +1 -0
- package/billing/form-primitives.d.ts +18 -0
- package/billing/form-primitives.d.ts.map +1 -0
- package/billing/form-primitives.js +19 -0
- package/billing/form-primitives.js.map +1 -0
- package/billing/governance-primitives.d.ts +33 -0
- package/billing/governance-primitives.d.ts.map +1 -0
- package/billing/governance-primitives.js +43 -0
- package/billing/governance-primitives.js.map +1 -0
- package/billing/index.d.ts +18 -0
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +9 -0
- package/billing/index.js.map +1 -1
- package/billing/pricing-format.d.ts +12 -0
- package/billing/pricing-format.d.ts.map +1 -0
- package/billing/pricing-format.js +50 -0
- package/billing/pricing-format.js.map +1 -0
- package/billing/useDecidePricingOverride.d.ts +46 -0
- package/billing/useDecidePricingOverride.d.ts.map +1 -0
- package/billing/useDecidePricingOverride.js +44 -0
- package/billing/useDecidePricingOverride.js.map +1 -0
- package/billing/useModelGovernanceView.d.ts +103 -0
- package/billing/useModelGovernanceView.d.ts.map +1 -0
- package/billing/useModelGovernanceView.js +144 -0
- package/billing/useModelGovernanceView.js.map +1 -0
- package/billing/useModelPricingBaselines.d.ts +40 -0
- package/billing/useModelPricingBaselines.d.ts.map +1 -0
- package/billing/useModelPricingBaselines.js +32 -0
- package/billing/useModelPricingBaselines.js.map +1 -0
- package/billing/usePricingGovernance.d.ts +39 -0
- package/billing/usePricingGovernance.d.ts.map +1 -0
- package/billing/usePricingGovernance.js +31 -0
- package/billing/usePricingGovernance.js.map +1 -0
- package/billing/useRetireModelPricingBaseline.d.ts +31 -0
- package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/billing/useRetireModelPricingBaseline.js +36 -0
- package/billing/useRetireModelPricingBaseline.js.map +1 -0
- package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
- package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/billing/useUpsertModelPricingBaseline.js +37 -0
- package/billing/useUpsertModelPricingBaseline.js.map +1 -0
- package/channel/AgentChannelsPanel.d.ts.map +1 -1
- package/channel/AgentChannelsPanel.js +11 -5
- package/channel/AgentChannelsPanel.js.map +1 -1
- package/composer/SessionComposer.d.ts +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountEditor.js +51 -0
- package/cursor-accounts/CursorAccountEditor.js.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.js +275 -0
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +10 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-format.js +26 -0
- package/cursor-accounts/cursor-account-format.js.map +1 -0
- package/cursor-accounts/index.d.ts +18 -0
- package/cursor-accounts/index.d.ts.map +1 -0
- package/cursor-accounts/index.js +13 -0
- package/cursor-accounts/index.js.map +1 -0
- package/cursor-accounts/useCursorAccountView.d.ts +30 -0
- package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccountView.js +25 -0
- package/cursor-accounts/useCursorAccountView.js.map +1 -0
- package/cursor-accounts/useCursorAccounts.d.ts +33 -0
- package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccounts.js +25 -0
- package/cursor-accounts/useCursorAccounts.js.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
- package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.js +32 -0
- package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.js +31 -0
- package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.js +34 -0
- package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
- package/datastore/CollectionRecordsBrowser.d.ts +34 -0
- package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
- package/datastore/CollectionRecordsBrowser.js +209 -0
- package/datastore/CollectionRecordsBrowser.js.map +1 -0
- package/datastore/CollectionSchemaView.d.ts +29 -0
- package/datastore/CollectionSchemaView.d.ts.map +1 -0
- package/datastore/CollectionSchemaView.js +93 -0
- package/datastore/CollectionSchemaView.js.map +1 -0
- package/datastore/DatastoreDetailView.d.ts +44 -0
- package/datastore/DatastoreDetailView.d.ts.map +1 -0
- package/datastore/DatastoreDetailView.js +76 -0
- package/datastore/DatastoreDetailView.js.map +1 -0
- package/datastore/DatastoreSyncReport.d.ts +19 -0
- package/datastore/DatastoreSyncReport.d.ts.map +1 -0
- package/datastore/DatastoreSyncReport.js +45 -0
- package/datastore/DatastoreSyncReport.js.map +1 -0
- package/datastore/DeleteDatastoreDialog.d.ts +35 -0
- package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
- package/datastore/DeleteDatastoreDialog.js +90 -0
- package/datastore/DeleteDatastoreDialog.js.map +1 -0
- package/datastore/FieldValueControl.d.ts +55 -0
- package/datastore/FieldValueControl.d.ts.map +1 -0
- package/datastore/FieldValueControl.js +138 -0
- package/datastore/FieldValueControl.js.map +1 -0
- package/datastore/RecordFilterBuilder.d.ts +30 -0
- package/datastore/RecordFilterBuilder.d.ts.map +1 -0
- package/datastore/RecordFilterBuilder.js +122 -0
- package/datastore/RecordFilterBuilder.js.map +1 -0
- package/datastore/RecordFormPanel.d.ts +45 -0
- package/datastore/RecordFormPanel.d.ts.map +1 -0
- package/datastore/RecordFormPanel.js +215 -0
- package/datastore/RecordFormPanel.js.map +1 -0
- package/datastore/index.d.ts +43 -0
- package/datastore/index.d.ts.map +1 -0
- package/datastore/index.js +22 -0
- package/datastore/index.js.map +1 -0
- package/datastore/recordFilter.d.ts +54 -0
- package/datastore/recordFilter.d.ts.map +1 -0
- package/datastore/recordFilter.js +93 -0
- package/datastore/recordFilter.js.map +1 -0
- package/datastore/recordValues.d.ts +85 -0
- package/datastore/recordValues.d.ts.map +1 -0
- package/datastore/recordValues.js +282 -0
- package/datastore/recordValues.js.map +1 -0
- package/datastore/useDatastore.d.ts +39 -0
- package/datastore/useDatastore.d.ts.map +1 -0
- package/datastore/useDatastore.js +44 -0
- package/datastore/useDatastore.js.map +1 -0
- package/datastore/useDatastoreCount.d.ts +48 -0
- package/datastore/useDatastoreCount.d.ts.map +1 -0
- package/datastore/useDatastoreCount.js +27 -0
- package/datastore/useDatastoreCount.js.map +1 -0
- package/datastore/useDatastoreDescription.d.ts +54 -0
- package/datastore/useDatastoreDescription.d.ts.map +1 -0
- package/datastore/useDatastoreDescription.js +50 -0
- package/datastore/useDatastoreDescription.js.map +1 -0
- package/datastore/useDatastoreList.d.ts +57 -0
- package/datastore/useDatastoreList.d.ts.map +1 -0
- package/datastore/useDatastoreList.js +29 -0
- package/datastore/useDatastoreList.js.map +1 -0
- package/datastore/useDatastoreSearch.d.ts +19 -0
- package/datastore/useDatastoreSearch.d.ts.map +1 -0
- package/datastore/useDatastoreSearch.js +22 -0
- package/datastore/useDatastoreSearch.js.map +1 -0
- package/datastore/useDeleteDatastore.d.ts +53 -0
- package/datastore/useDeleteDatastore.d.ts.map +1 -0
- package/datastore/useDeleteDatastore.js +40 -0
- package/datastore/useDeleteDatastore.js.map +1 -0
- package/datastore/useDeleteRecord.d.ts +34 -0
- package/datastore/useDeleteRecord.d.ts.map +1 -0
- package/datastore/useDeleteRecord.js +43 -0
- package/datastore/useDeleteRecord.js.map +1 -0
- package/datastore/useInsertRecord.d.ts +50 -0
- package/datastore/useInsertRecord.d.ts.map +1 -0
- package/datastore/useInsertRecord.js +55 -0
- package/datastore/useInsertRecord.js.map +1 -0
- package/datastore/useRecordCollection.d.ts +104 -0
- package/datastore/useRecordCollection.d.ts.map +1 -0
- package/datastore/useRecordCollection.js +136 -0
- package/datastore/useRecordCollection.js.map +1 -0
- package/datastore/useRecordList.d.ts +66 -0
- package/datastore/useRecordList.d.ts.map +1 -0
- package/datastore/useRecordList.js +58 -0
- package/datastore/useRecordList.js.map +1 -0
- package/datastore/useUpdateRecord.d.ts +52 -0
- package/datastore/useUpdateRecord.d.ts.map +1 -0
- package/datastore/useUpdateRecord.js +55 -0
- package/datastore/useUpdateRecord.js.map +1 -0
- package/environment/EnvironmentListPanel.d.ts.map +1 -1
- package/environment/EnvironmentListPanel.js +12 -7
- package/environment/EnvironmentListPanel.js.map +1 -1
- package/iam-policy/index.d.ts +1 -1
- package/iam-policy/index.d.ts.map +1 -1
- package/iam-policy/index.js.map +1 -1
- package/iam-policy/useCheckPermission.d.ts +32 -11
- package/iam-policy/useCheckPermission.d.ts.map +1 -1
- package/iam-policy/useCheckPermission.js +24 -19
- package/iam-policy/useCheckPermission.js.map +1 -1
- package/index.d.ts +12 -6
- package/index.d.ts.map +1 -1
- package/index.js +14 -3
- package/index.js.map +1 -1
- package/library/index.d.ts +0 -7
- package/library/index.d.ts.map +1 -1
- package/library/index.js +0 -4
- package/library/index.js.map +1 -1
- package/library/useApplyResource.d.ts +12 -12
- package/library/useApplyResource.d.ts.map +1 -1
- package/library/useApplyResource.js +16 -25
- package/library/useApplyResource.js.map +1 -1
- package/library/useExportResource.d.ts +13 -9
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +18 -36
- package/library/useExportResource.js.map +1 -1
- package/manifest/ApplyManifestDialog.d.ts +48 -0
- package/manifest/ApplyManifestDialog.d.ts.map +1 -0
- package/manifest/ApplyManifestDialog.js +135 -0
- package/manifest/ApplyManifestDialog.js.map +1 -0
- package/manifest/EditResourceYamlDialog.d.ts +51 -0
- package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
- package/manifest/EditResourceYamlDialog.js +104 -0
- package/manifest/EditResourceYamlDialog.js.map +1 -0
- package/manifest/RedactedSecretsNotice.d.ts +14 -0
- package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
- package/manifest/RedactedSecretsNotice.js +14 -0
- package/manifest/RedactedSecretsNotice.js.map +1 -0
- package/manifest/YamlEditor.d.ts +44 -0
- package/manifest/YamlEditor.d.ts.map +1 -0
- package/manifest/YamlEditor.js +216 -0
- package/manifest/YamlEditor.js.map +1 -0
- package/manifest/index.d.ts +13 -0
- package/manifest/index.d.ts.map +1 -0
- package/manifest/index.js +13 -0
- package/manifest/index.js.map +1 -0
- package/manifest/useApplyManifest.d.ts +82 -0
- package/manifest/useApplyManifest.d.ts.map +1 -0
- package/manifest/useApplyManifest.js +180 -0
- package/manifest/useApplyManifest.js.map +1 -0
- package/manifest/useEditResourceYaml.d.ts +106 -0
- package/manifest/useEditResourceYaml.d.ts.map +1 -0
- package/manifest/useEditResourceYaml.js +168 -0
- package/manifest/useEditResourceYaml.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
- package/mcp-server/steps/ReviewStep.js +2 -3
- package/mcp-server/steps/ReviewStep.js.map +1 -1
- package/package.json +4 -4
- package/resource-creation/templates/workflow-templates.js +4 -4
- package/session/useEditSessionPrep.js +3 -3
- package/session/useEditSessionPrep.js.map +1 -1
- package/settings/index.d.ts +2 -1
- package/settings/index.d.ts.map +1 -1
- package/settings/index.js +2 -1
- package/settings/index.js.map +1 -1
- package/settings/settings-nav.d.ts +22 -0
- package/settings/settings-nav.d.ts.map +1 -1
- package/settings/settings-nav.js +32 -1
- package/settings/settings-nav.js.map +1 -1
- package/settings/useSettingsNavGroups.d.ts +29 -0
- package/settings/useSettingsNavGroups.d.ts.map +1 -0
- package/settings/useSettingsNavGroups.js +61 -0
- package/settings/useSettingsNavGroups.js.map +1 -0
- package/src/agent/steps/ReviewStep.tsx +2 -3
- package/src/billing/BaselineEditor.tsx +619 -0
- package/src/billing/ModelCatalogPanel.tsx +283 -0
- package/src/billing/ModelGovernanceDetail.tsx +289 -0
- package/src/billing/OperatorAccessNotice.tsx +32 -0
- package/src/billing/PricingGovernanceConsole.tsx +465 -0
- package/src/billing/PricingGovernancePanel.tsx +166 -0
- package/src/billing/RetireConfirm.tsx +82 -0
- package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
- package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
- package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
- package/src/billing/form-primitives.tsx +68 -0
- package/src/billing/governance-primitives.tsx +133 -0
- package/src/billing/index.ts +37 -0
- package/src/billing/pricing-format.ts +53 -0
- package/src/billing/useDecidePricingOverride.ts +78 -0
- package/src/billing/useModelGovernanceView.ts +290 -0
- package/src/billing/useModelPricingBaselines.ts +69 -0
- package/src/billing/usePricingGovernance.ts +57 -0
- package/src/billing/useRetireModelPricingBaseline.ts +65 -0
- package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
- package/src/channel/AgentChannelsPanel.tsx +27 -1
- package/src/composer/SessionComposer.tsx +1 -1
- package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
- package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
- package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
- package/src/cursor-accounts/cursor-account-format.ts +29 -0
- package/src/cursor-accounts/index.ts +29 -0
- package/src/cursor-accounts/useCursorAccountView.ts +49 -0
- package/src/cursor-accounts/useCursorAccounts.ts +49 -0
- package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
- package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
- package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
- package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
- package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
- package/src/datastore/CollectionSchemaView.tsx +247 -0
- package/src/datastore/DatastoreDetailView.tsx +201 -0
- package/src/datastore/DatastoreSyncReport.tsx +105 -0
- package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
- package/src/datastore/FieldValueControl.tsx +289 -0
- package/src/datastore/RecordFilterBuilder.tsx +411 -0
- package/src/datastore/RecordFormPanel.tsx +432 -0
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
- package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
- package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
- package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
- package/src/datastore/__tests__/recordFilter.test.ts +156 -0
- package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
- package/src/datastore/__tests__/recordValues.test.ts +359 -0
- package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
- package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
- package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
- package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
- package/src/datastore/index.ts +111 -0
- package/src/datastore/recordFilter.ts +140 -0
- package/src/datastore/recordValues.ts +327 -0
- package/src/datastore/useDatastore.ts +67 -0
- package/src/datastore/useDatastoreCount.ts +67 -0
- package/src/datastore/useDatastoreDescription.ts +90 -0
- package/src/datastore/useDatastoreList.ts +79 -0
- package/src/datastore/useDatastoreSearch.ts +39 -0
- package/src/datastore/useDeleteDatastore.ts +87 -0
- package/src/datastore/useDeleteRecord.ts +77 -0
- package/src/datastore/useInsertRecord.ts +92 -0
- package/src/datastore/useRecordCollection.ts +256 -0
- package/src/datastore/useRecordList.ts +131 -0
- package/src/datastore/useUpdateRecord.ts +95 -0
- package/src/environment/EnvironmentListPanel.tsx +24 -0
- package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
- package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
- package/src/iam-policy/index.ts +1 -0
- package/src/iam-policy/useCheckPermission.ts +45 -19
- package/src/index.ts +163 -13
- package/src/library/index.ts +0 -20
- package/src/library/useApplyResource.ts +27 -34
- package/src/library/useExportResource.ts +21 -40
- package/src/manifest/ApplyManifestDialog.tsx +315 -0
- package/src/manifest/EditResourceYamlDialog.tsx +265 -0
- package/src/manifest/RedactedSecretsNotice.tsx +30 -0
- package/src/manifest/YamlEditor.tsx +272 -0
- package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
- package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
- package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
- package/src/manifest/index.ts +33 -0
- package/src/manifest/useApplyManifest.ts +270 -0
- package/src/manifest/useEditResourceYaml.ts +273 -0
- package/src/mcp-server/steps/ReviewStep.tsx +2 -3
- package/src/resource-creation/templates/workflow-templates.ts +4 -4
- package/src/session/useEditSessionPrep.ts +3 -3
- package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
- package/src/settings/index.ts +5 -1
- package/src/settings/settings-nav.ts +43 -0
- package/src/settings/useSettingsNavGroups.ts +81 -0
- package/src/workflow/WorkflowYamlEditor.tsx +6 -270
- package/styles.css +1 -1
- package/workflow/CanvasTransitionEdge.d.ts +1 -1
- package/workflow/WorkflowYamlEditor.d.ts +2 -42
- package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
- package/workflow/WorkflowYamlEditor.js +5 -214
- package/workflow/WorkflowYamlEditor.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +0 -43
- package/library/ImportResourceDialog.d.ts.map +0 -1
- package/library/ImportResourceDialog.js +0 -90
- package/library/ImportResourceDialog.js.map +0 -1
- package/library/parse-resource-yaml.d.ts +0 -63
- package/library/parse-resource-yaml.d.ts.map +0 -1
- package/library/parse-resource-yaml.js +0 -407
- package/library/parse-resource-yaml.js.map +0 -1
- package/library/serialize-resource-yaml.d.ts +0 -103
- package/library/serialize-resource-yaml.d.ts.map +0 -1
- package/library/serialize-resource-yaml.js +0 -565
- package/library/serialize-resource-yaml.js.map +0 -1
- package/library/useImportResource.d.ts +0 -84
- package/library/useImportResource.d.ts.map +0 -1
- package/library/useImportResource.js +0 -188
- package/library/useImportResource.js.map +0 -1
- package/src/library/ImportResourceDialog.tsx +0 -227
- package/src/library/parse-resource-yaml.ts +0 -630
- package/src/library/serialize-resource-yaml.ts +0 -756
- package/src/library/useImportResource.ts +0 -253
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditResourceYamlDialog.d.ts","sourceRoot":"","sources":["../../src/manifest/EditResourceYamlDialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAUpE,gDAAgD;AAChD,MAAM,WAAW,2BAA2B;IAC1C,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,EAAE,2BAA2B,2CA0K7B"}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
import { toast } from "../feedback/toast.js";
|
|
7
|
+
import { RedactedSecretsNotice } from "./RedactedSecretsNotice.js";
|
|
8
|
+
import { useEditResourceYaml } from "./useEditResourceYaml.js";
|
|
9
|
+
// CodeMirror loads only when an editor dialog actually opens (DD-013).
|
|
10
|
+
const LazyYamlEditor = lazy(() => import("./YamlEditor.js").then((m) => ({ default: m.YamlEditor })));
|
|
11
|
+
/**
|
|
12
|
+
* Modal dialog for editing a resource as YAML and applying the changes —
|
|
13
|
+
* the kind-agnostic "Edit YAML" experience for detail pages and panels.
|
|
14
|
+
*
|
|
15
|
+
* Workflow:
|
|
16
|
+
* 1. The resource is serialized to canonical YAML (system-managed state
|
|
17
|
+
* stripped) and seeded into a CodeMirror editor
|
|
18
|
+
* 2. Every edit is validated against the kind's generated proto schema;
|
|
19
|
+
* errors render inline with the exact schema complaint
|
|
20
|
+
* 3. A live summary states what applying will do ("update X" / "create Y"),
|
|
21
|
+
* resolved against server state — so a rename reads as a create
|
|
22
|
+
* 4. Apply calls the kind's `apply` RPC (create-or-update by slug)
|
|
23
|
+
*
|
|
24
|
+
* Redacted secret values (`***REDACTED***`) are explained inline: applying
|
|
25
|
+
* them preserves the stored secrets (the server's marker contract).
|
|
26
|
+
*
|
|
27
|
+
* Uses the native `<dialog>` element for built-in focus trapping, Escape
|
|
28
|
+
* key handling, and backdrop — consistent with {@link ConfirmDialog}.
|
|
29
|
+
*
|
|
30
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const { agent, refetch } = useAgent(org, slug);
|
|
35
|
+
*
|
|
36
|
+
* <EditResourceYamlDialog
|
|
37
|
+
* open={editOpen}
|
|
38
|
+
* onOpenChange={setEditOpen}
|
|
39
|
+
* resource={agent}
|
|
40
|
+
* onApplied={() => refetch()}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function EditResourceYamlDialog({ open, onOpenChange, resource, onApplied, }) {
|
|
45
|
+
const dialogRef = useRef(null);
|
|
46
|
+
const edit = useEditResourceYaml({ resource });
|
|
47
|
+
const { reset } = edit;
|
|
48
|
+
// Sync dialog open state with the native <dialog> element.
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const dialog = dialogRef.current;
|
|
51
|
+
if (!dialog)
|
|
52
|
+
return;
|
|
53
|
+
if (open && !dialog.open) {
|
|
54
|
+
dialog.showModal();
|
|
55
|
+
}
|
|
56
|
+
else if (!open && dialog.open) {
|
|
57
|
+
dialog.close();
|
|
58
|
+
}
|
|
59
|
+
}, [open]);
|
|
60
|
+
// Discard stale edits from a previous session when the dialog opens.
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (open)
|
|
63
|
+
reset();
|
|
64
|
+
}, [open, reset]);
|
|
65
|
+
const handleCancel = useCallback((e) => {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
onOpenChange(false);
|
|
68
|
+
}, [onOpenChange]);
|
|
69
|
+
const handleApply = useCallback(async () => {
|
|
70
|
+
try {
|
|
71
|
+
const result = await edit.apply();
|
|
72
|
+
if (!result)
|
|
73
|
+
return;
|
|
74
|
+
toast.success(`${result.displayName} "${result.name}" applied`);
|
|
75
|
+
onOpenChange(false);
|
|
76
|
+
onApplied?.(result);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// error state is set by the hook and rendered inline
|
|
80
|
+
}
|
|
81
|
+
}, [edit, onOpenChange, onApplied]);
|
|
82
|
+
const canApply = edit.validation.status === "valid" && edit.isDirty && !edit.isApplying;
|
|
83
|
+
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: "Edit YAML" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Edit the resource definition and apply. Changes are validated against the resource schema as you type." })] }), resource ? (_jsx(Suspense, { fallback: _jsx(EditorLoading, {}), children: _jsx(LazyYamlEditor, { value: edit.yaml, onChange: edit.setYaml, className: "h-80" }) })) : (_jsx(EditorLoading, { label: "Loading resource\u2026" })), edit.hasRedactedSecrets && _jsx(RedactedSecretsNotice, {}), edit.validation.status === "invalid" && (_jsx("div", { role: "alert", className: "rounded-md border border-destructive bg-card px-3 py-2.5 text-sm text-destructive", children: edit.validation.message })), edit.error && (_jsxs("div", { role: "alert", className: "flex items-start gap-3 rounded-md border border-destructive bg-card px-3 py-2.5", children: [_jsx("p", { className: "flex-1 text-sm text-destructive", children: getUserMessage(edit.error) }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx("button", { type: "button", onClick: handleApply, disabled: edit.validation.status !== "valid" || edit.isApplying, className: cn("rounded-md border border-input bg-background px-2 py-1 text-xs font-medium text-foreground", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: "Try again" }), _jsx("button", { type: "button", onClick: edit.clearError, "aria-label": "Dismiss error", className: cn("rounded-md px-2 py-1 text-xs font-medium text-muted-foreground", "hover:bg-accent hover:text-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"), children: "Dismiss" })] })] })), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-xs text-muted-foreground", "aria-live": "polite", children: targetSummary(edit.validation.status, edit.isDirty, edit.target) }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", onClick: () => onOpenChange(false), disabled: edit.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: edit.isApplying ? "Applying…" : "Apply changes" })] })] })] }) }));
|
|
84
|
+
}
|
|
85
|
+
function targetSummary(validationStatus, isDirty, target) {
|
|
86
|
+
if (validationStatus !== "valid")
|
|
87
|
+
return "";
|
|
88
|
+
if (!isDirty)
|
|
89
|
+
return "No changes yet.";
|
|
90
|
+
if (target === null)
|
|
91
|
+
return "Checking what applying will do…";
|
|
92
|
+
switch (target.action) {
|
|
93
|
+
case "update":
|
|
94
|
+
return `Applying will update ${target.slug}.`;
|
|
95
|
+
case "create":
|
|
96
|
+
return `Applying will create ${target.slug} — the name or slug changed.`;
|
|
97
|
+
case "unknown":
|
|
98
|
+
return `Applying will create or update ${target.slug}.`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function EditorLoading({ label = "Loading editor…" }) {
|
|
102
|
+
return (_jsx("div", { className: "flex h-80 items-center justify-center rounded-md border border-border bg-muted text-sm text-muted-foreground", children: label }));
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=EditResourceYamlDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditResourceYamlDialog.js","sourceRoot":"","sources":["../../src/manifest/EditResourceYamlDialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EA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C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Props for {@link RedactedSecretsNotice}. */
|
|
2
|
+
export interface RedactedSecretsNoticeProps {
|
|
3
|
+
/** Additional CSS classes for the root container. */
|
|
4
|
+
readonly className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Inline explanation shown when manifest content contains `***REDACTED***`
|
|
8
|
+
* secret markers, so the marker reads as a contract rather than a bug:
|
|
9
|
+
* applying it preserves the stored secret; replacing it sets a new value.
|
|
10
|
+
*
|
|
11
|
+
* Shared by {@link EditResourceYamlDialog} and {@link ApplyManifestDialog}.
|
|
12
|
+
*/
|
|
13
|
+
export declare function RedactedSecretsNotice({ className }: RedactedSecretsNoticeProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=RedactedSecretsNotice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedactedSecretsNotice.d.ts","sourceRoot":"","sources":["../../src/manifest/RedactedSecretsNotice.tsx"],"names":[],"mappings":"AAIA,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,EAAE,EAAE,0BAA0B,2CAY9E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
/**
|
|
5
|
+
* Inline explanation shown when manifest content contains `***REDACTED***`
|
|
6
|
+
* secret markers, so the marker reads as a contract rather than a bug:
|
|
7
|
+
* applying it preserves the stored secret; replacing it sets a new value.
|
|
8
|
+
*
|
|
9
|
+
* Shared by {@link EditResourceYamlDialog} and {@link ApplyManifestDialog}.
|
|
10
|
+
*/
|
|
11
|
+
export function RedactedSecretsNotice({ className }) {
|
|
12
|
+
return (_jsxs("p", { className: cn("rounded-md border border-border bg-muted px-3 py-2 text-xs text-muted-foreground", className), children: ["Secret values are shown as ", _jsx("code", { className: "font-mono", children: "***REDACTED***" }), ". Applying keeps the stored secrets; replace a marker to set a new value."] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=RedactedSecretsNotice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedactedSecretsNotice.js","sourceRoot":"","sources":["../../src/manifest/RedactedSecretsNotice.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAQpC;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAE,SAAS,EAA8B;IAC7E,OAAO,CACL,aACE,SAAS,EAAE,EAAE,CACX,kFAAkF,EAClF,SAAS,CACV,4CAE0B,eAAM,SAAS,EAAC,WAAW,+BAAsB,iFAE1E,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import { type Diagnostic } from "@codemirror/lint";
|
|
3
|
+
/** Props for {@link YamlEditor}. */
|
|
4
|
+
export interface YamlEditorProps {
|
|
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
|
+
* YAML editor built on CodeMirror 6, shared by every YAML surface in the
|
|
20
|
+
* SDK (workflow editor tab, resource manifest dialogs).
|
|
21
|
+
*
|
|
22
|
+
* Provides syntax highlighting, line numbers, bracket matching,
|
|
23
|
+
* code folding, undo/redo, and inline diagnostic markers driven by
|
|
24
|
+
* external validation (via the `diagnostics` prop).
|
|
25
|
+
*
|
|
26
|
+
* Themed via `--stgm-*` CSS custom properties to respect the host
|
|
27
|
+
* application's design tokens.
|
|
28
|
+
*
|
|
29
|
+
* This is an optional SDK component — it requires CodeMirror peer
|
|
30
|
+
* dependencies. Consumers that render it conditionally should load it
|
|
31
|
+
* via `React.lazy` so the CodeMirror bundle stays out of paths that
|
|
32
|
+
* never open an editor (DD-013).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <YamlEditor
|
|
37
|
+
* value={yaml}
|
|
38
|
+
* onChange={setYaml}
|
|
39
|
+
* diagnostics={diagnostics}
|
|
40
|
+
* />
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const YamlEditor: import("react").NamedExoticComponent<YamlEditorProps>;
|
|
44
|
+
//# sourceMappingURL=YamlEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YamlEditor.d.ts","sourceRoot":"","sources":["../../src/manifest/YamlEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAOf,OAAO,EAAc,KAAK,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAI/E,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,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;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,UAAU,uDAwHrB,CAAC"}
|
|
@@ -0,0 +1,216 @@
|
|
|
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
|
+
* YAML editor built on CodeMirror 6, shared by every YAML surface in the
|
|
15
|
+
* SDK (workflow editor tab, resource manifest dialogs).
|
|
16
|
+
*
|
|
17
|
+
* Provides syntax highlighting, line numbers, bracket matching,
|
|
18
|
+
* code folding, undo/redo, and inline diagnostic markers driven by
|
|
19
|
+
* external validation (via the `diagnostics` prop).
|
|
20
|
+
*
|
|
21
|
+
* Themed via `--stgm-*` CSS custom properties to respect the host
|
|
22
|
+
* application's design tokens.
|
|
23
|
+
*
|
|
24
|
+
* This is an optional SDK component — it requires CodeMirror peer
|
|
25
|
+
* dependencies. Consumers that render it conditionally should load it
|
|
26
|
+
* via `React.lazy` so the CodeMirror bundle stays out of paths that
|
|
27
|
+
* never open an editor (DD-013).
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <YamlEditor
|
|
32
|
+
* value={yaml}
|
|
33
|
+
* onChange={setYaml}
|
|
34
|
+
* diagnostics={diagnostics}
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export const YamlEditor = memo(function YamlEditor({ value, onChange, diagnostics, readOnly = false, className, style, }) {
|
|
39
|
+
const containerRef = useRef(null);
|
|
40
|
+
const viewRef = useRef(null);
|
|
41
|
+
const readOnlyCompartment = useRef(new Compartment());
|
|
42
|
+
const onChangeRef = useRef(onChange);
|
|
43
|
+
onChangeRef.current = onChange;
|
|
44
|
+
const isInternalUpdate = useRef(false);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!containerRef.current)
|
|
47
|
+
return;
|
|
48
|
+
const updateListener = EditorView.updateListener.of((update) => {
|
|
49
|
+
if (update.docChanged) {
|
|
50
|
+
isInternalUpdate.current = true;
|
|
51
|
+
onChangeRef.current?.(update.state.doc.toString());
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const state = EditorState.create({
|
|
55
|
+
doc: value,
|
|
56
|
+
extensions: [
|
|
57
|
+
lineNumbers(),
|
|
58
|
+
highlightActiveLine(),
|
|
59
|
+
highlightSpecialChars(),
|
|
60
|
+
drawSelection(),
|
|
61
|
+
bracketMatching(),
|
|
62
|
+
indentOnInput(),
|
|
63
|
+
foldGutter(),
|
|
64
|
+
history(),
|
|
65
|
+
yaml(),
|
|
66
|
+
syntaxHighlighting(stigmerHighlightStyle, { fallback: true }),
|
|
67
|
+
autocompletion(),
|
|
68
|
+
lintGutter(),
|
|
69
|
+
keymap.of([...defaultKeymap, ...historyKeymap, indentWithTab]),
|
|
70
|
+
readOnlyCompartment.current.of(EditorState.readOnly.of(readOnly)),
|
|
71
|
+
stigmerTheme,
|
|
72
|
+
updateListener,
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
const view = new EditorView({
|
|
76
|
+
state,
|
|
77
|
+
parent: containerRef.current,
|
|
78
|
+
});
|
|
79
|
+
viewRef.current = view;
|
|
80
|
+
return () => {
|
|
81
|
+
view.destroy();
|
|
82
|
+
viewRef.current = null;
|
|
83
|
+
};
|
|
84
|
+
}, []);
|
|
85
|
+
// Sync external value changes into the editor
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const view = viewRef.current;
|
|
88
|
+
if (!view)
|
|
89
|
+
return;
|
|
90
|
+
if (isInternalUpdate.current) {
|
|
91
|
+
isInternalUpdate.current = false;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const currentDoc = view.state.doc.toString();
|
|
95
|
+
if (currentDoc !== value) {
|
|
96
|
+
view.dispatch({
|
|
97
|
+
changes: {
|
|
98
|
+
from: 0,
|
|
99
|
+
to: currentDoc.length,
|
|
100
|
+
insert: value,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}, [value]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const view = viewRef.current;
|
|
107
|
+
if (!view)
|
|
108
|
+
return;
|
|
109
|
+
view.dispatch({
|
|
110
|
+
effects: readOnlyCompartment.current.reconfigure(EditorState.readOnly.of(readOnly)),
|
|
111
|
+
});
|
|
112
|
+
}, [readOnly]);
|
|
113
|
+
// Sync diagnostics into CodeMirror's lint system
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
const view = viewRef.current;
|
|
116
|
+
if (!view)
|
|
117
|
+
return;
|
|
118
|
+
const cmDiags = diagnostics
|
|
119
|
+
? diagnostics.map((d) => ({
|
|
120
|
+
...d,
|
|
121
|
+
from: Math.min(d.from, view.state.doc.length),
|
|
122
|
+
to: Math.min(d.to, view.state.doc.length),
|
|
123
|
+
}))
|
|
124
|
+
: [];
|
|
125
|
+
view.dispatch(setDiagnostics(view.state, cmDiags));
|
|
126
|
+
}, [diagnostics]);
|
|
127
|
+
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 }));
|
|
128
|
+
});
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// Syntax highlighting: maps lezer tags to --stgm-syntax-* CSS variables
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
const stigmerHighlightStyle = HighlightStyle.define([
|
|
133
|
+
{ tag: tags.propertyName, color: "var(--stgm-syntax-property, #0550ae)" },
|
|
134
|
+
{ tag: tags.tagName, color: "var(--stgm-syntax-tag, #cf222e)" },
|
|
135
|
+
{ tag: tags.keyword, color: "var(--stgm-syntax-keyword, #8250df)", fontWeight: "bold" },
|
|
136
|
+
{ tag: tags.string, color: "var(--stgm-syntax-string, #0a3069)" },
|
|
137
|
+
{ tag: tags.number, color: "var(--stgm-syntax-number, #953800)" },
|
|
138
|
+
{ tag: [tags.bool, tags.null], color: "var(--stgm-syntax-bool, #8250df)" },
|
|
139
|
+
{ tag: tags.atom, color: "var(--stgm-syntax-atom, #cf222e)" },
|
|
140
|
+
{ tag: tags.comment, color: "var(--stgm-syntax-comment, #6e7781)", fontStyle: "italic" },
|
|
141
|
+
{ tag: tags.meta, color: "var(--stgm-syntax-meta, #8250df)" },
|
|
142
|
+
{ tag: tags.name, color: "var(--stgm-foreground, #1a1a2e)" },
|
|
143
|
+
{ tag: tags.definition(tags.name), color: "var(--stgm-syntax-property, #0550ae)" },
|
|
144
|
+
{ tag: tags.separator, color: "var(--stgm-muted-foreground, #737373)" },
|
|
145
|
+
{ tag: tags.punctuation, color: "var(--stgm-muted-foreground, #737373)" },
|
|
146
|
+
]);
|
|
147
|
+
// ---------------------------------------------------------------------------
|
|
148
|
+
// CodeMirror theme bridge: maps --stgm-* tokens to editor styles
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
const stigmerTheme = EditorView.theme({
|
|
151
|
+
"&": {
|
|
152
|
+
height: "100%",
|
|
153
|
+
backgroundColor: "var(--stgm-background, #fff)",
|
|
154
|
+
color: "var(--stgm-foreground, #1a1a2e)",
|
|
155
|
+
fontSize: "13px",
|
|
156
|
+
},
|
|
157
|
+
".cm-content": {
|
|
158
|
+
caretColor: "var(--stgm-foreground, #1a1a2e)",
|
|
159
|
+
fontFamily: "var(--stgm-font-mono, ui-monospace, monospace)",
|
|
160
|
+
padding: "8px 0",
|
|
161
|
+
},
|
|
162
|
+
".cm-cursor, .cm-dropCursor": {
|
|
163
|
+
borderLeftColor: "var(--stgm-foreground, #1a1a2e)",
|
|
164
|
+
},
|
|
165
|
+
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": {
|
|
166
|
+
backgroundColor: "var(--stgm-accent, #e0e7ff)",
|
|
167
|
+
},
|
|
168
|
+
".cm-gutters": {
|
|
169
|
+
backgroundColor: "var(--stgm-muted, #f5f5f5)",
|
|
170
|
+
color: "var(--stgm-muted-foreground, #737373)",
|
|
171
|
+
border: "none",
|
|
172
|
+
borderRight: "1px solid var(--stgm-border, #e5e5e5)",
|
|
173
|
+
},
|
|
174
|
+
".cm-activeLineGutter": {
|
|
175
|
+
backgroundColor: "var(--stgm-accent, #e0e7ff)",
|
|
176
|
+
},
|
|
177
|
+
".cm-activeLine": {
|
|
178
|
+
backgroundColor: "color-mix(in srgb, var(--stgm-accent, #e0e7ff) 30%, transparent)",
|
|
179
|
+
},
|
|
180
|
+
".cm-foldPlaceholder": {
|
|
181
|
+
backgroundColor: "var(--stgm-muted, #f5f5f5)",
|
|
182
|
+
border: "1px solid var(--stgm-border, #e5e5e5)",
|
|
183
|
+
color: "var(--stgm-muted-foreground, #737373)",
|
|
184
|
+
},
|
|
185
|
+
".cm-tooltip": {
|
|
186
|
+
backgroundColor: "var(--stgm-popover, #fff)",
|
|
187
|
+
color: "var(--stgm-popover-foreground, #1a1a2e)",
|
|
188
|
+
border: "1px solid var(--stgm-border, #e5e5e5)",
|
|
189
|
+
borderRadius: "6px",
|
|
190
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.08)",
|
|
191
|
+
},
|
|
192
|
+
".cm-tooltip-autocomplete": {
|
|
193
|
+
"& > ul > li[aria-selected]": {
|
|
194
|
+
backgroundColor: "var(--stgm-accent, #e0e7ff)",
|
|
195
|
+
color: "var(--stgm-accent-foreground, #1a1a2e)",
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
".cm-diagnostic-error": {
|
|
199
|
+
borderLeft: "3px solid var(--stgm-destructive, #ef4444)",
|
|
200
|
+
},
|
|
201
|
+
".cm-diagnostic-warning": {
|
|
202
|
+
borderLeft: "3px solid var(--stgm-warning, #f59e0b)",
|
|
203
|
+
},
|
|
204
|
+
".cm-diagnostic-info": {
|
|
205
|
+
borderLeft: "3px solid var(--stgm-primary, #6366f1)",
|
|
206
|
+
},
|
|
207
|
+
".cm-lint-marker-error": {
|
|
208
|
+
content: "'●'",
|
|
209
|
+
color: "var(--stgm-destructive, #ef4444)",
|
|
210
|
+
},
|
|
211
|
+
".cm-lint-marker-warning": {
|
|
212
|
+
content: "'●'",
|
|
213
|
+
color: "var(--stgm-warning, #f59e0b)",
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
//# sourceMappingURL=YamlEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YamlEditor.js","sourceRoot":"","sources":["../../src/manifest/YamlEditor.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,kBAAk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AE;YAC5B,eAAe,EAAE,6BAA6B;YAC9C,KAAK,EAAE,wCAAwC;SAChD;KACF;IACD,sBAAsB,EAAE;QACtB,UAAU,EAAE,4CAA4C;KACzD;IACD,wBAAwB,EAAE;QACxB,UAAU,EAAE,wCAAwC;KACrD;IACD,qBAAqB,EAAE;QACrB,UAAU,EAAE,wCAAwC;KACrD;IACD,uBAAuB,EAAE;QACvB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,kCAAkC;KAC1C;IACD,yBAAyB,EAAE;QACzB,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,8BAA8B;KACtC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { YamlEditor } from "./YamlEditor.js";
|
|
2
|
+
export type { YamlEditorProps } from "./YamlEditor.js";
|
|
3
|
+
export { useEditResourceYaml } from "./useEditResourceYaml.js";
|
|
4
|
+
export type { EditYamlTarget, EditYamlValidation, UseEditResourceYamlOptions, UseEditResourceYamlReturn, } from "./useEditResourceYaml.js";
|
|
5
|
+
export { useApplyManifest } from "./useApplyManifest.js";
|
|
6
|
+
export type { ManifestEntryStatus, ManifestPreviewEntry, UseApplyManifestReturn, } from "./useApplyManifest.js";
|
|
7
|
+
export { EditResourceYamlDialog } from "./EditResourceYamlDialog.js";
|
|
8
|
+
export type { EditResourceYamlDialogProps } from "./EditResourceYamlDialog.js";
|
|
9
|
+
export { ApplyManifestDialog } from "./ApplyManifestDialog.js";
|
|
10
|
+
export type { ApplyManifestDialogProps } from "./ApplyManifestDialog.js";
|
|
11
|
+
export { RedactedSecretsNotice } from "./RedactedSecretsNotice.js";
|
|
12
|
+
export type { RedactedSecretsNoticeProps } from "./RedactedSecretsNotice.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Manifest domain: the console-facing YAML edit/apply experience for every
|
|
2
|
+
// registry-supported resource kind, built on the @stigmer/sdk manifest
|
|
3
|
+
// engine (parseManifest / serializeManifest / stigmer.manifest).
|
|
4
|
+
//
|
|
5
|
+
// Headless-first (DD-003): the hooks are independently importable; the
|
|
6
|
+
// dialogs compose them with the shared YamlEditor.
|
|
7
|
+
export { YamlEditor } from "./YamlEditor.js";
|
|
8
|
+
export { useEditResourceYaml } from "./useEditResourceYaml.js";
|
|
9
|
+
export { useApplyManifest } from "./useApplyManifest.js";
|
|
10
|
+
export { EditResourceYamlDialog } from "./EditResourceYamlDialog.js";
|
|
11
|
+
export { ApplyManifestDialog } from "./ApplyManifestDialog.js";
|
|
12
|
+
export { RedactedSecretsNotice } from "./RedactedSecretsNotice.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,uEAAuE;AACvE,iEAAiE;AACjE,EAAE;AACF,uEAAuE;AACvE,mDAAmD;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAQ/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type AppliedManifest, type ManifestDocument } from "@stigmer/sdk";
|
|
2
|
+
/** Per-document apply lifecycle within one manifest. */
|
|
3
|
+
export type ManifestEntryStatus = "pending" | "applying" | "applied" | "failed"
|
|
4
|
+
/** A prior document failed; this one was not attempted. */
|
|
5
|
+
| "skipped";
|
|
6
|
+
/** One document of the manifest, with its preview and apply state. */
|
|
7
|
+
export interface ManifestPreviewEntry {
|
|
8
|
+
/** The parsed document (kind handler, message, name/slug/org). */
|
|
9
|
+
readonly document: ManifestDocument;
|
|
10
|
+
/** What applying will do, resolved against live server state. */
|
|
11
|
+
readonly action: "create" | "update" | "unknown";
|
|
12
|
+
/** Apply lifecycle status. */
|
|
13
|
+
readonly status: ManifestEntryStatus;
|
|
14
|
+
/** The applied resource, present when `status` is `"applied"`. */
|
|
15
|
+
readonly result?: AppliedManifest;
|
|
16
|
+
/** User-facing failure message, present when `status` is `"failed"`. */
|
|
17
|
+
readonly errorMessage?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Return value of {@link useApplyManifest}. */
|
|
20
|
+
export interface UseApplyManifestReturn {
|
|
21
|
+
/** Current manifest text (paste target). */
|
|
22
|
+
readonly content: string;
|
|
23
|
+
/** Update the manifest text. Re-validates (debounced). */
|
|
24
|
+
readonly setContent: (value: string) => void;
|
|
25
|
+
/** Read a `.yaml`/`.yml`/`.json` file into `content`. */
|
|
26
|
+
readonly readFile: (file: File) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Validated per-document preview in dependency apply order, or `null`
|
|
29
|
+
* while the content is empty or invalid.
|
|
30
|
+
*/
|
|
31
|
+
readonly entries: readonly ManifestPreviewEntry[] | null;
|
|
32
|
+
/** Validation error for the current content, or `null` when valid. */
|
|
33
|
+
readonly validationError: string | null;
|
|
34
|
+
/** `true` while the (debounced) validation + existence checks run. */
|
|
35
|
+
readonly isValidating: boolean;
|
|
36
|
+
/** `true` when the content contains `***REDACTED***` secret markers. */
|
|
37
|
+
readonly hasRedactedSecrets: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Apply all documents sequentially in dependency order. Entries update
|
|
40
|
+
* live. Stops at the first failure (later entries become `"skipped"`).
|
|
41
|
+
* Resolves `true` when every document applied.
|
|
42
|
+
*/
|
|
43
|
+
readonly applyAll: () => Promise<boolean>;
|
|
44
|
+
/** `true` while applies are in flight. */
|
|
45
|
+
readonly isApplying: boolean;
|
|
46
|
+
/** Clear all state (content, preview, errors). */
|
|
47
|
+
readonly reset: () => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Headless "apply a YAML manifest" flow for any registry-supported kind —
|
|
51
|
+
* the console counterpart of `stigmer apply -f`.
|
|
52
|
+
*
|
|
53
|
+
* Orchestrates: paste or upload → strict parse against generated proto
|
|
54
|
+
* schemas ({@link parseManifest}) → per-document create-vs-update preview
|
|
55
|
+
* (server existence check) → sequential apply in dependency order with
|
|
56
|
+
* live per-document status.
|
|
57
|
+
*
|
|
58
|
+
* Accepts multi-document manifests (`---` separators) and JSON content
|
|
59
|
+
* (YAML is a superset). The target `org` is injected into documents that
|
|
60
|
+
* omit `metadata.org`; documents naming a *different* org are honored and
|
|
61
|
+
* apply there (matching `stigmer apply` semantics — the org-mismatch
|
|
62
|
+
* warning surfaces on the parsed document).
|
|
63
|
+
*
|
|
64
|
+
* @param org - Target organization slug for `metadata.org` injection.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* const manifest = useApplyManifest(activeOrg);
|
|
69
|
+
*
|
|
70
|
+
* <textarea value={manifest.content}
|
|
71
|
+
* onChange={(e) => manifest.setContent(e.target.value)} />
|
|
72
|
+
* {manifest.entries?.map((e) => (
|
|
73
|
+
* <PreviewRow key={e.document.slug} entry={e} />
|
|
74
|
+
* ))}
|
|
75
|
+
* <button onClick={manifest.applyAll} disabled={!manifest.entries}>Apply</button>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @see {@link ApplyManifestDialog} for the styled component composing this hook
|
|
79
|
+
* @see {@link useEditResourceYaml} for the edit-in-place counterpart
|
|
80
|
+
*/
|
|
81
|
+
export declare function useApplyManifest(org: string): UseApplyManifestReturn;
|
|
82
|
+
//# sourceMappingURL=useApplyManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApplyManifest.d.ts","sourceRoot":"","sources":["../../src/manifest/useApplyManifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,cAAc,CAAC;AAItB,wDAAwD;AACxD,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ;AACV,2DAA2D;GACzD,SAAS,CAAC;AAEd,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjD,8BAA8B;IAC9B,QAAQ,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