@stigmer/react 3.2.3 → 3.4.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/index.d.ts.map +1 -1
- package/billing/index.js +4 -0
- package/billing/index.js.map +1 -1
- 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 +34 -0
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountEditor.js +67 -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 +32 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.js +169 -0
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
- package/cursor-accounts/MemberCoverageTable.d.ts +29 -0
- package/cursor-accounts/MemberCoverageTable.d.ts.map +1 -0
- package/cursor-accounts/MemberCoverageTable.js +150 -0
- package/cursor-accounts/MemberCoverageTable.js.map +1 -0
- package/cursor-accounts/MemberKeysPanel.d.ts +25 -0
- package/cursor-accounts/MemberKeysPanel.d.ts.map +1 -0
- package/cursor-accounts/MemberKeysPanel.js +115 -0
- package/cursor-accounts/MemberKeysPanel.js.map +1 -0
- package/cursor-accounts/badges.d.ts +9 -0
- package/cursor-accounts/badges.d.ts.map +1 -0
- package/cursor-accounts/badges.js +10 -0
- package/cursor-accounts/badges.js.map +1 -0
- package/cursor-accounts/cursor-account-coverage.d.ts +41 -0
- package/cursor-accounts/cursor-account-coverage.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-coverage.js +26 -0
- package/cursor-accounts/cursor-account-coverage.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +23 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-format.js +41 -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 +223 -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 +37 -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 +62 -0
- package/datastore/recordFilter.d.ts.map +1 -0
- package/datastore/recordFilter.js +104 -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/execution/ExecutionProgress.d.ts.map +1 -1
- package/execution/ExecutionProgress.js +13 -4
- package/execution/ExecutionProgress.js.map +1 -1
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +10 -2
- package/execution/MessageThread.js.map +1 -1
- package/execution/useCreateAgentExecution.d.ts +31 -1
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js +2 -0
- package/execution/useCreateAgentExecution.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 -4
- package/index.d.ts.map +1 -1
- package/index.js +18 -3
- package/index.js.map +1 -1
- package/internal/form-primitives.d.ts +10 -0
- package/internal/form-primitives.d.ts.map +1 -0
- package/internal/form-primitives.js +15 -0
- package/internal/form-primitives.js.map +1 -0
- 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/pricing-governance/BaselineEditor.d.ts +9 -0
- package/pricing-governance/BaselineEditor.d.ts.map +1 -0
- package/pricing-governance/BaselineEditor.js +270 -0
- package/pricing-governance/BaselineEditor.js.map +1 -0
- package/pricing-governance/ModelCatalogPanel.d.ts +28 -0
- package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
- package/pricing-governance/ModelCatalogPanel.js +102 -0
- package/pricing-governance/ModelCatalogPanel.js.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.d.ts +8 -0
- package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.js +64 -0
- package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
- package/pricing-governance/OperatorAccessNotice.d.ts +12 -0
- package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
- package/pricing-governance/OperatorAccessNotice.js +15 -0
- package/pricing-governance/OperatorAccessNotice.js.map +1 -0
- package/pricing-governance/PricingGovernanceConsole.d.ts +57 -0
- package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
- package/pricing-governance/PricingGovernanceConsole.js +164 -0
- package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
- package/pricing-governance/PricingGovernancePanel.d.ts +26 -0
- package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
- package/pricing-governance/PricingGovernancePanel.js +64 -0
- package/pricing-governance/PricingGovernancePanel.js.map +1 -0
- package/pricing-governance/RetireConfirm.d.ts +9 -0
- package/pricing-governance/RetireConfirm.d.ts.map +1 -0
- package/pricing-governance/RetireConfirm.js +19 -0
- package/pricing-governance/RetireConfirm.js.map +1 -0
- package/pricing-governance/governance-primitives.d.ts +33 -0
- package/pricing-governance/governance-primitives.d.ts.map +1 -0
- package/pricing-governance/governance-primitives.js +43 -0
- package/pricing-governance/governance-primitives.js.map +1 -0
- package/pricing-governance/index.d.ts +19 -0
- package/pricing-governance/index.d.ts.map +1 -0
- package/pricing-governance/index.js +20 -0
- package/pricing-governance/index.js.map +1 -0
- package/pricing-governance/pricing-format.d.ts +12 -0
- package/pricing-governance/pricing-format.d.ts.map +1 -0
- package/pricing-governance/pricing-format.js +50 -0
- package/pricing-governance/pricing-format.js.map +1 -0
- package/pricing-governance/useDecidePricingOverride.d.ts +46 -0
- package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
- package/pricing-governance/useDecidePricingOverride.js +44 -0
- package/pricing-governance/useDecidePricingOverride.js.map +1 -0
- package/pricing-governance/useModelGovernanceView.d.ts +103 -0
- package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
- package/pricing-governance/useModelGovernanceView.js +144 -0
- package/pricing-governance/useModelGovernanceView.js.map +1 -0
- package/pricing-governance/useModelPricingBaselines.d.ts +40 -0
- package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
- package/pricing-governance/useModelPricingBaselines.js +32 -0
- package/pricing-governance/useModelPricingBaselines.js.map +1 -0
- package/pricing-governance/usePricingGovernance.d.ts +39 -0
- package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
- package/pricing-governance/usePricingGovernance.js +31 -0
- package/pricing-governance/usePricingGovernance.js.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.d.ts +31 -0
- package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.js +36 -0
- package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.d.ts +38 -0
- package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.js +37 -0
- package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
- package/resource-creation/templates/workflow-templates.js +4 -4
- package/session/useCreateSession.d.ts +28 -0
- package/session/useCreateSession.d.ts.map +1 -1
- package/session/useCreateSession.js +2 -1
- package/session/useCreateSession.js.map +1 -1
- package/session/useEditSessionPrep.js +3 -3
- package/session/useEditSessionPrep.js.map +1 -1
- package/session/useNewSessionFlow.d.ts +30 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +7 -1
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useUpdateSession.d.ts +29 -10
- package/session/useUpdateSession.d.ts.map +1 -1
- package/session/useUpdateSession.js +29 -10
- package/session/useUpdateSession.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/index.ts +5 -0
- package/src/channel/AgentChannelsPanel.tsx +27 -1
- package/src/composer/SessionComposer.tsx +1 -1
- package/src/cursor-accounts/CursorAccountEditor.tsx +229 -0
- package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
- package/src/cursor-accounts/CursorAccountsConsole.tsx +454 -0
- package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
- package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +680 -0
- package/src/cursor-accounts/__tests__/cursor-account-coverage.test.ts +73 -0
- package/src/cursor-accounts/badges.tsx +26 -0
- package/src/cursor-accounts/cursor-account-coverage.ts +71 -0
- package/src/cursor-accounts/cursor-account-format.ts +45 -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 +570 -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 +422 -0
- package/src/datastore/RecordFormPanel.tsx +432 -0
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +245 -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 +155 -0
- package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
- package/src/datastore/__tests__/recordFilter.test.ts +169 -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 +154 -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/ExecutionProgress.tsx +14 -4
- package/src/execution/MessageThread.tsx +10 -2
- package/src/execution/__tests__/ExecutionProgress.test.tsx +67 -0
- package/src/execution/__tests__/MessageThread.test.tsx +44 -0
- package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
- package/src/execution/__tests__/useCreateAgentExecution.test.tsx +86 -0
- package/src/execution/useCreateAgentExecution.ts +41 -6
- 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 +172 -14
- package/src/internal/form-primitives.tsx +40 -0
- 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/pricing-governance/BaselineEditor.tsx +652 -0
- package/src/pricing-governance/ModelCatalogPanel.tsx +283 -0
- package/src/pricing-governance/ModelGovernanceDetail.tsx +289 -0
- package/src/pricing-governance/OperatorAccessNotice.tsx +32 -0
- package/src/pricing-governance/PricingGovernanceConsole.tsx +465 -0
- package/src/pricing-governance/PricingGovernancePanel.tsx +166 -0
- package/src/pricing-governance/RetireConfirm.tsx +82 -0
- package/src/pricing-governance/__tests__/ModelCatalogPanel.test.tsx +253 -0
- package/src/pricing-governance/__tests__/PricingGovernanceConsole.test.tsx +410 -0
- package/src/pricing-governance/__tests__/useModelGovernanceView.test.tsx +308 -0
- package/src/pricing-governance/governance-primitives.tsx +133 -0
- package/src/pricing-governance/index.ts +50 -0
- package/src/pricing-governance/pricing-format.ts +53 -0
- package/src/pricing-governance/useDecidePricingOverride.ts +78 -0
- package/src/pricing-governance/useModelGovernanceView.ts +290 -0
- package/src/pricing-governance/useModelPricingBaselines.ts +69 -0
- package/src/pricing-governance/usePricingGovernance.ts +57 -0
- package/src/pricing-governance/useRetireModelPricingBaseline.ts +65 -0
- package/src/pricing-governance/useUpsertModelPricingBaseline.ts +72 -0
- package/src/resource-creation/templates/workflow-templates.ts +4 -4
- package/src/session/__tests__/useCreateSession.test.tsx +94 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
- package/src/session/useCreateSession.ts +30 -0
- package/src/session/useEditSessionPrep.ts +3 -3
- package/src/session/useNewSessionFlow.ts +45 -1
- package/src/session/useUpdateSession.ts +29 -10
- 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,73 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { create } from "@bufbuild/protobuf";
|
|
3
|
+
import {
|
|
4
|
+
CursorAccountSyncSnapshotSchema,
|
|
5
|
+
CursorMemberKeySchema,
|
|
6
|
+
CursorMemberSpendSchema,
|
|
7
|
+
CursorTeamMemberSchema,
|
|
8
|
+
} from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
9
|
+
import {
|
|
10
|
+
CursorAccountViewSchema,
|
|
11
|
+
CursorMemberKeyState,
|
|
12
|
+
CursorMemberKeyViewSchema,
|
|
13
|
+
CursorTeamMemberViewSchema,
|
|
14
|
+
} from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
|
|
15
|
+
import { deriveCoverage } from "../cursor-account-coverage";
|
|
16
|
+
|
|
17
|
+
function keyView(keyId: string, state: CursorMemberKeyState) {
|
|
18
|
+
return create(CursorMemberKeyViewSchema, {
|
|
19
|
+
key: create(CursorMemberKeySchema, { keyId, boundEmail: `${keyId}@x.ai` }),
|
|
20
|
+
state,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe("deriveCoverage", () => {
|
|
25
|
+
it("groups keys by server-computed state and passes coverage-gap rows through", () => {
|
|
26
|
+
const active = keyView("k-active", CursorMemberKeyState.member_key_active);
|
|
27
|
+
const removed = keyView("k-removed", CursorMemberKeyState.member_key_owner_removed);
|
|
28
|
+
const stranger = keyView("k-stranger", CursorMemberKeyState.member_key_owner_unknown);
|
|
29
|
+
const gap = create(CursorTeamMemberViewSchema, {
|
|
30
|
+
member: create(CursorTeamMemberSchema, { email: "uncovered@x.ai", role: "member" }),
|
|
31
|
+
spend: create(CursorMemberSpendSchema, { includedSpendUsdMicros: BigInt(42_000) }),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const coverage = deriveCoverage(
|
|
35
|
+
create(CursorAccountViewSchema, {
|
|
36
|
+
snapshot: create(CursorAccountSyncSnapshotSchema, { accountId: "acc-1" }),
|
|
37
|
+
keyViews: [active, removed, stranger],
|
|
38
|
+
membersWithoutKeysViews: [gap],
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
expect(coverage.hasRoster).toBe(true);
|
|
43
|
+
expect(coverage.onTeamWithKey).toEqual([active]);
|
|
44
|
+
expect(coverage.onTeamWithoutKey).toEqual([gap]);
|
|
45
|
+
// Both "left the team" and "never on it" resolve the same way (a
|
|
46
|
+
// Cursor dashboard invite), so they share the category; the per-key
|
|
47
|
+
// state still distinguishes their labels.
|
|
48
|
+
expect(coverage.offTeamWithKey).toEqual([removed, stranger]);
|
|
49
|
+
expect(coverage.unclassified).toEqual([]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("withholds classification before the first sync — owner-unknown is missing data, not off-team", () => {
|
|
53
|
+
const key = keyView("k-1", CursorMemberKeyState.member_key_owner_unknown);
|
|
54
|
+
|
|
55
|
+
const coverage = deriveCoverage(
|
|
56
|
+
create(CursorAccountViewSchema, { keyViews: [key] }),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
expect(coverage.hasRoster).toBe(false);
|
|
60
|
+
expect(coverage.unclassified).toEqual([key]);
|
|
61
|
+
expect(coverage.onTeamWithKey).toEqual([]);
|
|
62
|
+
expect(coverage.onTeamWithoutKey).toEqual([]);
|
|
63
|
+
expect(coverage.offTeamWithKey).toEqual([]);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("handles the empty account (no keys, no roster) without inventing rows", () => {
|
|
67
|
+
const coverage = deriveCoverage(create(CursorAccountViewSchema, {}));
|
|
68
|
+
|
|
69
|
+
expect(coverage.hasRoster).toBe(false);
|
|
70
|
+
expect(coverage.unclassified).toEqual([]);
|
|
71
|
+
expect(coverage.onTeamWithKey).toEqual([]);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from "@stigmer/theme";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Small tonal status badge shared by the cursor-accounts surfaces
|
|
5
|
+
* (account rows, coverage table cells). Internal to the module.
|
|
6
|
+
*/
|
|
7
|
+
export function StateBadge({
|
|
8
|
+
tone,
|
|
9
|
+
label,
|
|
10
|
+
}: {
|
|
11
|
+
readonly tone: "ok" | "warn" | "muted";
|
|
12
|
+
readonly label: string;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<span
|
|
16
|
+
className={cn(
|
|
17
|
+
"inline-block rounded px-1.5 py-0.5 text-[10px] font-medium",
|
|
18
|
+
tone === "ok" && "bg-accent text-primary",
|
|
19
|
+
tone === "warn" && "bg-muted-subtle text-destructive",
|
|
20
|
+
tone === "muted" && "bg-muted-subtle text-muted-foreground",
|
|
21
|
+
)}
|
|
22
|
+
>
|
|
23
|
+
{label}
|
|
24
|
+
</span>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CursorMemberKeyState,
|
|
3
|
+
type CursorAccountView,
|
|
4
|
+
type CursorMemberKeyView,
|
|
5
|
+
type CursorTeamMemberView,
|
|
6
|
+
} from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The account's roster coverage, grouped for the operator table. Pure
|
|
10
|
+
* regrouping of server-computed facts — the membership classification
|
|
11
|
+
* (`CursorMemberKeyState`) and the spend joins are computed by the
|
|
12
|
+
* backend on read (the same email rule key selection uses); this module
|
|
13
|
+
* must never re-derive them from emails or role strings.
|
|
14
|
+
*/
|
|
15
|
+
export interface CursorAccountCoverage {
|
|
16
|
+
/**
|
|
17
|
+
* Whether a roster snapshot backs the classification. Before the first
|
|
18
|
+
* sync every key reports "owner unknown" — that is missing data, not
|
|
19
|
+
* "not on the team", so classification is withheld (`unclassified`)
|
|
20
|
+
* until a sync has run.
|
|
21
|
+
*/
|
|
22
|
+
readonly hasRoster: boolean;
|
|
23
|
+
/** On the team, execution key held — the account's routable capacity. */
|
|
24
|
+
readonly onTeamWithKey: readonly CursorMemberKeyView[];
|
|
25
|
+
/**
|
|
26
|
+
* On the team, no execution key — the coverage gap. Sessions can never
|
|
27
|
+
* run under these members' identities or included quotas. Spend comes
|
|
28
|
+
* server-joined so the operator can prioritize whose key to import.
|
|
29
|
+
*/
|
|
30
|
+
readonly onTeamWithoutKey: readonly CursorTeamMemberView[];
|
|
31
|
+
/**
|
|
32
|
+
* Key held, owner not on the team: either left it (roster role
|
|
33
|
+
* "removed") or never appeared in the roster — the per-key state
|
|
34
|
+
* distinguishes the two. Resolving this category means inviting the
|
|
35
|
+
* owner on the Cursor dashboard; the next sync reclassifies.
|
|
36
|
+
*/
|
|
37
|
+
readonly offTeamWithKey: readonly CursorMemberKeyView[];
|
|
38
|
+
/** Every key, only while no roster snapshot exists (empty otherwise). */
|
|
39
|
+
readonly unclassified: readonly CursorMemberKeyView[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Group one account view into the three coverage categories (plus the
|
|
44
|
+
* pre-first-sync "unclassified" holding state). Server order is
|
|
45
|
+
* preserved within each group.
|
|
46
|
+
*/
|
|
47
|
+
export function deriveCoverage(view: CursorAccountView): CursorAccountCoverage {
|
|
48
|
+
const hasRoster = view.snapshot !== undefined;
|
|
49
|
+
|
|
50
|
+
if (!hasRoster) {
|
|
51
|
+
return {
|
|
52
|
+
hasRoster,
|
|
53
|
+
onTeamWithKey: [],
|
|
54
|
+
onTeamWithoutKey: [],
|
|
55
|
+
offTeamWithKey: [],
|
|
56
|
+
unclassified: view.keyViews,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
hasRoster,
|
|
62
|
+
onTeamWithKey: view.keyViews.filter(
|
|
63
|
+
(kv) => kv.state === CursorMemberKeyState.member_key_active,
|
|
64
|
+
),
|
|
65
|
+
onTeamWithoutKey: view.membersWithoutKeysViews,
|
|
66
|
+
offTeamWithKey: view.keyViews.filter(
|
|
67
|
+
(kv) => kv.state !== CursorMemberKeyState.member_key_active,
|
|
68
|
+
),
|
|
69
|
+
unclassified: [],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
2
|
+
|
|
3
|
+
// BigInt literals (0n) require an ES2020 target, which not every consuming
|
|
4
|
+
// app's tsconfig guarantees — the constructor form is target-agnostic (the
|
|
5
|
+
// pricing-governance pricing-format precedent).
|
|
6
|
+
const ZERO = BigInt(0);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Micro-USD to a display dollar string (e.g. `169342n` → `"$0.17"`).
|
|
10
|
+
* Spend figures are Cursor-reported cycle totals — two decimals is the
|
|
11
|
+
* honest precision for a monitoring surface.
|
|
12
|
+
*/
|
|
13
|
+
export function formatSpendMicros(micros: bigint): string {
|
|
14
|
+
const dollars = Number(micros) / 1_000_000;
|
|
15
|
+
return `$${dollars.toFixed(2)}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Proto Timestamp to a compact local date-time (e.g. "Jul 22, 14:05"). */
|
|
19
|
+
export function formatSyncTime(ts: Timestamp | undefined): string {
|
|
20
|
+
if (!ts || ts.seconds === ZERO) {
|
|
21
|
+
return "never";
|
|
22
|
+
}
|
|
23
|
+
return new Date(Number(ts.seconds) * 1000).toLocaleString(undefined, {
|
|
24
|
+
month: "short",
|
|
25
|
+
day: "numeric",
|
|
26
|
+
hour: "2-digit",
|
|
27
|
+
minute: "2-digit",
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Cursor's pool-usage percent (0–100, live-verified) to a display string
|
|
33
|
+
* (`26.97` → `"27%"`, `0` → `"0%"`).
|
|
34
|
+
*
|
|
35
|
+
* Zero renders as "0%", matching Cursor's own Members page. An earlier
|
|
36
|
+
* revision suppressed it on the theory that Cursor only omits percent
|
|
37
|
+
* fields on non-tiered teams (so a stored 0 meant "unreported") — live
|
|
38
|
+
* data falsified that: Cursor also omits them for zero-usage members on
|
|
39
|
+
* tiered Team plans, where its dashboard shows "0%". The "unreported"
|
|
40
|
+
* signal is the absence of the member's whole spend row (the caller's
|
|
41
|
+
* em-dash case), not a zero field inside one.
|
|
42
|
+
*/
|
|
43
|
+
export function formatPoolPercent(percent: number): string {
|
|
44
|
+
return `${Math.round(percent)}%`;
|
|
45
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Data hooks
|
|
2
|
+
export { useCursorAccounts } from "./useCursorAccounts.js";
|
|
3
|
+
export type { UseCursorAccountsReturn } from "./useCursorAccounts.js";
|
|
4
|
+
export { useCursorAccountView } from "./useCursorAccountView.js";
|
|
5
|
+
export type { UseCursorAccountViewReturn } from "./useCursorAccountView.js";
|
|
6
|
+
|
|
7
|
+
// Behavior hooks
|
|
8
|
+
export { useUpsertCursorAccount } from "./useUpsertCursorAccount.js";
|
|
9
|
+
export type { UseUpsertCursorAccountReturn } from "./useUpsertCursorAccount.js";
|
|
10
|
+
export { useDeleteCursorAccount } from "./useDeleteCursorAccount.js";
|
|
11
|
+
export type {
|
|
12
|
+
DeleteCursorAccountInput,
|
|
13
|
+
UseDeleteCursorAccountReturn,
|
|
14
|
+
} from "./useDeleteCursorAccount.js";
|
|
15
|
+
export { useCursorMemberKeyActions } from "./useCursorMemberKeyActions.js";
|
|
16
|
+
export type {
|
|
17
|
+
AddCursorMemberKeyInput,
|
|
18
|
+
RemoveCursorMemberKeyInput,
|
|
19
|
+
UseCursorMemberKeyActionsReturn,
|
|
20
|
+
} from "./useCursorMemberKeyActions.js";
|
|
21
|
+
export { useSyncCursorAccount } from "./useSyncCursorAccount.js";
|
|
22
|
+
export type { UseSyncCursorAccountReturn } from "./useSyncCursorAccount.js";
|
|
23
|
+
|
|
24
|
+
// Styled components
|
|
25
|
+
export { CursorAccountsConsole } from "./CursorAccountsConsole.js";
|
|
26
|
+
export type { CursorAccountsConsoleProps } from "./CursorAccountsConsole.js";
|
|
27
|
+
export { CursorAccountEditor } from "./CursorAccountEditor.js";
|
|
28
|
+
export type { CursorAccountEditorProps } from "./CursorAccountEditor.js";
|
|
29
|
+
export { CursorAccountsAccessNotice } from "./CursorAccountsAccessNotice.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { CursorAccountView } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
|
|
4
|
+
import { useStigmer } from "../hooks.js";
|
|
5
|
+
import { useFetch } from "../internal/useFetch.js";
|
|
6
|
+
|
|
7
|
+
/** Return value of {@link useCursorAccountView}. */
|
|
8
|
+
export interface UseCursorAccountViewReturn {
|
|
9
|
+
/** The detail view, or `null` before the first successful fetch. */
|
|
10
|
+
readonly view: CursorAccountView | null;
|
|
11
|
+
/** `true` while the initial fetch is in flight. */
|
|
12
|
+
readonly isLoading: boolean;
|
|
13
|
+
/** `true` while a background refetch is in flight and stale data is shown. */
|
|
14
|
+
readonly isRefetching: boolean;
|
|
15
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Discard cached data and re-fetch from the server. */
|
|
18
|
+
readonly refetch: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Data hook for one Cursor account's detail view: the redacted account,
|
|
23
|
+
* the latest roster/spend snapshot, and the server-computed coverage
|
|
24
|
+
* join (per-key owner state and cycle spend, active members without
|
|
25
|
+
* keys).
|
|
26
|
+
*
|
|
27
|
+
* Pass `null` as `accountId` to skip fetching (e.g. while the console is
|
|
28
|
+
* on the list phase).
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const { view, isLoading, refetch } = useCursorAccountView(accountId);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function useCursorAccountView(
|
|
36
|
+
accountId: string | null,
|
|
37
|
+
): UseCursorAccountViewReturn {
|
|
38
|
+
const stigmer = useStigmer();
|
|
39
|
+
|
|
40
|
+
const { data: view, isLoading, isRefetching, error, refetch } = useFetch(
|
|
41
|
+
accountId
|
|
42
|
+
? () => stigmer.cursorAccounts.getAccountView(accountId)
|
|
43
|
+
: null,
|
|
44
|
+
[accountId, stigmer],
|
|
45
|
+
null as CursorAccountView | null,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return { view, isLoading, isRefetching, error, refetch };
|
|
49
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { CursorAccountsResponse } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
|
|
4
|
+
import { useStigmer } from "../hooks.js";
|
|
5
|
+
import { useFetch } from "../internal/useFetch.js";
|
|
6
|
+
|
|
7
|
+
/** Return value of {@link useCursorAccounts}. */
|
|
8
|
+
export interface UseCursorAccountsReturn {
|
|
9
|
+
/** The account summaries, or `null` before the first successful fetch. */
|
|
10
|
+
readonly accounts: CursorAccountsResponse | null;
|
|
11
|
+
/** `true` while the initial fetch is in flight. */
|
|
12
|
+
readonly isLoading: boolean;
|
|
13
|
+
/** `true` while a background refetch is in flight and stale data is shown. */
|
|
14
|
+
readonly isRefetching: boolean;
|
|
15
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Discard cached data and re-fetch from the server. */
|
|
18
|
+
readonly refetch: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Data hook that lists every managed Cursor account with its routing and
|
|
23
|
+
* sync summary (enabled member key count, last-synced timestamp). Key
|
|
24
|
+
* material is always redacted server-side.
|
|
25
|
+
*
|
|
26
|
+
* Platform-operator surface: the caller needs
|
|
27
|
+
* `can_manage_cursor_accounts` on `platform:stigmer`.
|
|
28
|
+
*
|
|
29
|
+
* Pass `enabled: false` to skip fetching (stable no-op).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const { accounts, isLoading, refetch } = useCursorAccounts();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function useCursorAccounts(
|
|
37
|
+
options?: { readonly enabled?: boolean },
|
|
38
|
+
): UseCursorAccountsReturn {
|
|
39
|
+
const stigmer = useStigmer();
|
|
40
|
+
const enabled = options?.enabled ?? true;
|
|
41
|
+
|
|
42
|
+
const { data: accounts, isLoading, isRefetching, error, refetch } = useFetch(
|
|
43
|
+
enabled ? () => stigmer.cursorAccounts.listAccounts() : null,
|
|
44
|
+
[enabled, stigmer],
|
|
45
|
+
null as CursorAccountsResponse | null,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
return { accounts, isLoading, isRefetching, error, refetch };
|
|
49
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
5
|
+
import { useStigmer } from "../hooks.js";
|
|
6
|
+
import { toError } from "../internal/toError.js";
|
|
7
|
+
|
|
8
|
+
/** Input for adding one member key. */
|
|
9
|
+
export interface AddCursorMemberKeyInput {
|
|
10
|
+
readonly accountId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Plaintext user-scoped Cursor API key. The server identifies it via
|
|
13
|
+
* Cursor's `/v1/me` and binds it to its owning team member; admin and
|
|
14
|
+
* service-account keys are rejected with Cursor's own explanation —
|
|
15
|
+
* surface the error verbatim.
|
|
16
|
+
*/
|
|
17
|
+
readonly apiKey: string;
|
|
18
|
+
/** Optional operator label. */
|
|
19
|
+
readonly label?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Input for removing one member key. */
|
|
23
|
+
export interface RemoveCursorMemberKeyInput {
|
|
24
|
+
readonly accountId: string;
|
|
25
|
+
readonly keyId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Removal is refused while live sessions are pinned to this key.
|
|
28
|
+
* `force: true` overrides; prefer disabling (always safe).
|
|
29
|
+
*/
|
|
30
|
+
readonly force?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Return value of {@link useCursorMemberKeyActions}. */
|
|
34
|
+
export interface UseCursorMemberKeyActionsReturn {
|
|
35
|
+
/** Add one execution-capable member key. Returns the redacted account. */
|
|
36
|
+
readonly addKey: (input: AddCursorMemberKeyInput) => Promise<CursorAccount>;
|
|
37
|
+
/** Remove one member key (live-pin guarded). */
|
|
38
|
+
readonly removeKey: (input: RemoveCursorMemberKeyInput) => Promise<CursorAccount>;
|
|
39
|
+
/** Enable/disable one key for NEW-session selection (pins unaffected). */
|
|
40
|
+
readonly setKeyEnabled: (
|
|
41
|
+
accountId: string,
|
|
42
|
+
keyId: string,
|
|
43
|
+
enabled: boolean,
|
|
44
|
+
) => Promise<CursorAccount>;
|
|
45
|
+
/** `true` while any key mutation is in flight. */
|
|
46
|
+
readonly isSubmitting: boolean;
|
|
47
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
48
|
+
readonly error: Error | null;
|
|
49
|
+
/** Reset `error` to `null`. */
|
|
50
|
+
readonly clearError: () => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Behavior hook bundling the member-key mutations of one Cursor account —
|
|
55
|
+
* add, remove, enable/disable. One hook because the console's key panel
|
|
56
|
+
* performs all three and they share submit/error surfaces.
|
|
57
|
+
*
|
|
58
|
+
* Rotation is deliberately remove + add (no in-place key swap), so the
|
|
59
|
+
* server-side `/v1/me` identity binding can never go stale.
|
|
60
|
+
*/
|
|
61
|
+
export function useCursorMemberKeyActions(): UseCursorMemberKeyActionsReturn {
|
|
62
|
+
const stigmer = useStigmer();
|
|
63
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
64
|
+
const [error, setError] = useState<Error | null>(null);
|
|
65
|
+
|
|
66
|
+
const run = useCallback(
|
|
67
|
+
async (op: () => Promise<CursorAccount>): Promise<CursorAccount> => {
|
|
68
|
+
setIsSubmitting(true);
|
|
69
|
+
setError(null);
|
|
70
|
+
try {
|
|
71
|
+
return await op();
|
|
72
|
+
} catch (e) {
|
|
73
|
+
const err = toError(e);
|
|
74
|
+
setError(err);
|
|
75
|
+
throw err;
|
|
76
|
+
} finally {
|
|
77
|
+
setIsSubmitting(false);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
[],
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const addKey = useCallback(
|
|
84
|
+
(input: AddCursorMemberKeyInput) =>
|
|
85
|
+
run(() => stigmer.cursorAccounts.addMemberKey(input)),
|
|
86
|
+
[run, stigmer.cursorAccounts],
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const removeKey = useCallback(
|
|
90
|
+
(input: RemoveCursorMemberKeyInput) =>
|
|
91
|
+
run(() => stigmer.cursorAccounts.removeMemberKey(input)),
|
|
92
|
+
[run, stigmer.cursorAccounts],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const setKeyEnabled = useCallback(
|
|
96
|
+
(accountId: string, keyId: string, enabled: boolean) =>
|
|
97
|
+
run(() =>
|
|
98
|
+
stigmer.cursorAccounts.setMemberKeyEnabled({ accountId, keyId, enabled }),
|
|
99
|
+
),
|
|
100
|
+
[run, stigmer.cursorAccounts],
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const clearError = useCallback(() => setError(null), []);
|
|
104
|
+
|
|
105
|
+
return { addKey, removeKey, setKeyEnabled, isSubmitting, error, clearError };
|
|
106
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
5
|
+
import { useStigmer } from "../hooks.js";
|
|
6
|
+
import { toError } from "../internal/toError.js";
|
|
7
|
+
|
|
8
|
+
/** Input for {@link useDeleteCursorAccount}. */
|
|
9
|
+
export interface DeleteCursorAccountInput {
|
|
10
|
+
readonly accountId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Deletion is refused (FAILED_PRECONDITION) while live sessions are
|
|
13
|
+
* pinned to the account's keys. `force: true` overrides — their Cursor
|
|
14
|
+
* agent handles will be orphaned at disposal. Prefer disabling the
|
|
15
|
+
* account, which is always safe.
|
|
16
|
+
*/
|
|
17
|
+
readonly force?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Return value of {@link useDeleteCursorAccount}. */
|
|
21
|
+
export interface UseDeleteCursorAccountReturn {
|
|
22
|
+
/** Delete the account (plus its snapshots and session pins). */
|
|
23
|
+
readonly remove: (input: DeleteCursorAccountInput) => Promise<CursorAccount>;
|
|
24
|
+
/** `true` while a delete is in flight. */
|
|
25
|
+
readonly isSubmitting: boolean;
|
|
26
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
27
|
+
readonly error: Error | null;
|
|
28
|
+
/** Reset `error` to `null`. */
|
|
29
|
+
readonly clearError: () => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Behavior hook for deleting a managed Cursor account. The live-pin
|
|
34
|
+
* guard's FAILED_PRECONDITION message carries the pinned session count —
|
|
35
|
+
* surface it verbatim so the operator can choose disable-instead.
|
|
36
|
+
*/
|
|
37
|
+
export function useDeleteCursorAccount(): UseDeleteCursorAccountReturn {
|
|
38
|
+
const stigmer = useStigmer();
|
|
39
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
40
|
+
const [error, setError] = useState<Error | null>(null);
|
|
41
|
+
|
|
42
|
+
const remove = useCallback(
|
|
43
|
+
async (input: DeleteCursorAccountInput): Promise<CursorAccount> => {
|
|
44
|
+
setIsSubmitting(true);
|
|
45
|
+
setError(null);
|
|
46
|
+
try {
|
|
47
|
+
return await stigmer.cursorAccounts.deleteAccount(input);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
const err = toError(e);
|
|
50
|
+
setError(err);
|
|
51
|
+
throw err;
|
|
52
|
+
} finally {
|
|
53
|
+
setIsSubmitting(false);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
[stigmer.cursorAccounts],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const clearError = useCallback(() => setError(null), []);
|
|
60
|
+
|
|
61
|
+
return { remove, isSubmitting, error, clearError };
|
|
62
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { CursorAccountView } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/io_pb";
|
|
5
|
+
import { useStigmer } from "../hooks.js";
|
|
6
|
+
import { toError } from "../internal/toError.js";
|
|
7
|
+
|
|
8
|
+
/** Return value of {@link useSyncCursorAccount}. */
|
|
9
|
+
export interface UseSyncCursorAccountReturn {
|
|
10
|
+
/**
|
|
11
|
+
* Run an on-demand roster + spend sync and return the refreshed view.
|
|
12
|
+
* The Cursor Admin API is rate-limited (20 req/min, poll-hourly
|
|
13
|
+
* guidance) — `isSyncing` should disable the trigger while in flight,
|
|
14
|
+
* and callers should not poll this.
|
|
15
|
+
*/
|
|
16
|
+
readonly sync: (accountId: string) => Promise<CursorAccountView>;
|
|
17
|
+
/** `true` while a sync is in flight. */
|
|
18
|
+
readonly isSyncing: 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
|
+
/**
|
|
26
|
+
* Behavior hook for the console's "Sync now" — the same server-side sync
|
|
27
|
+
* the hourly schedule runs, on demand.
|
|
28
|
+
*/
|
|
29
|
+
export function useSyncCursorAccount(): UseSyncCursorAccountReturn {
|
|
30
|
+
const stigmer = useStigmer();
|
|
31
|
+
const [isSyncing, setIsSyncing] = useState(false);
|
|
32
|
+
const [error, setError] = useState<Error | null>(null);
|
|
33
|
+
|
|
34
|
+
const sync = useCallback(
|
|
35
|
+
async (accountId: string): Promise<CursorAccountView> => {
|
|
36
|
+
setIsSyncing(true);
|
|
37
|
+
setError(null);
|
|
38
|
+
try {
|
|
39
|
+
return await stigmer.cursorAccounts.syncAccount(accountId);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
const err = toError(e);
|
|
42
|
+
setError(err);
|
|
43
|
+
throw err;
|
|
44
|
+
} finally {
|
|
45
|
+
setIsSyncing(false);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[stigmer.cursorAccounts],
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const clearError = useCallback(() => setError(null), []);
|
|
52
|
+
|
|
53
|
+
return { sync, isSyncing, error, clearError };
|
|
54
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { CursorAccount } from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
5
|
+
import { useStigmer } from "../hooks.js";
|
|
6
|
+
import { toError } from "../internal/toError.js";
|
|
7
|
+
|
|
8
|
+
/** Return value of {@link useUpsertCursorAccount}. */
|
|
9
|
+
export interface UseUpsertCursorAccountReturn {
|
|
10
|
+
/**
|
|
11
|
+
* Create (empty `accountId`) or update a Cursor account. The admin key
|
|
12
|
+
* is plaintext to set/rotate or the `***REDACTED***` marker to keep the
|
|
13
|
+
* stored value; the server validates new keys live against Cursor's
|
|
14
|
+
* `/teams/members` before persisting. Returns the redacted account.
|
|
15
|
+
*/
|
|
16
|
+
readonly upsert: (account: CursorAccount) => Promise<CursorAccount>;
|
|
17
|
+
/** `true` while a save 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
|
+
/**
|
|
26
|
+
* Behavior hook for creating or updating a managed Cursor account.
|
|
27
|
+
*
|
|
28
|
+
* The parent should refetch its list/detail view after a successful
|
|
29
|
+
* save — org assignments affect key selection within the proxy's cache
|
|
30
|
+
* TTL (~5 minutes).
|
|
31
|
+
*/
|
|
32
|
+
export function useUpsertCursorAccount(): UseUpsertCursorAccountReturn {
|
|
33
|
+
const stigmer = useStigmer();
|
|
34
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
35
|
+
const [error, setError] = useState<Error | null>(null);
|
|
36
|
+
|
|
37
|
+
const upsert = useCallback(
|
|
38
|
+
async (account: CursorAccount): Promise<CursorAccount> => {
|
|
39
|
+
setIsSubmitting(true);
|
|
40
|
+
setError(null);
|
|
41
|
+
try {
|
|
42
|
+
return await stigmer.cursorAccounts.upsertAccount({ account });
|
|
43
|
+
} catch (e) {
|
|
44
|
+
const err = toError(e);
|
|
45
|
+
setError(err);
|
|
46
|
+
throw err;
|
|
47
|
+
} finally {
|
|
48
|
+
setIsSubmitting(false);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[stigmer.cursorAccounts],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const clearError = useCallback(() => setError(null), []);
|
|
55
|
+
|
|
56
|
+
return { upsert, isSubmitting, error, clearError };
|
|
57
|
+
}
|