@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,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { toJson } from "@bufbuild/protobuf";
|
|
5
|
+
import { ValueSchema } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { FieldType, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
7
|
+
import { Section } from "../resource-detail/Section.js";
|
|
8
|
+
import { formatFieldValue } from "./recordValues.js";
|
|
9
|
+
/**
|
|
10
|
+
* Structural view of a datastore's declared schema, rendered from the
|
|
11
|
+
* loaded resource spec: per-collection typed field tables, the declared
|
|
12
|
+
* constraints with their authored messages (the operator's own copy —
|
|
13
|
+
* the same bytes agents relay), and the authorization block summary
|
|
14
|
+
* (roles, bindings, `default_role` — operator-facing state the
|
|
15
|
+
* describe projection deliberately excludes).
|
|
16
|
+
*
|
|
17
|
+
* Read-only by design: schema changes go through YAML apply, the one
|
|
18
|
+
* write path for structure.
|
|
19
|
+
*
|
|
20
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
21
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
22
|
+
*/
|
|
23
|
+
export function CollectionSchemaView({ spec, className }) {
|
|
24
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-6", className), children: [_jsx(AuthorizationSummary, { authorization: spec.authorization, timezone: spec.timezone }), spec.collections.map((coll) => (_jsx(CollectionSchema, { collection: coll }, coll.name)))] }));
|
|
25
|
+
}
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Authorization block summary
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
function AuthorizationSummary({ authorization, timezone, }) {
|
|
30
|
+
const roles = authorization?.roles ?? [];
|
|
31
|
+
const bindings = authorization?.bindings ?? [];
|
|
32
|
+
const defaultRole = authorization?.defaultRole ?? "";
|
|
33
|
+
return (_jsx(Section, { title: "Authorization", children: _jsxs("div", { className: "flex flex-col gap-3 p-3 text-sm", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Roles" }), roles.length === 0 ? (_jsx("span", { className: "text-xs text-muted-foreground", children: "none declared" })) : (roles.map((r) => (_jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-foreground", children: r.name }, r.name))))] }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Default role" }), defaultRole ? (_jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-foreground", children: defaultRole })) : (_jsx("span", { className: "text-xs text-muted-foreground", children: "none \u2014 unbound callers are denied" }))] }), bindings.length > 0 && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: ["Bindings (", bindings.length, ")"] }), _jsx("ul", { className: "flex flex-col gap-0.5", children: bindings.map((b, i) => (_jsxs("li", { className: "text-xs text-foreground", children: [_jsx("code", { className: "font-mono", children: formatSubject(b.subject) }), _jsx("span", { className: "text-muted-foreground", children: " \u2192 " }), b.role] }, i))) })] })), timezone && (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Timezone" }), _jsx("span", { className: "text-xs text-foreground", children: timezone })] }))] }) }));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Plain kind+value rendering of a datastore subject (DD-008 SD-3: the
|
|
37
|
+
* grant system is the privacy boundary; display is honest).
|
|
38
|
+
*/
|
|
39
|
+
export function formatSubject(subject) {
|
|
40
|
+
switch (subject?.kind.case) {
|
|
41
|
+
case "channelSender": {
|
|
42
|
+
const s = subject.kind.value;
|
|
43
|
+
return `${s.senderKind}:${s.value}`;
|
|
44
|
+
}
|
|
45
|
+
case "principal": {
|
|
46
|
+
const p = subject.kind.value;
|
|
47
|
+
return `${p.kind}/${p.id}`;
|
|
48
|
+
}
|
|
49
|
+
default:
|
|
50
|
+
return "unknown";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Per-collection schema
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
const CONSTRAINT_KIND_LABELS = {
|
|
57
|
+
uniques: "unique",
|
|
58
|
+
checks: "check",
|
|
59
|
+
exists: "exists",
|
|
60
|
+
notExists: "not exists",
|
|
61
|
+
};
|
|
62
|
+
function CollectionSchema({ collection }) {
|
|
63
|
+
const constraints = [
|
|
64
|
+
...collection.uniques.map((c) => ({
|
|
65
|
+
kind: CONSTRAINT_KIND_LABELS.uniques,
|
|
66
|
+
name: c.name,
|
|
67
|
+
fields: c.fields.join(", "),
|
|
68
|
+
message: c.message,
|
|
69
|
+
})),
|
|
70
|
+
...collection.checks.map((c) => ({
|
|
71
|
+
kind: CONSTRAINT_KIND_LABELS.checks,
|
|
72
|
+
name: c.name,
|
|
73
|
+
fields: "",
|
|
74
|
+
message: c.message,
|
|
75
|
+
})),
|
|
76
|
+
...collection.exists.map((c) => ({
|
|
77
|
+
kind: CONSTRAINT_KIND_LABELS.exists,
|
|
78
|
+
name: c.name,
|
|
79
|
+
fields: c.collection,
|
|
80
|
+
message: c.message,
|
|
81
|
+
})),
|
|
82
|
+
...collection.notExists.map((c) => ({
|
|
83
|
+
kind: CONSTRAINT_KIND_LABELS.notExists,
|
|
84
|
+
name: c.name,
|
|
85
|
+
fields: c.collection,
|
|
86
|
+
message: c.message,
|
|
87
|
+
})),
|
|
88
|
+
];
|
|
89
|
+
return (_jsx(Section, { title: collection.name, count: collection.fields.length, children: _jsxs("div", { className: "flex flex-col", children: [collection.description && (_jsx("p", { className: "border-b border-border px-3 py-2 text-xs text-muted-foreground", children: collection.description })), _jsxs("table", { className: "w-full text-left text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-border text-muted-foreground", children: [_jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Field" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Type" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Required" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Default" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Description" })] }) }), _jsx("tbody", { children: collection.fields.map((f) => (_jsxs("tr", { className: "border-b border-border last:border-b-0", children: [_jsx("td", { className: "px-3 py-2 font-mono text-foreground", children: f.name }), _jsxs("td", { className: "px-3 py-2 text-foreground", children: [FieldType[f.type], f.enumValues.length > 0 && (_jsxs("span", { className: "text-muted-foreground", children: [" ", "(", f.enumValues.join(" | "), ")"] }))] }), _jsx("td", { className: "px-3 py-2 text-muted-foreground", children: f.required ? "yes" : "" }), _jsx("td", { className: "px-3 py-2 font-mono text-muted-foreground", children: f.default !== undefined
|
|
90
|
+
? formatFieldValue(f.type, toJson(ValueSchema, f.default))
|
|
91
|
+
: "" }), _jsx("td", { className: "px-3 py-2 text-muted-foreground", children: f.description })] }, f.name))) })] }), constraints.length > 0 && (_jsxs("div", { className: "border-t border-border", children: [_jsx("h4", { className: "px-3 pt-2 text-xs font-medium uppercase tracking-wider text-muted-foreground", children: "Constraints" }), _jsx("ul", { className: "flex flex-col gap-1 p-3", children: constraints.map((c) => (_jsxs("li", { className: "flex flex-wrap items-baseline gap-2 text-xs", children: [_jsx("span", { className: "rounded bg-muted px-1.5 py-0.5 font-medium text-muted-foreground", children: c.kind }), _jsx("code", { className: "font-mono text-foreground", children: c.name }), c.fields && _jsxs("span", { className: "text-muted-foreground", children: ["(", c.fields, ")"] }), c.message && (_jsxs("span", { className: "text-muted-foreground", children: ["\u2014 \u201C", c.message, "\u201D"] }))] }, `${c.kind}:${c.name}`))) })] }))] }) }));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=CollectionSchemaView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionSchemaView.js","sourceRoot":"","sources":["../../src/datastore/CollectionSchemaView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,SAAS,GAKV,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAUrD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAA6B;IACjF,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,aAClD,KAAC,oBAAoB,IAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,EACnF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC9B,KAAC,gBAAgB,IAAiB,UAAU,EAAE,IAAI,IAA3B,IAAI,CAAC,IAAI,CAAsB,CACvD,CAAC,I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AAC,GACI,IACF,EAEP,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CACzB,eAAK,SAAS,EAAC,wBAAwB,aACrC,aAAI,SAAS,EAAC,8EAA8E,4BAEvF,EACL,aAAI,SAAS,EAAC,yBAAyB,YACpC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACtB,cAAgC,SAAS,EAAC,6CAA6C,aACrF,eAAM,SAAS,EAAC,kEAAkE,YAC/E,CAAC,CAAC,IAAI,GACF,EACP,eAAM,SAAS,EAAC,2BAA2B,YAAE,CAAC,CAAC,IAAI,GAAQ,EAC1D,CAAC,CAAC,MAAM,IAAI,gBAAM,SAAS,EAAC,uBAAuB,kBAAG,CAAC,CAAC,MAAM,SAAS,EACvE,CAAC,CAAC,OAAO,IAAI,CACZ,gBAAM,SAAS,EAAC,uBAAuB,8BAAK,CAAC,CAAC,OAAO,cAAS,CAC/D,KARM,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CASzB,CACN,CAAC,GACC,IACD,CACP,IACG,GACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Datastore } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/api_pb";
|
|
2
|
+
import type { DetailAction } from "../resource-detail/types.js";
|
|
3
|
+
/** The detail view's tabs. */
|
|
4
|
+
export type DatastoreDetailTab = "overview" | "records";
|
|
5
|
+
/** Props for {@link DatastoreDetailView}. */
|
|
6
|
+
export interface DatastoreDetailViewProps {
|
|
7
|
+
/** Organization slug. */
|
|
8
|
+
readonly org: string;
|
|
9
|
+
/** Datastore slug. */
|
|
10
|
+
readonly slug: string;
|
|
11
|
+
/** Primary action rendered as a visible button. */
|
|
12
|
+
readonly primaryAction?: DetailAction;
|
|
13
|
+
/** Overflow actions (Edit YAML / Export / Delete — assembled at the page level). */
|
|
14
|
+
readonly actions?: readonly DetailAction[];
|
|
15
|
+
/** Called when the datastore loads or reloads (e.g. breadcrumb label sync). */
|
|
16
|
+
readonly onResourceLoad?: (datastore: Datastore) => void;
|
|
17
|
+
/** Initial tab for uncontrolled usage. @default "overview" */
|
|
18
|
+
readonly defaultTab?: DatastoreDetailTab;
|
|
19
|
+
/** Controlled active tab. Uncontrolled (internal state) when omitted. */
|
|
20
|
+
readonly activeTab?: DatastoreDetailTab;
|
|
21
|
+
/** Tab-change callback for controlled usage. */
|
|
22
|
+
readonly onTabChange?: (tab: DatastoreDetailTab) => void;
|
|
23
|
+
/** Additional CSS classes for the root container. */
|
|
24
|
+
readonly className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Self-contained detail view for a Datastore — the Library-resource
|
|
28
|
+
* home (DD-008 SD-1): an **Overview** tab (schema, authorization
|
|
29
|
+
* summary, and the sync-report health strip — all from the loaded
|
|
30
|
+
* resource, the authoritative source for structure and health) and a
|
|
31
|
+
* **Records** tab (the browser, whose caller-effective verbs come from
|
|
32
|
+
* `describeDatastore`). No version-history affordance —
|
|
33
|
+
* `is_versioned: false` (DD-003).
|
|
34
|
+
*
|
|
35
|
+
* Handles loading, error, and not-found states automatically.
|
|
36
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
37
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
38
|
+
*/
|
|
39
|
+
export declare function DatastoreDetailView({ org, slug, primaryAction, actions, onResourceLoad, defaultTab, activeTab, onTabChange, className, }: DatastoreDetailViewProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
/** Database-cylinder icon shared by the detail view's states. */
|
|
41
|
+
export declare function DatastoreIcon({ className }: {
|
|
42
|
+
readonly className?: string;
|
|
43
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
//# sourceMappingURL=DatastoreDetailView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatastoreDetailView.d.ts","sourceRoot":"","sources":["../../src/datastore/DatastoreDetailView.tsx"],"names":[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|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { ErrorMessage } from "../error/ErrorMessage.js";
|
|
7
|
+
import { ResourceDetailShell } from "../resource-detail/ResourceDetailShell.js";
|
|
8
|
+
import { CollectionRecordsBrowser } from "./CollectionRecordsBrowser.js";
|
|
9
|
+
import { CollectionSchemaView } from "./CollectionSchemaView.js";
|
|
10
|
+
import { DatastoreSyncReport } from "./DatastoreSyncReport.js";
|
|
11
|
+
import { useDatastore } from "./useDatastore.js";
|
|
12
|
+
/**
|
|
13
|
+
* Self-contained detail view for a Datastore — the Library-resource
|
|
14
|
+
* home (DD-008 SD-1): an **Overview** tab (schema, authorization
|
|
15
|
+
* summary, and the sync-report health strip — all from the loaded
|
|
16
|
+
* resource, the authoritative source for structure and health) and a
|
|
17
|
+
* **Records** tab (the browser, whose caller-effective verbs come from
|
|
18
|
+
* `describeDatastore`). No version-history affordance —
|
|
19
|
+
* `is_versioned: false` (DD-003).
|
|
20
|
+
*
|
|
21
|
+
* Handles loading, error, and not-found states automatically.
|
|
22
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
23
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
24
|
+
*/
|
|
25
|
+
export function DatastoreDetailView({ org, slug, primaryAction, actions, onResourceLoad, defaultTab = "overview", activeTab, onTabChange, className, }) {
|
|
26
|
+
const { datastore, isLoading, error, refetch } = useDatastore(org, slug);
|
|
27
|
+
const [internalTab, setInternalTab] = useState(defaultTab);
|
|
28
|
+
const tab = activeTab ?? internalTab;
|
|
29
|
+
const setTab = onTabChange ?? setInternalTab;
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (datastore)
|
|
32
|
+
onResourceLoad?.(datastore);
|
|
33
|
+
}, [datastore, onResourceLoad]);
|
|
34
|
+
if (isLoading)
|
|
35
|
+
return _jsx(LoadingSkeleton, { className: className });
|
|
36
|
+
if (error)
|
|
37
|
+
return _jsx(ErrorMessage, { error: error, retry: refetch, className: className });
|
|
38
|
+
if (!datastore)
|
|
39
|
+
return _jsx(NotFoundState, { className: className });
|
|
40
|
+
const meta = datastore.metadata;
|
|
41
|
+
const spec = datastore.spec;
|
|
42
|
+
const status = datastore.status;
|
|
43
|
+
const specAudit = status?.audit?.specAudit;
|
|
44
|
+
const headerMeta = {
|
|
45
|
+
name: meta?.name || meta?.slug || "Untitled",
|
|
46
|
+
id: meta?.id || "",
|
|
47
|
+
org: meta?.org,
|
|
48
|
+
slug: meta?.slug,
|
|
49
|
+
description: spec?.description,
|
|
50
|
+
icon: _jsx(DatastoreIcon, { className: "size-6 text-muted-foreground" }),
|
|
51
|
+
createdAt: specAudit?.createdAt ? timestampDate(specAudit.createdAt) : null,
|
|
52
|
+
updatedAt: specAudit?.updatedAt ? timestampDate(specAudit.updatedAt) : null,
|
|
53
|
+
};
|
|
54
|
+
return (_jsx(ResourceDetailShell, { header: headerMeta, primaryAction: primaryAction, actions: actions, tabs: [
|
|
55
|
+
{ id: "overview", label: "Overview" },
|
|
56
|
+
{ id: "records", label: "Records" },
|
|
57
|
+
], activeTab: tab, onTabChange: (id) => setTab(id), tabsAriaLabel: "Datastore sections", className: className, children: tab === "overview" ? (_jsxs("div", { className: "flex flex-col gap-6", children: [status && _jsx(DatastoreSyncReport, { status: status }), spec && _jsx(CollectionSchemaView, { spec: spec })] })) : (spec &&
|
|
58
|
+
meta && (_jsx(CollectionRecordsBrowser, { org: meta.org, datastoreSlug: meta.slug, spec: spec }))) }));
|
|
59
|
+
}
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// Non-happy states
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
function LoadingSkeleton({ className }) {
|
|
64
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-6", className), "aria-busy": "true", "aria-label": "Loading datastore details", children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "mt-1 size-6 shrink-0 animate-pulse rounded bg-muted" }), _jsxs("div", { className: "flex-1 space-y-2", children: [_jsx("div", { className: "h-5 w-48 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-3 w-64 animate-pulse rounded bg-muted" })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { className: "h-3 w-28 animate-pulse rounded bg-muted" }), _jsx("div", { className: "animate-pulse rounded-lg border border-border bg-muted-faint", style: { height: "160px" } })] }), _jsxs("div", { className: "space-y-2", children: [_jsx("div", { className: "h-3 w-20 animate-pulse rounded bg-muted" }), _jsx("div", { className: "animate-pulse rounded-lg border border-border bg-muted-faint", style: { height: "240px" } })] })] }));
|
|
65
|
+
}
|
|
66
|
+
function NotFoundState({ className }) {
|
|
67
|
+
return (_jsxs("div", { role: "status", className: cn("flex flex-col items-center gap-2 py-12 text-center", className), children: [_jsx(DatastoreIcon, { className: "size-10 text-muted-foreground-faint" }), _jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Datastore not found" }), _jsx("p", { className: "text-xs text-muted-foreground-subtle", children: "This datastore doesn't exist or you don't have access to it." })] }));
|
|
68
|
+
}
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
// Icon (inline SVG — no icon-library dependency)
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
/** Database-cylinder icon shared by the detail view's states. */
|
|
73
|
+
export function DatastoreIcon({ className }) {
|
|
74
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("ellipse", { cx: "12", cy: "5", rx: "8", ry: "3" }), _jsx("path", { d: "M4 5v6c0 1.66 3.58 3 8 3s8-1.34 8-3V5" }), _jsx("path", { d: "M4 11v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6" })] }));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=DatastoreDetailView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatastoreDetailView.js","sourceRoot":"","sources":["../../src/datastore/DatastoreDetailView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA2BjD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EACH,IAAI,EACJ,aAAa,EACb,OAAO,EACP,cAAc,EACd,UAAU,GAAG,UAAU,EACvB,SAAS,EACT,WAAW,EACX,SAAS,GACgB;IACzB,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEzE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAqB,UAAU,CAAC,CAAC;IAC/E,MAAM,GAAG,GAAG,SAAS,IAAI,WAAW,CAAC;IACrC,MAAM,MAAM,GAAG,WAAW,IAAI,cAAc,CAAC;IAE7C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS;YAAE,cAAc,EAAE,CAAC,S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AE,OAAO,EAAE,GAC1B,IACE,EACN,eAAK,SAAS,EAAC,WAAW,aACxB,cAAK,SAAS,EAAC,yCAAyC,GAAG,EAC3D,cACE,SAAS,EAAC,8DAA8D,EACxE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAC1B,IACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,EAAE,SAAS,EAAmC;IACnE,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CAAC,oDAAoD,EAAE,SAAS,CAAC,aAE9E,KAAC,aAAa,IAAC,SAAS,EAAC,qCAAqC,GAAG,EACjE,YAAG,SAAS,EAAC,2CAA2C,oCAAwB,EAChF,YAAG,SAAS,EAAC,sCAAsC,6EAE/C,IACA,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,iDAAiD;AACjD,8EAA8E;AAE9E,iEAAiE;AACjE,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAmC;IAC1E,OAAO,CACL,eACE,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,kBAAS,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,GAAG,EACxC,eAAM,CAAC,EAAC,uCAAuC,GAAG,EAClD,eAAM,CAAC,EAAC,yCAAyC,GAAG,IAChD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type DatastoreStatus } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/status_pb";
|
|
2
|
+
/** Props for {@link DatastoreSyncReport}. */
|
|
3
|
+
export interface DatastoreSyncReportProps {
|
|
4
|
+
/** The datastore status — the authoritative source for health (DD-008 SD-5). */
|
|
5
|
+
readonly status: DatastoreStatus;
|
|
6
|
+
/** Additional CSS classes for the root container. */
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The Overview health strip: projects `DatastoreStatus` — last apply
|
|
11
|
+
* outcome, per-collection materialization state, and record counts —
|
|
12
|
+
* so the operator can confirm an apply landed without leaving the
|
|
13
|
+
* console (the cutover choreography's verification surface, DD-009).
|
|
14
|
+
*
|
|
15
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
16
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
17
|
+
*/
|
|
18
|
+
export declare function DatastoreSyncReport({ status, className }: DatastoreSyncReportProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=DatastoreSyncReport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatastoreSyncReport.d.ts","sourceRoot":"","sources":["../../src/datastore/DatastoreSyncReport.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,2DAA2D,CAAC;AAInE,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,wBAAwB,2CA6ClF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
4
|
+
import { CollectionMaterializationState, DatastoreSyncOutcome, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/status_pb";
|
|
5
|
+
import { Section } from "../resource-detail/Section.js";
|
|
6
|
+
import { StatusBadge } from "../resource-workbench/components/StatusBadge.js";
|
|
7
|
+
/**
|
|
8
|
+
* The Overview health strip: projects `DatastoreStatus` — last apply
|
|
9
|
+
* outcome, per-collection materialization state, and record counts —
|
|
10
|
+
* so the operator can confirm an apply landed without leaving the
|
|
11
|
+
* console (the cutover choreography's verification surface, DD-009).
|
|
12
|
+
*
|
|
13
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
14
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
15
|
+
*/
|
|
16
|
+
export function DatastoreSyncReport({ status, className }) {
|
|
17
|
+
const syncedAt = status.lastSyncedAt
|
|
18
|
+
? timestampDate(status.lastSyncedAt).toLocaleString()
|
|
19
|
+
: null;
|
|
20
|
+
return (_jsx(Section, { title: "Sync report", className: className, children: _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-border px-3 py-2", children: [_jsx(SyncOutcomeBadge, { outcome: status.lastSyncOutcome }), syncedAt && (_jsxs("span", { className: "text-xs text-muted-foreground", children: ["last synced ", syncedAt] }))] }), status.collections.length === 0 ? (_jsx("p", { className: "px-3 py-2 text-xs text-muted-foreground", children: "No collections have been synced yet." })) : (_jsxs("table", { className: "w-full text-left text-xs", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-b border-border text-muted-foreground", children: [_jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "Collection" }), _jsx("th", { scope: "col", className: "px-3 py-2 font-medium", children: "State" }), _jsx("th", { scope: "col", className: "px-3 py-2 text-right font-medium", children: "Records" })] }) }), _jsx("tbody", { children: status.collections.map((coll) => (_jsxs("tr", { className: "border-b border-border last:border-b-0", children: [_jsx("td", { className: "px-3 py-2 font-mono text-foreground", children: coll.name }), _jsx("td", { className: "px-3 py-2", children: _jsx(MaterializationBadge, { state: coll.state }) }), _jsx("td", { className: "px-3 py-2 text-right tabular-nums text-foreground", children: String(coll.recordCount) })] }, coll.name))) })] }))] }) }));
|
|
21
|
+
}
|
|
22
|
+
function SyncOutcomeBadge({ outcome }) {
|
|
23
|
+
switch (outcome) {
|
|
24
|
+
case DatastoreSyncOutcome.synced:
|
|
25
|
+
return _jsx(StatusBadge, { phase: "ready", label: "synced" });
|
|
26
|
+
case DatastoreSyncOutcome.rejected:
|
|
27
|
+
return _jsx(StatusBadge, { phase: "failed", label: "rejected" });
|
|
28
|
+
default:
|
|
29
|
+
return _jsx(StatusBadge, { phase: "draft", label: "never synced" });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function MaterializationBadge({ state }) {
|
|
33
|
+
switch (state) {
|
|
34
|
+
case CollectionMaterializationState.active:
|
|
35
|
+
return _jsx(StatusBadge, { phase: "ready", label: "active" });
|
|
36
|
+
case CollectionMaterializationState.pending:
|
|
37
|
+
return _jsx(StatusBadge, { phase: "pending", label: "pending" });
|
|
38
|
+
case CollectionMaterializationState.removed:
|
|
39
|
+
// Removed from the spec; data retained until datastore delete.
|
|
40
|
+
return (_jsx(StatusBadge, { phase: "disabled", label: "removed", tooltip: "Removed from the spec \u2014 records retained until the datastore is deleted" }));
|
|
41
|
+
default:
|
|
42
|
+
return _jsx(StatusBadge, { phase: "draft", label: "unknown" });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=DatastoreSyncReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatastoreSyncReport.js","sourceRoot":"","sources":["../../src/datastore/DatastoreSyncReport.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,8BAA8B,EAC9B,oBAAoB,GAErB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAU9E;;;;;;;;GAQG;AACH,MAA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DeleteDatastoreDialog}. */
|
|
3
|
+
export interface DeleteDatastoreDialogProps {
|
|
4
|
+
/** Whether the dialog is open. */
|
|
5
|
+
readonly open: boolean;
|
|
6
|
+
/** Called when the dialog requests to close. */
|
|
7
|
+
readonly onOpenChange: (open: boolean) => void;
|
|
8
|
+
/** The loaded datastore (metadata + status feed the counts). */
|
|
9
|
+
readonly datastore: Datastore | null;
|
|
10
|
+
/** Called after a successful delete (navigate away). */
|
|
11
|
+
readonly onDeleted?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The guarded delete flow for the platform's only record-destroying
|
|
15
|
+
* resource action (DD-008 SD-6) — a status-informed acknowledgment
|
|
16
|
+
* replacing the generic one-shot confirm:
|
|
17
|
+
*
|
|
18
|
+
* - Counts are pre-filled from the already-loaded `status` ("holds N
|
|
19
|
+
* records across M collections").
|
|
20
|
+
* - A **non-empty** datastore requires **typing the datastore slug** to
|
|
21
|
+
* arm the delete — the strongest-friction confirm. Arming sends the
|
|
22
|
+
* `force` acknowledgment.
|
|
23
|
+
* - An **empty** datastore keeps the standard destructive confirm.
|
|
24
|
+
* - The server's guards stay authoritative: on refusal (agent
|
|
25
|
+
* references, count drift) the `FAILED_PRECONDITION` message renders
|
|
26
|
+
* **verbatim** inside the dialog with fresh server counts — the
|
|
27
|
+
* console renders the guard, never pre-empts it. The agent-reference
|
|
28
|
+
* block names the referencing agents; detaching them is the operator's
|
|
29
|
+
* next step, and the block is deliberately not acknowledgeable-through.
|
|
30
|
+
*
|
|
31
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
32
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
33
|
+
*/
|
|
34
|
+
export declare function DeleteDatastoreDialog({ open, onOpenChange, datastore, onDeleted, }: DeleteDatastoreDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
+
//# sourceMappingURL=DeleteDatastoreDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteDatastoreDialog.d.ts","sourceRoot":"","sources":["../../src/datastore/DeleteDatastoreDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAKxF,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IACrC,wDAAwD;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,SAAS,GACV,EAAE,0BAA0B,kDAyJ5B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
import { toast } from "../feedback/toast.js";
|
|
7
|
+
import { FIELD_INPUT_CLASSES } from "./FieldValueControl.js";
|
|
8
|
+
import { useDeleteDatastore } from "./useDeleteDatastore.js";
|
|
9
|
+
/**
|
|
10
|
+
* The guarded delete flow for the platform's only record-destroying
|
|
11
|
+
* resource action (DD-008 SD-6) — a status-informed acknowledgment
|
|
12
|
+
* replacing the generic one-shot confirm:
|
|
13
|
+
*
|
|
14
|
+
* - Counts are pre-filled from the already-loaded `status` ("holds N
|
|
15
|
+
* records across M collections").
|
|
16
|
+
* - A **non-empty** datastore requires **typing the datastore slug** to
|
|
17
|
+
* arm the delete — the strongest-friction confirm. Arming sends the
|
|
18
|
+
* `force` acknowledgment.
|
|
19
|
+
* - An **empty** datastore keeps the standard destructive confirm.
|
|
20
|
+
* - The server's guards stay authoritative: on refusal (agent
|
|
21
|
+
* references, count drift) the `FAILED_PRECONDITION` message renders
|
|
22
|
+
* **verbatim** inside the dialog with fresh server counts — the
|
|
23
|
+
* console renders the guard, never pre-empts it. The agent-reference
|
|
24
|
+
* block names the referencing agents; detaching them is the operator's
|
|
25
|
+
* next step, and the block is deliberately not acknowledgeable-through.
|
|
26
|
+
*
|
|
27
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
28
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
29
|
+
*/
|
|
30
|
+
export function DeleteDatastoreDialog({ open, onOpenChange, datastore, onDeleted, }) {
|
|
31
|
+
const dialogRef = useRef(null);
|
|
32
|
+
const { deleteDatastore, isDeleting, error, clearError } = useDeleteDatastore();
|
|
33
|
+
const [slugInput, setSlugInput] = useState("");
|
|
34
|
+
const slug = datastore?.metadata?.slug ?? "";
|
|
35
|
+
const resourceId = datastore?.metadata?.id ?? "";
|
|
36
|
+
// BigInt literals (0n) are avoided: consumer apps compile SDK sources
|
|
37
|
+
// with targets below ES2020.
|
|
38
|
+
const { totalRecords, nonEmptyCollections } = useMemo(() => {
|
|
39
|
+
let records = BigInt(0);
|
|
40
|
+
let collections = 0;
|
|
41
|
+
for (const coll of datastore?.status?.collections ?? []) {
|
|
42
|
+
if (coll.recordCount > BigInt(0)) {
|
|
43
|
+
records += coll.recordCount;
|
|
44
|
+
collections += 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { totalRecords: records, nonEmptyCollections: collections };
|
|
48
|
+
}, [datastore]);
|
|
49
|
+
const isEmpty = totalRecords === BigInt(0);
|
|
50
|
+
const armed = isEmpty || slugInput === slug;
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (open) {
|
|
53
|
+
setSlugInput("");
|
|
54
|
+
clearError();
|
|
55
|
+
}
|
|
56
|
+
}, [open, clearError]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
const dialog = dialogRef.current;
|
|
59
|
+
if (!dialog)
|
|
60
|
+
return;
|
|
61
|
+
if (open && !dialog.open)
|
|
62
|
+
dialog.showModal();
|
|
63
|
+
else if (!open && dialog.open)
|
|
64
|
+
dialog.close();
|
|
65
|
+
}, [open]);
|
|
66
|
+
const handleDialogCancel = useCallback((e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
onOpenChange(false);
|
|
69
|
+
}, [onOpenChange]);
|
|
70
|
+
const handleDelete = useCallback(async () => {
|
|
71
|
+
if (!resourceId || !armed)
|
|
72
|
+
return;
|
|
73
|
+
try {
|
|
74
|
+
// A non-empty delete carries force — the acknowledgment the
|
|
75
|
+
// slug-typing arms. Empty datastores need no acknowledgment.
|
|
76
|
+
await deleteDatastore({ resourceId, force: !isEmpty });
|
|
77
|
+
toast.success(`Datastore "${slug}" deleted`);
|
|
78
|
+
onOpenChange(false);
|
|
79
|
+
onDeleted?.();
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// The guard's message renders inline via `error` — with fresh
|
|
83
|
+
// counts on drift; the server stays authoritative.
|
|
84
|
+
}
|
|
85
|
+
}, [resourceId, armed, isEmpty, deleteDatastore, slug, onOpenChange, onDeleted]);
|
|
86
|
+
if (!open || !datastore)
|
|
87
|
+
return null;
|
|
88
|
+
return (_jsx("dialog", { ref: dialogRef, onCancel: handleDialogCancel, "aria-label": `Delete datastore ${slug}`, 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-4 p-6", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsxs("h3", { className: "text-base font-semibold text-foreground", children: ["Delete datastore \u201C", slug, "\u201D?"] }), isEmpty ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "This datastore holds no records. Its declared collections will be removed. This cannot be undone." })) : (_jsxs("p", { className: "text-sm text-muted-foreground", children: ["\u201C", slug, "\u201D holds", " ", _jsxs("strong", { className: "font-semibold text-foreground", children: [String(totalRecords), " record", totalRecords === BigInt(1) ? "" : "s"] }), " ", "across", " ", _jsxs("strong", { className: "font-semibold text-foreground", children: [nonEmptyCollections, " collection", nonEmptyCollections === 1 ? "" : "s"] }), ". Deleting the datastore destroys them all. This cannot be undone."] }))] }), error && (_jsx("div", { role: "alert", className: "rounded-md border border-destructive bg-card px-3 py-2 text-sm text-destructive", children: getUserMessage(error) })), !isEmpty && (_jsxs("label", { className: "flex flex-col gap-1 text-xs font-medium text-muted-foreground", children: ["Type ", _jsx("span", { className: "font-mono text-foreground", children: slug }), " to confirm", _jsx("input", { type: "text", className: FIELD_INPUT_CLASSES, value: slugInput, onChange: (e) => setSlugInput(e.target.value), autoComplete: "off", spellCheck: false, "aria-label": `Type ${slug} to confirm deletion` })] })), _jsxs("div", { className: "flex justify-end gap-2", children: [_jsx("button", { type: "button", onClick: () => onOpenChange(false), className: cn("rounded-md border border-input bg-background px-3 py-1.5 text-sm font-medium text-foreground", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Cancel" }), _jsx("button", { type: "button", onClick: handleDelete, disabled: !armed || isDeleting, className: cn("rounded-md bg-destructive px-3 py-1.5 text-sm font-medium text-destructive-foreground", "hover:bg-destructive-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50"), children: isDeleting ? "Deleting…" : "Delete datastore" })] })] }) }));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=DeleteDatastoreDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteDatastoreDialog.js","sourceRoot":"","sources":["../../src/datastore/DeleteDatastoreDialog.tsx"],"names":[],"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AAI,CACR,cACE,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,iFAAiF,YAE1F,cAAc,CAAC,KAAK,CAAC,GAClB,CACP,EAEA,CAAC,OAAO,IAAI,CACX,iBAAO,SAAS,EAAC,+DAA+D,sBACzE,eAAM,SAAS,EAAC,2BAA2B,YAAE,IAAI,GAAQ,iBAC9D,gBACE,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,YAAY,EAAC,KAAK,EAClB,UAAU,EAAE,KAAK,gBACL,QAAQ,IAAI,sBAAsB,GAC9C,IACI,CACT,EAED,eAAK,SAAS,EAAC,wBAAwB,aACrC,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAClC,SAAS,EAAE,EAAE,CACX,8FAA8F,EAC9F,8CAA8C,EAC9C,yEAAyE,CAC1E,uBAGM,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,KAAK,IAAI,UAAU,EAC9B,SAAS,EAAE,EAAE,CACX,uFAAuF,EACvF,4BAA4B,EAC5B,yEAAyE,EACzE,kDAAkD,CACnD,YAEA,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,GACvC,IACL,IACF,GACC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { JsonValue } from "@bufbuild/protobuf";
|
|
2
|
+
import { type FieldDeclaration } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
3
|
+
/**
|
|
4
|
+
* Standard input styling for datastore value controls — the
|
|
5
|
+
* token-compliant idiom (semantic Tailwind classes over `--stgm-*`
|
|
6
|
+
* tokens; no pixel font sizes, no hex fallbacks).
|
|
7
|
+
*/
|
|
8
|
+
export declare const FIELD_INPUT_CLASSES: string;
|
|
9
|
+
/** Props for {@link FieldValueControl}. */
|
|
10
|
+
export interface FieldValueControlProps {
|
|
11
|
+
/** The field declaration driving the control type. */
|
|
12
|
+
readonly field: FieldDeclaration;
|
|
13
|
+
/**
|
|
14
|
+
* Current value in its canonical encoding (DD-004), or `undefined`
|
|
15
|
+
* when empty/unset. The control never receives explicit `null` — the
|
|
16
|
+
* clear affordance is the owner's (a form row renders it; the control
|
|
17
|
+
* only edits values).
|
|
18
|
+
*/
|
|
19
|
+
readonly value: JsonValue | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Called with the canonical value on every valid edit, or `undefined`
|
|
22
|
+
* when the input empties. Invalid intermediate states (half-typed
|
|
23
|
+
* JSON, unparseable numbers) stay local to the control and are never
|
|
24
|
+
* emitted — the precedent set by the workflow config form.
|
|
25
|
+
*/
|
|
26
|
+
readonly onChange: (value: JsonValue | undefined) => void;
|
|
27
|
+
/** Disables the input. */
|
|
28
|
+
readonly disabled?: boolean;
|
|
29
|
+
/** DOM id for external `<label htmlFor>` wiring. */
|
|
30
|
+
readonly id?: string;
|
|
31
|
+
/** Accessible name when no external label is wired. */
|
|
32
|
+
readonly "aria-label"?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The typed value control for a declared datastore field — one
|
|
36
|
+
* controlled input per `FieldType`, emitting canonical encodings
|
|
37
|
+
* (DD-004). Shared by `RecordFormPanel` (field editing) and
|
|
38
|
+
* `RecordFilterBuilder` (condition values), so a field always offers
|
|
39
|
+
* the same input affordance everywhere.
|
|
40
|
+
*
|
|
41
|
+
* Type dispatch:
|
|
42
|
+
* - `string` — text input; enum-select when `enum_values` declared
|
|
43
|
+
* - `integer` / `number` — numeric input (step 1 / any)
|
|
44
|
+
* - `bool` — select with true/false (a checkbox conflates
|
|
45
|
+
* "false" with "unset", which the tri-state
|
|
46
|
+
* write model must not do)
|
|
47
|
+
* - `date` — native date picker (emits `YYYY-MM-DD`)
|
|
48
|
+
* - `time` — native time picker (emits zero-padded `HH:MM[:SS]`)
|
|
49
|
+
* - `timestamp` — native datetime-local picker in the operator's
|
|
50
|
+
* zone, converted to RFC 3339 UTC
|
|
51
|
+
* - `json` — mono textarea with local parse state; only
|
|
52
|
+
* valid JSON is emitted
|
|
53
|
+
*/
|
|
54
|
+
export declare function FieldValueControl(props: FieldValueControlProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
//# sourceMappingURL=FieldValueControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValueControl.d.ts","sourceRoot":"","sources":["../../src/datastore/FieldValueControl.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,yDAAyD,CAAC;AAEjE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAK/B,CAAC;AAEF,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAoB9D"}
|