@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,49 @@
|
|
|
1
|
+
import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
2
|
+
/** Input for adding one member key. */
|
|
3
|
+
export interface AddCursorMemberKeyInput {
|
|
4
|
+
readonly accountId: string;
|
|
5
|
+
/**
|
|
6
|
+
* Plaintext user-scoped Cursor API key. The server identifies it via
|
|
7
|
+
* Cursor's `/v1/me` and binds it to its owning team member; admin and
|
|
8
|
+
* service-account keys are rejected with Cursor's own explanation —
|
|
9
|
+
* surface the error verbatim.
|
|
10
|
+
*/
|
|
11
|
+
readonly apiKey: string;
|
|
12
|
+
/** Optional operator label. */
|
|
13
|
+
readonly label?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Input for removing one member key. */
|
|
16
|
+
export interface RemoveCursorMemberKeyInput {
|
|
17
|
+
readonly accountId: string;
|
|
18
|
+
readonly keyId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Removal is refused while live sessions are pinned to this key.
|
|
21
|
+
* `force: true` overrides; prefer disabling (always safe).
|
|
22
|
+
*/
|
|
23
|
+
readonly force?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Return value of {@link useCursorMemberKeyActions}. */
|
|
26
|
+
export interface UseCursorMemberKeyActionsReturn {
|
|
27
|
+
/** Add one execution-capable member key. Returns the redacted account. */
|
|
28
|
+
readonly addKey: (input: AddCursorMemberKeyInput) => Promise<CursorAccount>;
|
|
29
|
+
/** Remove one member key (live-pin guarded). */
|
|
30
|
+
readonly removeKey: (input: RemoveCursorMemberKeyInput) => Promise<CursorAccount>;
|
|
31
|
+
/** Enable/disable one key for NEW-session selection (pins unaffected). */
|
|
32
|
+
readonly setKeyEnabled: (accountId: string, keyId: string, enabled: boolean) => Promise<CursorAccount>;
|
|
33
|
+
/** `true` while any key mutation is in flight. */
|
|
34
|
+
readonly isSubmitting: boolean;
|
|
35
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
36
|
+
readonly error: Error | null;
|
|
37
|
+
/** Reset `error` to `null`. */
|
|
38
|
+
readonly clearError: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Behavior hook bundling the member-key mutations of one Cursor account —
|
|
42
|
+
* add, remove, enable/disable. One hook because the console's key panel
|
|
43
|
+
* performs all three and they share submit/error surfaces.
|
|
44
|
+
*
|
|
45
|
+
* Rotation is deliberately remove + add (no in-place key swap), so the
|
|
46
|
+
* server-side `/v1/me` identity binding can never go stale.
|
|
47
|
+
*/
|
|
48
|
+
export declare function useCursorMemberKeyActions(): UseCursorMemberKeyActionsReturn;
|
|
49
|
+
//# sourceMappingURL=useCursorMemberKeyActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCursorMemberKeyActions.d.ts","sourceRoot":"","sources":["../../src/cursor-accounts/useCursorMemberKeyActions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAI5G,uCAAuC;AACvC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yCAAyC;AACzC,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,yDAAyD;AACzD,MAAM,WAAW,+BAA+B;IAC9C,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5E,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAClF,0EAA0E;IAC1E,QAAQ,CAAC,aAAa,EAAE,CACtB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,IAAI,+BAA+B,CA6C3E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks.js";
|
|
4
|
+
import { toError } from "../internal/toError.js";
|
|
5
|
+
/**
|
|
6
|
+
* Behavior hook bundling the member-key mutations of one Cursor account —
|
|
7
|
+
* add, remove, enable/disable. One hook because the console's key panel
|
|
8
|
+
* performs all three and they share submit/error surfaces.
|
|
9
|
+
*
|
|
10
|
+
* Rotation is deliberately remove + add (no in-place key swap), so the
|
|
11
|
+
* server-side `/v1/me` identity binding can never go stale.
|
|
12
|
+
*/
|
|
13
|
+
export function useCursorMemberKeyActions() {
|
|
14
|
+
const stigmer = useStigmer();
|
|
15
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
16
|
+
const [error, setError] = useState(null);
|
|
17
|
+
const run = useCallback(async (op) => {
|
|
18
|
+
setIsSubmitting(true);
|
|
19
|
+
setError(null);
|
|
20
|
+
try {
|
|
21
|
+
return await op();
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
const err = toError(e);
|
|
25
|
+
setError(err);
|
|
26
|
+
throw err;
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
setIsSubmitting(false);
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
32
|
+
const addKey = useCallback((input) => run(() => stigmer.cursorAccounts.addMemberKey(input)), [run, stigmer.cursorAccounts]);
|
|
33
|
+
const removeKey = useCallback((input) => run(() => stigmer.cursorAccounts.removeMemberKey(input)), [run, stigmer.cursorAccounts]);
|
|
34
|
+
const setKeyEnabled = useCallback((accountId, keyId, enabled) => run(() => stigmer.cursorAccounts.setMemberKeyEnabled({ accountId, keyId, enabled })), [run, stigmer.cursorAccounts]);
|
|
35
|
+
const clearError = useCallback(() => setError(null), []);
|
|
36
|
+
return { addKey, removeKey, setKeyEnabled, isSubmitting, error, clearError };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=useCursorMemberKeyActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCursorMemberKeyActions.js","sourceRoot":"","sources":["../../src/cursor-accounts/useCursorMemberKeyActions.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA+CjD;;;;;;;GAOG;AACH,MAAM,U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C,cAAc,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAC1E,EACH,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,CAAC,CAC9B,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
2
|
+
/** Input for {@link useDeleteCursorAccount}. */
|
|
3
|
+
export interface DeleteCursorAccountInput {
|
|
4
|
+
readonly accountId: string;
|
|
5
|
+
/**
|
|
6
|
+
* Deletion is refused (FAILED_PRECONDITION) while live sessions are
|
|
7
|
+
* pinned to the account's keys. `force: true` overrides — their Cursor
|
|
8
|
+
* agent handles will be orphaned at disposal. Prefer disabling the
|
|
9
|
+
* account, which is always safe.
|
|
10
|
+
*/
|
|
11
|
+
readonly force?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Return value of {@link useDeleteCursorAccount}. */
|
|
14
|
+
export interface UseDeleteCursorAccountReturn {
|
|
15
|
+
/** Delete the account (plus its snapshots and session pins). */
|
|
16
|
+
readonly remove: (input: DeleteCursorAccountInput) => Promise<CursorAccount>;
|
|
17
|
+
/** `true` while a delete is in flight. */
|
|
18
|
+
readonly isSubmitting: boolean;
|
|
19
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
20
|
+
readonly error: Error | null;
|
|
21
|
+
/** Reset `error` to `null`. */
|
|
22
|
+
readonly clearError: () => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Behavior hook for deleting a managed Cursor account. The live-pin
|
|
26
|
+
* guard's FAILED_PRECONDITION message carries the pinned session count —
|
|
27
|
+
* surface it verbatim so the operator can choose disable-instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useDeleteCursorAccount(): UseDeleteCursorAccountReturn;
|
|
30
|
+
//# sourceMappingURL=useDeleteCursorAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteCursorAccount.d.ts","sourceRoot":"","sources":["../../src/cursor-accounts/useDeleteCursorAccount.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAI5G,gDAAgD;AAChD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,sDAAsD;AACtD,MAAM,WAAW,4BAA4B;IAC3C,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,0CAA0C;IAC1C,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,4BAA4B,CAyBrE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks.js";
|
|
4
|
+
import { toError } from "../internal/toError.js";
|
|
5
|
+
/**
|
|
6
|
+
* Behavior hook for deleting a managed Cursor account. The live-pin
|
|
7
|
+
* guard's FAILED_PRECONDITION message carries the pinned session count —
|
|
8
|
+
* surface it verbatim so the operator can choose disable-instead.
|
|
9
|
+
*/
|
|
10
|
+
export function useDeleteCursorAccount() {
|
|
11
|
+
const stigmer = useStigmer();
|
|
12
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
13
|
+
const [error, setError] = useState(null);
|
|
14
|
+
const remove = useCallback(async (input) => {
|
|
15
|
+
setIsSubmitting(true);
|
|
16
|
+
setError(null);
|
|
17
|
+
try {
|
|
18
|
+
return await stigmer.cursorAccounts.deleteAccount(input);
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
const err = toError(e);
|
|
22
|
+
setError(err);
|
|
23
|
+
throw err;
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
setIsSubmitting(false);
|
|
27
|
+
}
|
|
28
|
+
}, [stigmer.cursorAccounts]);
|
|
29
|
+
const clearError = useCallback(() => setError(null), []);
|
|
30
|
+
return { remove, isSubmitting, error, clearError };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=useDeleteCursorAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeleteCursorAccount.js","sourceRoot":"","sources":["../../src/cursor-accounts/useDeleteCursorAccount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA0BjD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAA+B,EAA0B,EAAE;QAChE,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,cAAc,CAAC,CACzB,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CursorAccountView } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
|
|
2
|
+
/** Return value of {@link useSyncCursorAccount}. */
|
|
3
|
+
export interface UseSyncCursorAccountReturn {
|
|
4
|
+
/**
|
|
5
|
+
* Run an on-demand roster + spend sync and return the refreshed view.
|
|
6
|
+
* The Cursor Admin API is rate-limited (20 req/min, poll-hourly
|
|
7
|
+
* guidance) — `isSyncing` should disable the trigger while in flight,
|
|
8
|
+
* and callers should not poll this.
|
|
9
|
+
*/
|
|
10
|
+
readonly sync: (accountId: string) => Promise<CursorAccountView>;
|
|
11
|
+
/** `true` while a sync is in flight. */
|
|
12
|
+
readonly isSyncing: boolean;
|
|
13
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
14
|
+
readonly error: Error | null;
|
|
15
|
+
/** Reset `error` to `null`. */
|
|
16
|
+
readonly clearError: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Behavior hook for the console's "Sync now" — the same server-side sync
|
|
20
|
+
* the hourly schedule runs, on demand.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSyncCursorAccount(): UseSyncCursorAccountReturn;
|
|
23
|
+
//# sourceMappingURL=useSyncCursorAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyncCursorAccount.d.ts","sourceRoot":"","sources":["../../src/cursor-accounts/useSyncCursorAccount.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAIpG,oDAAoD;AACpD,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACjE,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,0BAA0B,CAyBjE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks.js";
|
|
4
|
+
import { toError } from "../internal/toError.js";
|
|
5
|
+
/**
|
|
6
|
+
* Behavior hook for the console's "Sync now" — the same server-side sync
|
|
7
|
+
* the hourly schedule runs, on demand.
|
|
8
|
+
*/
|
|
9
|
+
export function useSyncCursorAccount() {
|
|
10
|
+
const stigmer = useStigmer();
|
|
11
|
+
const [isSyncing, setIsSyncing] = useState(false);
|
|
12
|
+
const [error, setError] = useState(null);
|
|
13
|
+
const sync = useCallback(async (accountId) => {
|
|
14
|
+
setIsSyncing(true);
|
|
15
|
+
setError(null);
|
|
16
|
+
try {
|
|
17
|
+
return await stigmer.cursorAccounts.syncAccount(accountId);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
const err = toError(e);
|
|
21
|
+
setError(err);
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
setIsSyncing(false);
|
|
26
|
+
}
|
|
27
|
+
}, [stigmer.cursorAccounts]);
|
|
28
|
+
const clearError = useCallback(() => setError(null), []);
|
|
29
|
+
return { sync, isSyncing, error, clearError };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=useSyncCursorAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyncCursorAccount.js","sourceRoot":"","sources":["../../src/cursor-accounts/useSyncCursorAccount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAmBjD;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,IAAI,GAAG,WAAW,CACtB,KAAK,EAAE,SAAiB,EAA8B,EAAE;QACtD,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,cAAc,CAAC,CACzB,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
2
|
+
/** Return value of {@link useUpsertCursorAccount}. */
|
|
3
|
+
export interface UseUpsertCursorAccountReturn {
|
|
4
|
+
/**
|
|
5
|
+
* Create (empty `accountId`) or update a Cursor account. The admin key
|
|
6
|
+
* is plaintext to set/rotate or the `***REDACTED***` marker to keep the
|
|
7
|
+
* stored value; the server validates new keys live against Cursor's
|
|
8
|
+
* `/teams/members` before persisting. Returns the redacted account.
|
|
9
|
+
*/
|
|
10
|
+
readonly upsert: (account: CursorAccount) => Promise<CursorAccount>;
|
|
11
|
+
/** `true` while a save is in flight. */
|
|
12
|
+
readonly isSubmitting: boolean;
|
|
13
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
14
|
+
readonly error: Error | null;
|
|
15
|
+
/** Reset `error` to `null`. */
|
|
16
|
+
readonly clearError: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Behavior hook for creating or updating a managed Cursor account.
|
|
20
|
+
*
|
|
21
|
+
* The parent should refetch its list/detail view after a successful
|
|
22
|
+
* save — org assignments affect key selection within the proxy's cache
|
|
23
|
+
* TTL (~5 minutes).
|
|
24
|
+
*/
|
|
25
|
+
export declare function useUpsertCursorAccount(): UseUpsertCursorAccountReturn;
|
|
26
|
+
//# sourceMappingURL=useUpsertCursorAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpsertCursorAccount.d.ts","sourceRoot":"","sources":["../../src/cursor-accounts/useUpsertCursorAccount.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAI5G,sDAAsD;AACtD,MAAM,WAAW,4BAA4B;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACpE,wCAAwC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,4BAA4B,CAyBrE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks.js";
|
|
4
|
+
import { toError } from "../internal/toError.js";
|
|
5
|
+
/**
|
|
6
|
+
* Behavior hook for creating or updating a managed Cursor account.
|
|
7
|
+
*
|
|
8
|
+
* The parent should refetch its list/detail view after a successful
|
|
9
|
+
* save — org assignments affect key selection within the proxy's cache
|
|
10
|
+
* TTL (~5 minutes).
|
|
11
|
+
*/
|
|
12
|
+
export function useUpsertCursorAccount() {
|
|
13
|
+
const stigmer = useStigmer();
|
|
14
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
const upsert = useCallback(async (account) => {
|
|
17
|
+
setIsSubmitting(true);
|
|
18
|
+
setError(null);
|
|
19
|
+
try {
|
|
20
|
+
return await stigmer.cursorAccounts.upsertAccount({ account });
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
const err = toError(e);
|
|
24
|
+
setError(err);
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
setIsSubmitting(false);
|
|
29
|
+
}
|
|
30
|
+
}, [stigmer.cursorAccounts]);
|
|
31
|
+
const clearError = useCallback(() => setError(null), []);
|
|
32
|
+
return { upsert, isSubmitting, error, clearError };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=useUpsertCursorAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpsertCursorAccount.js","sourceRoot":"","sources":["../../src/cursor-accounts/useUpsertCursorAccount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAmBjD;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,OAAsB,EAA0B,EAAE;QACvD,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,eAAe,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,cAAc,CAAC,CACzB,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type DatastoreSpec } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
2
|
+
/** Props for {@link CollectionRecordsBrowser}. */
|
|
3
|
+
export interface CollectionRecordsBrowserProps {
|
|
4
|
+
/** Organization slug. */
|
|
5
|
+
readonly org: string;
|
|
6
|
+
/** Datastore slug. */
|
|
7
|
+
readonly datastoreSlug: string;
|
|
8
|
+
/** The datastore spec — collections and fields drive the grid columns. */
|
|
9
|
+
readonly spec: DatastoreSpec;
|
|
10
|
+
/** Additional CSS classes for the root container. */
|
|
11
|
+
readonly className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The records browser (DD-008 SD-3): collection selector, partition
|
|
15
|
+
* picker, schema-aware filter builder, typed-cell grid, RPC-paged
|
|
16
|
+
* navigation, and verb-gated write affordances — the console surface
|
|
17
|
+
* that absorbs the Supabase-dashboard capability the datastore
|
|
18
|
+
* primitive retires.
|
|
19
|
+
*
|
|
20
|
+
* Authorization is rendered as the two layers it is:
|
|
21
|
+
* - Write affordances gate on `describeDatastore`'s per-collection
|
|
22
|
+
* effective verbs (projections, never authority — the server's
|
|
23
|
+
* record layer stays the enforcer).
|
|
24
|
+
* - **The denied state is a first-class render**, driven primarily by
|
|
25
|
+
* empty access lists (deny-by-default renders as empty access, never
|
|
26
|
+
* an error) with a caught reach-level `PERMISSION_DENIED` as the
|
|
27
|
+
* defensive branch. Both show the relayable message plus operator
|
|
28
|
+
* guidance — never a silently empty grid.
|
|
29
|
+
*
|
|
30
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
31
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
32
|
+
*/
|
|
33
|
+
export declare function CollectionRecordsBrowser({ org, datastoreSlug, spec, className, }: CollectionRecordsBrowserProps): import("react/jsx-runtime").JSX.Element | null;
|
|
34
|
+
//# sourceMappingURL=CollectionRecordsBrowser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionRecordsBrowser.d.ts","sourceRoot":"","sources":["../../src/datastore/CollectionRecordsBrowser.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,yDAAyD,CAAC;AAuBjE,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,yBAAyB;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,GAAG,EACH,aAAa,EACb,IAAI,EACJ,SAAS,GACV,EAAE,6BAA6B,kDA6F/B"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { getUserMessage, isPermissionDenied } from "@stigmer/sdk";
|
|
7
|
+
import { DatastoreVerb, FieldType, } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
8
|
+
import { ResourceTable } from "../resource-workbench/components/ResourceTable.js";
|
|
9
|
+
import { ConfirmDialog } from "../resource-detail/ConfirmDialog.js";
|
|
10
|
+
import { useConfirmAction } from "../resource-detail/useConfirmAction.js";
|
|
11
|
+
import { toast } from "../feedback/toast.js";
|
|
12
|
+
import { FIELD_INPUT_CLASSES } from "./FieldValueControl.js";
|
|
13
|
+
import { RecordFilterBuilder } from "./RecordFilterBuilder.js";
|
|
14
|
+
import { RecordFormPanel } from "./RecordFormPanel.js";
|
|
15
|
+
import { buildRecordFilter } from "./recordFilter.js";
|
|
16
|
+
import { formatFieldValue, formatSystemTimestamp, isSortableField, } from "./recordValues.js";
|
|
17
|
+
import { useDatastoreDescription } from "./useDatastoreDescription.js";
|
|
18
|
+
import { useRecordCollection } from "./useRecordCollection.js";
|
|
19
|
+
import { useDeleteRecord } from "./useDeleteRecord.js";
|
|
20
|
+
const PAGE_SIZE = 25;
|
|
21
|
+
/**
|
|
22
|
+
* The records browser (DD-008 SD-3): collection selector, partition
|
|
23
|
+
* picker, schema-aware filter builder, typed-cell grid, RPC-paged
|
|
24
|
+
* navigation, and verb-gated write affordances — the console surface
|
|
25
|
+
* that absorbs the Supabase-dashboard capability the datastore
|
|
26
|
+
* primitive retires.
|
|
27
|
+
*
|
|
28
|
+
* Authorization is rendered as the two layers it is:
|
|
29
|
+
* - Write affordances gate on `describeDatastore`'s per-collection
|
|
30
|
+
* effective verbs (projections, never authority — the server's
|
|
31
|
+
* record layer stays the enforcer).
|
|
32
|
+
* - **The denied state is a first-class render**, driven primarily by
|
|
33
|
+
* empty access lists (deny-by-default renders as empty access, never
|
|
34
|
+
* an error) with a caught reach-level `PERMISSION_DENIED` as the
|
|
35
|
+
* defensive branch. Both show the relayable message plus operator
|
|
36
|
+
* guidance — never a silently empty grid.
|
|
37
|
+
*
|
|
38
|
+
* All visual properties flow through `--stgm-*` design tokens.
|
|
39
|
+
* Zero Console dependencies — safe for platform builder embedding.
|
|
40
|
+
*/
|
|
41
|
+
export function CollectionRecordsBrowser({ org, datastoreSlug, spec, className, }) {
|
|
42
|
+
const collections = spec.collections;
|
|
43
|
+
const [collectionName, setCollectionName] = useState(collections[0]?.name ?? "");
|
|
44
|
+
const collection = collections.find((c) => c.name === collectionName);
|
|
45
|
+
const description = useDatastoreDescription(org, datastoreSlug);
|
|
46
|
+
const [partition, setPartition] = useState("default");
|
|
47
|
+
// Filter, sort, and page state — per collection selection.
|
|
48
|
+
const [conditions, setConditions] = useState([]);
|
|
49
|
+
const [sort, setSort] = useState(null);
|
|
50
|
+
const [page, setPage] = useState(1);
|
|
51
|
+
const selectCollection = useCallback((name) => {
|
|
52
|
+
setCollectionName(name);
|
|
53
|
+
setConditions([]);
|
|
54
|
+
setSort(null);
|
|
55
|
+
setPage(1);
|
|
56
|
+
}, []);
|
|
57
|
+
const selectPartition = useCallback((name) => {
|
|
58
|
+
setPartition(name);
|
|
59
|
+
setPage(1);
|
|
60
|
+
}, []);
|
|
61
|
+
const applyConditions = useCallback((next) => {
|
|
62
|
+
setConditions(next);
|
|
63
|
+
setPage(1);
|
|
64
|
+
}, []);
|
|
65
|
+
if (collections.length === 0) {
|
|
66
|
+
return (_jsx("p", { className: cn("px-3 py-6 text-center text-sm text-muted-foreground", className), children: "This datastore declares no collections." }));
|
|
67
|
+
}
|
|
68
|
+
if (!collection)
|
|
69
|
+
return null;
|
|
70
|
+
const collectionAccess = description.description?.collections.find((c) => c.name === collection.name);
|
|
71
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: ["Collection", _jsx("select", { className: cn(FIELD_INPUT_CLASSES, "w-auto"), value: collectionName, onChange: (e) => selectCollection(e.target.value), children: collections.map((c) => (_jsx("option", { value: c.name, children: c.name }, c.name))) })] }), _jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-muted-foreground", children: ["Partition", _jsx("select", { className: cn(FIELD_INPUT_CLASSES, "w-auto"), value: partition, onChange: (e) => selectPartition(e.target.value), children: description.partitions.map((p) => (_jsx("option", { value: p, children: p }, p))) })] })] }), _jsx(RecordsPane, { org: org, datastoreSlug: datastoreSlug, collection: collection, partition: partition, conditions: conditions, onConditionsChange: applyConditions, sort: sort, onSortChange: setSort, page: page, onPageChange: setPage, access: collectionAccess, describeError: description.error, describeLoaded: description.description !== null })] }));
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// The per-collection pane: denied panel or grid
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
function RecordsPane({ org, datastoreSlug, collection, partition, conditions, onConditionsChange, sort, onSortChange, page, onPageChange, access, describeError, describeLoaded, }) {
|
|
77
|
+
const verbs = useMemo(() => {
|
|
78
|
+
const set = new Set();
|
|
79
|
+
for (const grant of access?.access ?? [])
|
|
80
|
+
set.add(grant.verb);
|
|
81
|
+
return set;
|
|
82
|
+
}, [access]);
|
|
83
|
+
const canRead = verbs.has(DatastoreVerb.read);
|
|
84
|
+
const canInsert = verbs.has(DatastoreVerb.insert);
|
|
85
|
+
const canUpdate = verbs.has(DatastoreVerb.update);
|
|
86
|
+
const canDelete = verbs.has(DatastoreVerb.delete);
|
|
87
|
+
const scope = { org, datastore: datastoreSlug, collection: collection.name, partition };
|
|
88
|
+
const filter = useMemo(() => buildRecordFilter(conditions), [conditions]);
|
|
89
|
+
const columns = useMemo(() => buildRecordColumns(collection), [collection]);
|
|
90
|
+
// Fetch only once read access is confirmed — the denied panel is the
|
|
91
|
+
// primary render for deny-by-default, not a failed query.
|
|
92
|
+
const records = useRecordCollection({
|
|
93
|
+
org: describeLoaded && canRead ? org : null,
|
|
94
|
+
datastore: datastoreSlug,
|
|
95
|
+
collection: collection.name,
|
|
96
|
+
partition,
|
|
97
|
+
filter,
|
|
98
|
+
page,
|
|
99
|
+
pageSize: PAGE_SIZE,
|
|
100
|
+
sort,
|
|
101
|
+
onSortChange,
|
|
102
|
+
columns,
|
|
103
|
+
});
|
|
104
|
+
// Row actions and write panel state.
|
|
105
|
+
const [formOpen, setFormOpen] = useState(false);
|
|
106
|
+
const [editing, setEditing] = useState(null);
|
|
107
|
+
const { confirmState, confirm, handleConfirm, handleCancel } = useConfirmAction();
|
|
108
|
+
const deleteRecord = useDeleteRecord();
|
|
109
|
+
const openInsert = useCallback(() => {
|
|
110
|
+
setEditing(null);
|
|
111
|
+
setFormOpen(true);
|
|
112
|
+
}, []);
|
|
113
|
+
const openEdit = useCallback((record) => {
|
|
114
|
+
setEditing(record);
|
|
115
|
+
setFormOpen(true);
|
|
116
|
+
}, []);
|
|
117
|
+
// Deps narrowed to the specific stable callbacks used (DD-010).
|
|
118
|
+
const deleteRecordFn = deleteRecord.deleteRecord;
|
|
119
|
+
const refetchRecords = records.refetch;
|
|
120
|
+
const collectionName = collection.name;
|
|
121
|
+
const handleDelete = useCallback(async (record) => {
|
|
122
|
+
const ok = await confirm({
|
|
123
|
+
title: "Delete record?",
|
|
124
|
+
description: `Record ${record.id} will be permanently deleted.`,
|
|
125
|
+
confirmLabel: "Delete",
|
|
126
|
+
variant: "destructive",
|
|
127
|
+
});
|
|
128
|
+
if (!ok)
|
|
129
|
+
return;
|
|
130
|
+
try {
|
|
131
|
+
await deleteRecordFn({
|
|
132
|
+
org,
|
|
133
|
+
datastore: datastoreSlug,
|
|
134
|
+
collection: collectionName,
|
|
135
|
+
partition,
|
|
136
|
+
id: record.id,
|
|
137
|
+
});
|
|
138
|
+
toast.success("Record deleted");
|
|
139
|
+
refetchRecords();
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
toast.error(getUserMessage(err));
|
|
143
|
+
}
|
|
144
|
+
}, [confirm, deleteRecordFn, refetchRecords, org, datastoreSlug, collectionName, partition]);
|
|
145
|
+
// --- Denied states (DD-008 SD-3): first-class renders ---------------------
|
|
146
|
+
if (describeError && isPermissionDenied(describeError)) {
|
|
147
|
+
return _jsx(DeniedPanel, { message: getUserMessage(describeError) });
|
|
148
|
+
}
|
|
149
|
+
if (describeLoaded && !canRead) {
|
|
150
|
+
return (_jsx(DeniedPanel, { message: `You do not have record access to “${collection.name}”.` }));
|
|
151
|
+
}
|
|
152
|
+
if (records.error && isPermissionDenied(records.error)) {
|
|
153
|
+
return _jsx(DeniedPanel, { message: getUserMessage(records.error) });
|
|
154
|
+
}
|
|
155
|
+
const totalPages = Math.max(records.totalPages, 1);
|
|
156
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(RecordFilterBuilder, { collection: collection, conditions: conditions, onChange: onConditionsChange, className: "min-w-0 flex-1" }), canInsert && (_jsx("button", { type: "button", onClick: openInsert, className: cn("shrink-0 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground", "hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Insert record" }))] }), records.error ? (_jsx("div", { role: "alert", className: "rounded-md border border-destructive bg-card px-3 py-2 text-sm text-destructive", children: getUserMessage(records.error) })) : records.isLoading ? (_jsx("div", { className: "rounded-lg border border-border px-3 py-6 text-center text-sm text-muted-foreground", children: "Loading records\u2026" })) : records.records.length === 0 ? (_jsx("div", { className: "rounded-lg border border-border px-3 py-6 text-center text-sm text-muted-foreground", children: conditions.length > 0
|
|
157
|
+
? "No records match the current filters."
|
|
158
|
+
: `No records in “${collection.name}” yet.` })) : (records.table && (_jsx("div", { className: "overflow-x-auto rounded-lg border border-border", children: _jsx(ResourceTable, { table: records.table, "aria-label": `Records in ${collection.name}`, renderRowAction: canUpdate || canDelete
|
|
159
|
+
? (record) => (_jsx(RowActions, { record: record, canUpdate: canUpdate, canDelete: canDelete, onEdit: openEdit, onDelete: handleDelete }))
|
|
160
|
+
: undefined }) }))), _jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [_jsxs("span", { children: [records.total, " record", records.total === 1 ? "" : "s"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("button", { type: "button", onClick: () => onPageChange(page - 1), disabled: page <= 1, className: paginationButtonClass, children: "Previous" }), _jsxs("span", { children: ["Page ", page, " of ", totalPages] }), _jsx("button", { type: "button", onClick: () => onPageChange(page + 1), disabled: page >= totalPages, className: paginationButtonClass, children: "Next" })] })] }), _jsx(RecordFormPanel, { open: formOpen, onOpenChange: setFormOpen, scope: scope, collection: collection, record: editing, onSaved: () => records.refetch() }), _jsx(ConfirmDialog, { state: confirmState, onConfirm: handleConfirm, onCancel: handleCancel })] }));
|
|
161
|
+
}
|
|
162
|
+
const paginationButtonClass = 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");
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
164
|
+
// Denied panel — an explanation, never an empty grid
|
|
165
|
+
// ---------------------------------------------------------------------------
|
|
166
|
+
function DeniedPanel({ message }) {
|
|
167
|
+
return (_jsxs("div", { role: "status", className: "flex flex-col items-center gap-2 rounded-lg border border-border bg-muted px-4 py-8 text-center", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: message }), _jsxs("p", { className: "max-w-md text-xs text-muted-foreground", children: ["Record access is granted by the datastore's authorization block. To gain access, add a role binding for your principal or set a", " ", _jsx("code", { className: "font-mono", children: "default_role" }), " in the datastore YAML, with the verbs you need granted on this collection."] })] }));
|
|
168
|
+
}
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
// Columns: typed cells from FieldDeclaration + system columns
|
|
171
|
+
// ---------------------------------------------------------------------------
|
|
172
|
+
/**
|
|
173
|
+
* Grid columns for a collection: declared fields with typed cells, then
|
|
174
|
+
* `created_at` (visible by default). The remaining system columns
|
|
175
|
+
* (`id`, `updated_at`, `created_by`) stay out of the default grid —
|
|
176
|
+
* they are shown in the record form's read-only summary; a column
|
|
177
|
+
* toggle is recorded growth.
|
|
178
|
+
*/
|
|
179
|
+
function buildRecordColumns(collection) {
|
|
180
|
+
const fieldColumns = collection.fields.map((field) => ({
|
|
181
|
+
id: field.name,
|
|
182
|
+
header: field.name,
|
|
183
|
+
sortable: isSortableField(field),
|
|
184
|
+
cell: (record) => (_jsx(TypedCell, { value: formatFieldValue(field.type, record.fields?.[field.name]), numeric: field.type === FieldType.integer || field.type === FieldType.number, mono: field.type === FieldType.json })),
|
|
185
|
+
}));
|
|
186
|
+
return [
|
|
187
|
+
...fieldColumns,
|
|
188
|
+
{
|
|
189
|
+
id: "created_at",
|
|
190
|
+
header: "created_at",
|
|
191
|
+
sortable: true,
|
|
192
|
+
cell: (record) => (_jsx(TypedCell, { value: record.createdAt
|
|
193
|
+
? formatSystemTimestamp(timestampDate(record.createdAt).toISOString())
|
|
194
|
+
: "", mono: true })),
|
|
195
|
+
},
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
function TypedCell({ value, numeric, mono, }) {
|
|
199
|
+
const truncated = value.length > 80 ? `${value.slice(0, 79)}…` : value;
|
|
200
|
+
return (_jsx("span", { title: value.length > 80 ? value : undefined, className: cn("block max-w-xs truncate", numeric && "text-right tabular-nums", mono && "font-mono"), children: truncated }));
|
|
201
|
+
}
|
|
202
|
+
// ---------------------------------------------------------------------------
|
|
203
|
+
// Row actions
|
|
204
|
+
// ---------------------------------------------------------------------------
|
|
205
|
+
function RowActions({ record, canUpdate, canDelete, onEdit, onDelete, }) {
|
|
206
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [canUpdate && (_jsx("button", { type: "button", onClick: () => onEdit(record), "aria-label": `Edit record ${record.id}`, className: rowActionClass, children: "Edit" })), canDelete && (_jsx("button", { type: "button", onClick: () => onDelete(record), "aria-label": `Delete record ${record.id}`, className: cn(rowActionClass, "text-destructive hover:text-destructive"), children: "Delete" }))] }));
|
|
207
|
+
}
|
|
208
|
+
const rowActionClass = cn("rounded-md px-1.5 py-0.5 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");
|
|
209
|
+
//# sourceMappingURL=CollectionRecordsBrowser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionRecordsBrowser.js","sourceRoot":"","sources":["../../src/datastore/CollectionRecordsBrowser.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,aAAa,EACb,SAAS,GAGV,MAAM,yDAAyD,CAAC;AAKjE,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAA6B,MAAM,mBAAmB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,GACh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AI,WAAW,CACpB,YAEA,SAAS,GACL,CACR,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,SAAS,UAAU,CAAC,EAClB,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,GAOT;IACC,OAAO,CACL,eAAK,SAAS,EAAC,yBAAyB,aACrC,SAAS,IAAI,CACZ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,gBACjB,eAAe,MAAM,CAAC,EAAE,EAAE,EACtC,SAAS,EAAE,cAAc,qBAGlB,CACV,EACA,SAAS,IAAI,CACZ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,gBACnB,iBAAiB,MAAM,CAAC,EAAE,EAAE,EACxC,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,yCAAyC,CAAC,uBAGjE,CACV,IACG,CACP,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,EAAE,CACvB,oEAAoE,EACpE,uCAAuC,EACvC,yEAAyE,CAC1E,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type DatastoreSpec, type DatastoreSubject } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
2
|
+
/** Props for {@link CollectionSchemaView}. */
|
|
3
|
+
export interface CollectionSchemaViewProps {
|
|
4
|
+
/** The datastore spec — the authoritative source for structure (DD-008 SD-5). */
|
|
5
|
+
readonly spec: DatastoreSpec;
|
|
6
|
+
/** Additional CSS classes for the root container. */
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
}
|
|
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 declare function CollectionSchemaView({ spec, className }: CollectionSchemaViewProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Plain kind+value rendering of a datastore subject (DD-008 SD-3: the
|
|
26
|
+
* grant system is the privacy boundary; display is honest).
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatSubject(subject: DatastoreSubject | undefined): string;
|
|
29
|
+
//# sourceMappingURL=CollectionSchemaView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollectionSchemaView.d.ts","sourceRoot":"","sources":["../../src/datastore/CollectionSchemaView.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,yDAAyD,CAAC;AAIjE,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,yBAAyB,2CASlF;AA0ED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAa3E"}
|