@stigmer/react 3.3.0 → 3.4.1
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/useAgentCount.d.ts +2 -0
- package/agent/useAgentCount.d.ts.map +1 -1
- package/agent/useAgentCount.js.map +1 -1
- package/api-key/CreateApiKeyForm.d.ts +7 -1
- package/api-key/CreateApiKeyForm.d.ts.map +1 -1
- package/api-key/CreateApiKeyForm.js +2 -2
- package/api-key/CreateApiKeyForm.js.map +1 -1
- package/billing/index.d.ts +0 -18
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +4 -9
- package/billing/index.js.map +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +7 -1
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -1
- package/cursor-accounts/CursorAccountEditor.js +21 -5
- package/cursor-accounts/CursorAccountEditor.js.map +1 -1
- package/cursor-accounts/CursorAccountsConsole.d.ts +9 -5
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -1
- package/cursor-accounts/CursorAccountsConsole.js +34 -140
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -1
- 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 +13 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -1
- package/cursor-accounts/cursor-account-format.js +16 -1
- package/cursor-accounts/cursor-account-format.js.map +1 -1
- package/datastore/CollectionRecordsBrowser.js +18 -4
- package/datastore/CollectionRecordsBrowser.js.map +1 -1
- package/datastore/RecordFilterBuilder.d.ts +8 -1
- package/datastore/RecordFilterBuilder.d.ts.map +1 -1
- package/datastore/RecordFilterBuilder.js +2 -2
- package/datastore/RecordFilterBuilder.js.map +1 -1
- package/datastore/recordFilter.d.ts +9 -1
- package/datastore/recordFilter.d.ts.map +1 -1
- package/datastore/recordFilter.js +12 -1
- package/datastore/recordFilter.js.map +1 -1
- package/datastore/useDatastoreCount.d.ts +2 -0
- package/datastore/useDatastoreCount.d.ts.map +1 -1
- package/datastore/useDatastoreCount.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/index.d.ts +8 -6
- package/index.d.ts.map +1 -1
- package/index.js +8 -4
- package/index.js.map +1 -1
- package/internal/form-primitives.d.ts +10 -0
- package/internal/form-primitives.d.ts.map +1 -0
- package/{billing → internal}/form-primitives.js +5 -9
- package/internal/form-primitives.js.map +1 -0
- package/manifest/ApplyManifestDialog.d.ts +10 -5
- package/manifest/ApplyManifestDialog.d.ts.map +1 -1
- package/manifest/ApplyManifestDialog.js +30 -13
- package/manifest/ApplyManifestDialog.js.map +1 -1
- package/manifest/useApplyManifest.d.ts +6 -2
- package/manifest/useApplyManifest.d.ts.map +1 -1
- package/manifest/useApplyManifest.js +5 -5
- package/manifest/useApplyManifest.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts +38 -2
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +21 -5
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/index.d.ts +7 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +9 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/steps/EnvironmentAuthStep.d.ts +4 -0
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -1
- package/mcp-server/steps/EnvironmentAuthStep.js +4 -0
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -1
- package/mcp-server/steps/IdentityTransportStep.d.ts +6 -0
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -1
- package/mcp-server/steps/IdentityTransportStep.js +7 -1
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -1
- package/mcp-server/steps/ReviewStep.d.ts +5 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
- package/mcp-server/steps/ReviewStep.js +16 -2
- package/mcp-server/steps/ReviewStep.js.map +1 -1
- package/mcp-server/useMcpServerCount.d.ts +2 -0
- package/mcp-server/useMcpServerCount.d.ts.map +1 -1
- package/mcp-server/useMcpServerCount.js.map +1 -1
- package/package.json +4 -4
- package/pricing-governance/BaselineEditor.d.ts.map +1 -0
- package/{billing → pricing-governance}/BaselineEditor.js +19 -2
- package/pricing-governance/BaselineEditor.js.map +1 -0
- package/pricing-governance/ModelCatalogPanel.d.ts.map +1 -0
- package/pricing-governance/ModelCatalogPanel.js.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.d.ts.map +1 -0
- package/pricing-governance/ModelGovernanceDetail.js.map +1 -0
- package/pricing-governance/OperatorAccessNotice.d.ts.map +1 -0
- package/pricing-governance/OperatorAccessNotice.js.map +1 -0
- package/pricing-governance/PricingGovernanceConsole.d.ts.map +1 -0
- package/{billing → pricing-governance}/PricingGovernanceConsole.js +1 -1
- package/pricing-governance/PricingGovernanceConsole.js.map +1 -0
- package/pricing-governance/PricingGovernancePanel.d.ts.map +1 -0
- package/pricing-governance/PricingGovernancePanel.js.map +1 -0
- package/pricing-governance/RetireConfirm.d.ts.map +1 -0
- package/{billing → pricing-governance}/RetireConfirm.js +1 -1
- package/pricing-governance/RetireConfirm.js.map +1 -0
- package/pricing-governance/governance-primitives.d.ts.map +1 -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.map +1 -0
- package/pricing-governance/pricing-format.js.map +1 -0
- package/pricing-governance/useDecidePricingOverride.d.ts.map +1 -0
- package/pricing-governance/useDecidePricingOverride.js.map +1 -0
- package/pricing-governance/useModelGovernanceView.d.ts.map +1 -0
- package/pricing-governance/useModelGovernanceView.js.map +1 -0
- package/pricing-governance/useModelPricingBaselines.d.ts.map +1 -0
- package/pricing-governance/useModelPricingBaselines.js.map +1 -0
- package/pricing-governance/usePricingGovernance.d.ts.map +1 -0
- package/pricing-governance/usePricingGovernance.js.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useRetireModelPricingBaseline.js.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/pricing-governance/useUpsertModelPricingBaseline.js.map +1 -0
- package/resource-creation/CreationPicker.d.ts.map +1 -1
- package/resource-creation/CreationPicker.js +3 -3
- package/resource-creation/CreationPicker.js.map +1 -1
- package/resource-creation/WizardNav.d.ts.map +1 -1
- package/resource-creation/WizardNav.js +1 -1
- package/resource-creation/WizardNav.js.map +1 -1
- package/resource-detail/Section.d.ts +8 -1
- package/resource-detail/Section.d.ts.map +1 -1
- package/resource-detail/Section.js +2 -2
- package/resource-detail/Section.js.map +1 -1
- package/resource-workbench/components/ResourceWorkbench.d.ts +9 -1
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -1
- package/resource-workbench/components/ResourceWorkbench.js +2 -1
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -1
- package/resource-workbench/hooks/useResourceCollection.d.ts +9 -0
- package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -1
- package/resource-workbench/hooks/useResourceCollection.js +2 -2
- package/resource-workbench/hooks/useResourceCollection.js.map +1 -1
- package/search/useResourceCount.d.ts +7 -0
- package/search/useResourceCount.d.ts.map +1 -1
- package/search/useResourceCount.js +2 -1
- package/search/useResourceCount.js.map +1 -1
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +17 -3
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts +2 -1
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +19 -11
- package/session/SessionViewer.js.map +1 -1
- package/session/SessionViewerLayout.d.ts +90 -0
- package/session/SessionViewerLayout.d.ts.map +1 -0
- package/session/SessionViewerLayout.js +32 -0
- package/session/SessionViewerLayout.js.map +1 -0
- package/session/index.d.ts +4 -0
- package/session/index.d.ts.map +1 -1
- package/session/index.js +10 -0
- package/session/index.js.map +1 -1
- 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/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/useSessionRailViews.d.ts +2 -2
- 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/skill/useSkillCount.d.ts +2 -0
- package/skill/useSkillCount.d.ts.map +1 -1
- package/skill/useSkillCount.js.map +1 -1
- package/src/agent/useAgentCount.ts +2 -0
- package/src/api-key/CreateApiKeyForm.tsx +8 -1
- package/src/api-key/__tests__/CreateApiKeyForm.test.tsx +58 -0
- package/src/billing/index.ts +5 -37
- package/src/cursor-accounts/CursorAccountEditor.tsx +61 -13
- package/src/cursor-accounts/CursorAccountsConsole.tsx +44 -400
- package/src/cursor-accounts/MemberCoverageTable.tsx +439 -0
- package/src/cursor-accounts/MemberKeysPanel.tsx +278 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +306 -10
- 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 +17 -1
- package/src/datastore/CollectionRecordsBrowser.tsx +29 -3
- package/src/datastore/RecordFilterBuilder.tsx +12 -1
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +38 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +14 -0
- package/src/datastore/__tests__/recordFilter.test.ts +13 -0
- package/src/datastore/recordFilter.ts +15 -1
- package/src/datastore/useDatastoreCount.ts +2 -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__/useCreateAgentExecution.test.tsx +86 -0
- package/src/execution/useCreateAgentExecution.ts +41 -6
- package/src/index.ts +43 -24
- package/src/{billing → internal}/form-primitives.tsx +4 -32
- package/src/manifest/ApplyManifestDialog.tsx +40 -16
- package/src/manifest/__tests__/ApplyManifestDialog.test.tsx +147 -0
- package/src/manifest/__tests__/useApplyManifest.test.tsx +6 -6
- package/src/manifest/useApplyManifest.ts +12 -8
- package/src/mcp-server/McpServerDetailView.tsx +52 -4
- package/src/mcp-server/__tests__/McpServerDetailView.test.tsx +345 -0
- package/src/mcp-server/index.ts +13 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +4 -0
- package/src/mcp-server/steps/IdentityTransportStep.tsx +9 -1
- package/src/mcp-server/steps/ReviewStep.tsx +18 -1
- package/src/mcp-server/useMcpServerCount.ts +2 -0
- package/src/{billing → pricing-governance}/BaselineEditor.tsx +36 -3
- package/src/{billing → pricing-governance}/PricingGovernanceConsole.tsx +1 -1
- package/src/{billing → pricing-governance}/RetireConfirm.tsx +1 -1
- package/src/pricing-governance/index.ts +50 -0
- package/src/resource-creation/CreationPicker.tsx +7 -0
- package/src/resource-creation/WizardNav.tsx +1 -0
- package/src/resource-detail/Section.tsx +9 -1
- package/src/resource-workbench/components/ResourceWorkbench.tsx +13 -0
- package/src/resource-workbench/hooks/useResourceCollection.ts +11 -1
- package/src/search/useResourceCount.ts +9 -1
- package/src/session/NewSessionViewer.tsx +48 -61
- package/src/session/SessionViewer.tsx +71 -86
- package/src/session/SessionViewerLayout.tsx +131 -0
- package/src/session/__tests__/SessionViewerLayout.test.tsx +140 -0
- package/src/session/__tests__/useCreateSession.test.tsx +94 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +33 -0
- package/src/session/index.ts +14 -0
- package/src/session/useCreateSession.ts +30 -0
- package/src/session/useNewSessionFlow.ts +45 -1
- package/src/session/useSessionRailViews.tsx +2 -2
- package/src/session/useUpdateSession.ts +29 -10
- package/src/skill/useSkillCount.ts +2 -0
- package/src/test/__tests__/samples.test.ts +159 -2
- package/src/test/index.ts +1 -1
- package/src/test/samples.ts +109 -14
- package/src/workflow/useWorkflowCount.ts +2 -0
- package/styles.css +1 -1
- package/test/index.d.ts +1 -1
- package/test/index.d.ts.map +1 -1
- package/test/index.js +1 -1
- package/test/index.js.map +1 -1
- package/test/samples.d.ts +79 -7
- package/test/samples.d.ts.map +1 -1
- package/test/samples.js +101 -14
- package/test/samples.js.map +1 -1
- package/workflow/useWorkflowCount.d.ts +2 -0
- package/workflow/useWorkflowCount.d.ts.map +1 -1
- package/workflow/useWorkflowCount.js.map +1 -1
- package/billing/BaselineEditor.d.ts.map +0 -1
- package/billing/BaselineEditor.js.map +0 -1
- package/billing/ModelCatalogPanel.d.ts.map +0 -1
- package/billing/ModelCatalogPanel.js.map +0 -1
- package/billing/ModelGovernanceDetail.d.ts.map +0 -1
- package/billing/ModelGovernanceDetail.js.map +0 -1
- package/billing/OperatorAccessNotice.d.ts.map +0 -1
- package/billing/OperatorAccessNotice.js.map +0 -1
- package/billing/PricingGovernanceConsole.d.ts.map +0 -1
- package/billing/PricingGovernanceConsole.js.map +0 -1
- package/billing/PricingGovernancePanel.d.ts.map +0 -1
- package/billing/PricingGovernancePanel.js.map +0 -1
- package/billing/RetireConfirm.d.ts.map +0 -1
- package/billing/RetireConfirm.js.map +0 -1
- package/billing/form-primitives.d.ts +0 -18
- package/billing/form-primitives.d.ts.map +0 -1
- package/billing/form-primitives.js.map +0 -1
- package/billing/governance-primitives.d.ts.map +0 -1
- package/billing/governance-primitives.js.map +0 -1
- package/billing/pricing-format.d.ts.map +0 -1
- package/billing/pricing-format.js.map +0 -1
- package/billing/useDecidePricingOverride.d.ts.map +0 -1
- package/billing/useDecidePricingOverride.js.map +0 -1
- package/billing/useModelGovernanceView.d.ts.map +0 -1
- package/billing/useModelGovernanceView.js.map +0 -1
- package/billing/useModelPricingBaselines.d.ts.map +0 -1
- package/billing/useModelPricingBaselines.js.map +0 -1
- package/billing/usePricingGovernance.d.ts.map +0 -1
- package/billing/usePricingGovernance.js.map +0 -1
- package/billing/useRetireModelPricingBaseline.d.ts.map +0 -1
- package/billing/useRetireModelPricingBaseline.js.map +0 -1
- package/billing/useUpsertModelPricingBaseline.d.ts.map +0 -1
- package/billing/useUpsertModelPricingBaseline.js.map +0 -1
- /package/{billing → pricing-governance}/BaselineEditor.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelCatalogPanel.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelCatalogPanel.js +0 -0
- /package/{billing → pricing-governance}/ModelGovernanceDetail.d.ts +0 -0
- /package/{billing → pricing-governance}/ModelGovernanceDetail.js +0 -0
- /package/{billing → pricing-governance}/OperatorAccessNotice.d.ts +0 -0
- /package/{billing → pricing-governance}/OperatorAccessNotice.js +0 -0
- /package/{billing → pricing-governance}/PricingGovernanceConsole.d.ts +0 -0
- /package/{billing → pricing-governance}/PricingGovernancePanel.d.ts +0 -0
- /package/{billing → pricing-governance}/PricingGovernancePanel.js +0 -0
- /package/{billing → pricing-governance}/RetireConfirm.d.ts +0 -0
- /package/{billing → pricing-governance}/governance-primitives.d.ts +0 -0
- /package/{billing → pricing-governance}/governance-primitives.js +0 -0
- /package/{billing → pricing-governance}/pricing-format.d.ts +0 -0
- /package/{billing → pricing-governance}/pricing-format.js +0 -0
- /package/{billing → pricing-governance}/useDecidePricingOverride.d.ts +0 -0
- /package/{billing → pricing-governance}/useDecidePricingOverride.js +0 -0
- /package/{billing → pricing-governance}/useModelGovernanceView.d.ts +0 -0
- /package/{billing → pricing-governance}/useModelGovernanceView.js +0 -0
- /package/{billing → pricing-governance}/useModelPricingBaselines.d.ts +0 -0
- /package/{billing → pricing-governance}/useModelPricingBaselines.js +0 -0
- /package/{billing → pricing-governance}/usePricingGovernance.d.ts +0 -0
- /package/{billing → pricing-governance}/usePricingGovernance.js +0 -0
- /package/{billing → pricing-governance}/useRetireModelPricingBaseline.d.ts +0 -0
- /package/{billing → pricing-governance}/useRetireModelPricingBaseline.js +0 -0
- /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.d.ts +0 -0
- /package/{billing → pricing-governance}/useUpsertModelPricingBaseline.js +0 -0
- /package/src/{billing → pricing-governance}/ModelCatalogPanel.tsx +0 -0
- /package/src/{billing → pricing-governance}/ModelGovernanceDetail.tsx +0 -0
- /package/src/{billing → pricing-governance}/OperatorAccessNotice.tsx +0 -0
- /package/src/{billing → pricing-governance}/PricingGovernancePanel.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/ModelCatalogPanel.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/PricingGovernanceConsole.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/__tests__/useModelGovernanceView.test.tsx +0 -0
- /package/src/{billing → pricing-governance}/governance-primitives.tsx +0 -0
- /package/src/{billing → pricing-governance}/pricing-format.ts +0 -0
- /package/src/{billing → pricing-governance}/useDecidePricingOverride.ts +0 -0
- /package/src/{billing → pricing-governance}/useModelGovernanceView.ts +0 -0
- /package/src/{billing → pricing-governance}/useModelPricingBaselines.ts +0 -0
- /package/src/{billing → pricing-governance}/usePricingGovernance.ts +0 -0
- /package/src/{billing → pricing-governance}/useRetireModelPricingBaseline.ts +0 -0
- /package/src/{billing → pricing-governance}/useUpsertModelPricingBaseline.ts +0 -0
|
@@ -18,28 +18,47 @@ export interface UseUpdateSessionReturn {
|
|
|
18
18
|
* {@link SessionInput} including the session's `name` and `org` (used
|
|
19
19
|
* by the backend to identify the resource) and all spec fields.
|
|
20
20
|
*
|
|
21
|
+
* **Full-replace semantics.** The backend replaces the entire spec with
|
|
22
|
+
* what you send — there is no field mask. Round-trip every spec field
|
|
23
|
+
* you do not intend to change, *including `metadata`*: an update built
|
|
24
|
+
* from a reconstructed partial spec silently wipes the fields it omits
|
|
25
|
+
* (workspace entries, MCP servers, and `stigmer.ai/*` metadata keys such
|
|
26
|
+
* as the embedder session context). To change only the subject, prefer
|
|
27
|
+
* the field-level `session.updateSubject()` RPC instead of this hook.
|
|
28
|
+
*
|
|
21
29
|
* Typically composed into higher-level hooks like
|
|
22
|
-
* {@link useSessionConversation}
|
|
23
|
-
*
|
|
24
|
-
* standalone.
|
|
30
|
+
* {@link useSessionConversation} (whose update path round-trips the
|
|
31
|
+
* fetched spec) rather than used directly. Platform builders who need
|
|
32
|
+
* direct session mutation can use this hook standalone.
|
|
25
33
|
*
|
|
26
34
|
* @example
|
|
27
35
|
* ```tsx
|
|
28
|
-
* function
|
|
29
|
-
* const { update, isUpdating
|
|
36
|
+
* function TagSession({ session }: { session: Session }) {
|
|
37
|
+
* const { update, isUpdating } = useUpdateSession();
|
|
30
38
|
*
|
|
31
|
-
* async function
|
|
39
|
+
* async function handleTag() {
|
|
40
|
+
* const spec = session.spec;
|
|
32
41
|
* await update({
|
|
33
42
|
* name: session.metadata!.name,
|
|
34
43
|
* org: session.metadata!.org,
|
|
35
|
-
*
|
|
36
|
-
*
|
|
44
|
+
* // Full replace: carry over every fetched spec field...
|
|
45
|
+
* agentInstanceId: spec?.agentInstanceId,
|
|
46
|
+
* subject: spec?.subject,
|
|
47
|
+
* harnessStateId: spec?.harnessStateId,
|
|
48
|
+
* harness: spec?.harness,
|
|
49
|
+
* cursorMode: spec?.cursorMode,
|
|
50
|
+
* executionTarget: spec?.executionTarget,
|
|
51
|
+
* // ...including the spec lists (workspaceEntries, mcpServerUsages,
|
|
52
|
+
* // skillRefs), converted from the fetched proto exactly as
|
|
53
|
+
* // useSessionConversation's update path does...
|
|
54
|
+
* // ...then apply the one change on top of the carried metadata.
|
|
55
|
+
* metadata: { ...spec?.metadata, "acme/reviewed": "true" },
|
|
37
56
|
* });
|
|
38
57
|
* }
|
|
39
58
|
*
|
|
40
59
|
* return (
|
|
41
|
-
* <button onClick={
|
|
42
|
-
*
|
|
60
|
+
* <button onClick={handleTag} disabled={isUpdating}>
|
|
61
|
+
* Mark reviewed
|
|
43
62
|
* </button>
|
|
44
63
|
* );
|
|
45
64
|
* }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateSession.d.ts","sourceRoot":"","sources":["../../src/session/useUpdateSession.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sDAAsD,CAAC;AAGpF,gDAAgD;AAChD,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED
|
|
1
|
+
{"version":3,"file":"useUpdateSession.d.ts","sourceRoot":"","sources":["../../src/session/useUpdateSession.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sDAAsD,CAAC;AAGpF,gDAAgD;AAChD,MAAM,WAAW,sBAAsB;IACrC,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CA2BzD"}
|
|
@@ -8,28 +8,47 @@ import { useStigmer } from "../hooks.js";
|
|
|
8
8
|
* {@link SessionInput} including the session's `name` and `org` (used
|
|
9
9
|
* by the backend to identify the resource) and all spec fields.
|
|
10
10
|
*
|
|
11
|
+
* **Full-replace semantics.** The backend replaces the entire spec with
|
|
12
|
+
* what you send — there is no field mask. Round-trip every spec field
|
|
13
|
+
* you do not intend to change, *including `metadata`*: an update built
|
|
14
|
+
* from a reconstructed partial spec silently wipes the fields it omits
|
|
15
|
+
* (workspace entries, MCP servers, and `stigmer.ai/*` metadata keys such
|
|
16
|
+
* as the embedder session context). To change only the subject, prefer
|
|
17
|
+
* the field-level `session.updateSubject()` RPC instead of this hook.
|
|
18
|
+
*
|
|
11
19
|
* Typically composed into higher-level hooks like
|
|
12
|
-
* {@link useSessionConversation}
|
|
13
|
-
*
|
|
14
|
-
* standalone.
|
|
20
|
+
* {@link useSessionConversation} (whose update path round-trips the
|
|
21
|
+
* fetched spec) rather than used directly. Platform builders who need
|
|
22
|
+
* direct session mutation can use this hook standalone.
|
|
15
23
|
*
|
|
16
24
|
* @example
|
|
17
25
|
* ```tsx
|
|
18
|
-
* function
|
|
19
|
-
* const { update, isUpdating
|
|
26
|
+
* function TagSession({ session }: { session: Session }) {
|
|
27
|
+
* const { update, isUpdating } = useUpdateSession();
|
|
20
28
|
*
|
|
21
|
-
* async function
|
|
29
|
+
* async function handleTag() {
|
|
30
|
+
* const spec = session.spec;
|
|
22
31
|
* await update({
|
|
23
32
|
* name: session.metadata!.name,
|
|
24
33
|
* org: session.metadata!.org,
|
|
25
|
-
*
|
|
26
|
-
*
|
|
34
|
+
* // Full replace: carry over every fetched spec field...
|
|
35
|
+
* agentInstanceId: spec?.agentInstanceId,
|
|
36
|
+
* subject: spec?.subject,
|
|
37
|
+
* harnessStateId: spec?.harnessStateId,
|
|
38
|
+
* harness: spec?.harness,
|
|
39
|
+
* cursorMode: spec?.cursorMode,
|
|
40
|
+
* executionTarget: spec?.executionTarget,
|
|
41
|
+
* // ...including the spec lists (workspaceEntries, mcpServerUsages,
|
|
42
|
+
* // skillRefs), converted from the fetched proto exactly as
|
|
43
|
+
* // useSessionConversation's update path does...
|
|
44
|
+
* // ...then apply the one change on top of the carried metadata.
|
|
45
|
+
* metadata: { ...spec?.metadata, "acme/reviewed": "true" },
|
|
27
46
|
* });
|
|
28
47
|
* }
|
|
29
48
|
*
|
|
30
49
|
* return (
|
|
31
|
-
* <button onClick={
|
|
32
|
-
*
|
|
50
|
+
* <button onClick={handleTag} disabled={isUpdating}>
|
|
51
|
+
* Mark reviewed
|
|
33
52
|
* </button>
|
|
34
53
|
* );
|
|
35
54
|
* }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateSession.js","sourceRoot":"","sources":["../../src/session/useUpdateSession.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAczC
|
|
1
|
+
{"version":3,"file":"useUpdateSession.js","sourceRoot":"","sources":["../../src/session/useUpdateSession.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAczC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAAmB,EAAoB,EAAE;QAC9C,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC;YAClE,QAAQ,CAAC,OAAO,CAAC,CAAC;YAClB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
|
package/skill/useSkillCount.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export interface UseSkillCountOptions {
|
|
|
12
12
|
* @default "org"
|
|
13
13
|
*/
|
|
14
14
|
readonly scope?: ResourceListScope;
|
|
15
|
+
/** Opaque token that forces a recount when its value changes. */
|
|
16
|
+
readonly refetchToken?: unknown;
|
|
15
17
|
}
|
|
16
18
|
/** Return value of {@link useSkillCount}. */
|
|
17
19
|
export interface UseSkillCountReturn {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkillCount.d.ts","sourceRoot":"","sources":["../../src/skill/useSkillCount.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useSkillCount.d.ts","sourceRoot":"","sources":["../../src/skill/useSkillCount.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IACnC,iEAAiE;IACjE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,mBAAmB,CAUrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSkillCount.js","sourceRoot":"","sources":["../../src/skill/useSkillCount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useSkillCount.js","sourceRoot":"","sources":["../../src/skill/useSkillCount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,oBAAoB,CAAC;AAkC9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAkB,EAClB,OAA8B;IAE9B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,MAAM,GAAG,WAAW,CACxB,CAAC,MAAgD,EAAE,EAAE,CACnD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAC5B,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -17,6 +17,8 @@ export interface UseAgentCountOptions {
|
|
|
17
17
|
* @default "org"
|
|
18
18
|
*/
|
|
19
19
|
readonly scope?: ResourceListScope;
|
|
20
|
+
/** Opaque token that forces a recount when its value changes. */
|
|
21
|
+
readonly refetchToken?: unknown;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/** Return value of {@link useAgentCount}. */
|
|
@@ -22,6 +22,12 @@ export interface CreateApiKeyFormProps {
|
|
|
22
22
|
readonly onCreated?: (apiKey: ApiKey) => void;
|
|
23
23
|
/** Fired when the user cancels creation. */
|
|
24
24
|
readonly onCancel?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Seeds the name field on mount (e.g. a suggested key name, or a demo
|
|
27
|
+
* scenario depicting the form mid-fill). One-time: consumed on mount;
|
|
28
|
+
* subsequent changes are ignored. The field stays fully editable.
|
|
29
|
+
*/
|
|
30
|
+
readonly initialName?: string;
|
|
25
31
|
/** Additional CSS class names for the root container. */
|
|
26
32
|
readonly className?: string;
|
|
27
33
|
}
|
|
@@ -51,11 +57,12 @@ export function CreateApiKeyForm({
|
|
|
51
57
|
org,
|
|
52
58
|
onCreated,
|
|
53
59
|
onCancel,
|
|
60
|
+
initialName = "",
|
|
54
61
|
className,
|
|
55
62
|
}: CreateApiKeyFormProps) {
|
|
56
63
|
const { create, isCreating, error, clearError } = useCreateApiKey();
|
|
57
64
|
|
|
58
|
-
const [name, setName] = useState(
|
|
65
|
+
const [name, setName] = useState(initialName);
|
|
59
66
|
const [expiry, setExpiry] = useState<ExpiryOption>("never");
|
|
60
67
|
|
|
61
68
|
const trimmedName = name.trim();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { describe, it, expect, vi, afterEach } from "vitest";
|
|
2
|
+
import { render, screen, fireEvent, cleanup } from "@testing-library/react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
5
|
+
import { StigmerContext } from "../../context";
|
|
6
|
+
import { CreateApiKeyForm } from "../CreateApiKeyForm";
|
|
7
|
+
|
|
8
|
+
afterEach(cleanup);
|
|
9
|
+
|
|
10
|
+
function createWrapper() {
|
|
11
|
+
const mockClient = {
|
|
12
|
+
apiKey: { create: vi.fn() },
|
|
13
|
+
} as unknown as Stigmer;
|
|
14
|
+
|
|
15
|
+
return ({ children }: { children: ReactNode }) => (
|
|
16
|
+
<StigmerContext.Provider value={mockClient}>
|
|
17
|
+
{children}
|
|
18
|
+
</StigmerContext.Provider>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function nameInput(): HTMLInputElement {
|
|
23
|
+
return screen.getByLabelText("Name") as HTMLInputElement;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function submitButton(): HTMLButtonElement {
|
|
27
|
+
return screen.getByRole("button", {
|
|
28
|
+
name: "Create API key",
|
|
29
|
+
}) as HTMLButtonElement;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe("CreateApiKeyForm initialName", () => {
|
|
33
|
+
it("starts with an empty name and a disabled submit by default", () => {
|
|
34
|
+
render(<CreateApiKeyForm org="acme" />, { wrapper: createWrapper() });
|
|
35
|
+
|
|
36
|
+
expect(nameInput().value).toBe("");
|
|
37
|
+
expect(submitButton().disabled).toBe(true);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("seeds the name field and enables submit when initialName is set", () => {
|
|
41
|
+
render(<CreateApiKeyForm org="acme" initialName="quickstart-key" />, {
|
|
42
|
+
wrapper: createWrapper(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
expect(nameInput().value).toBe("quickstart-key");
|
|
46
|
+
expect(submitButton().disabled).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("keeps the seeded field editable — initialName is a seed, not a lock", () => {
|
|
50
|
+
render(<CreateApiKeyForm org="acme" initialName="quickstart-key" />, {
|
|
51
|
+
wrapper: createWrapper(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
fireEvent.change(nameInput(), { target: { value: "renamed-key" } });
|
|
55
|
+
|
|
56
|
+
expect(nameInput().value).toBe("renamed-key");
|
|
57
|
+
});
|
|
58
|
+
});
|
package/src/billing/index.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Billing — the customer-facing surface: subscription plans, credit
|
|
2
|
+
// balance and ledger, payment methods, usage reports, and customer model
|
|
3
|
+
// pricing. The platform-operator pricing surface (registry baseline
|
|
4
|
+
// authoring, override sign-offs) lives in ../pricing-governance.
|
|
5
|
+
|
|
1
6
|
// Data hooks
|
|
2
7
|
export { useBillingAccount } from "./useBillingAccount.js";
|
|
3
8
|
export type { UseBillingAccountReturn } from "./useBillingAccount.js";
|
|
@@ -7,19 +12,6 @@ export { useBillingUsageReport } from "./useBillingUsageReport.js";
|
|
|
7
12
|
export type { UseBillingUsageReportReturn } from "./useBillingUsageReport.js";
|
|
8
13
|
export { useCustomerModelPricing } from "./useCustomerModelPricing.js";
|
|
9
14
|
export type { UseCustomerModelPricingReturn } from "./useCustomerModelPricing.js";
|
|
10
|
-
export { usePricingGovernance } from "./usePricingGovernance.js";
|
|
11
|
-
export type { UsePricingGovernanceReturn } from "./usePricingGovernance.js";
|
|
12
|
-
export { useModelPricingBaselines } from "./useModelPricingBaselines.js";
|
|
13
|
-
export type {
|
|
14
|
-
UseModelPricingBaselinesOptions,
|
|
15
|
-
UseModelPricingBaselinesReturn,
|
|
16
|
-
} from "./useModelPricingBaselines.js";
|
|
17
|
-
export { useModelGovernanceView } from "./useModelGovernanceView.js";
|
|
18
|
-
export type {
|
|
19
|
-
GovernanceFlow,
|
|
20
|
-
ModelGovernanceRow,
|
|
21
|
-
UseModelGovernanceViewReturn,
|
|
22
|
-
} from "./useModelGovernanceView.js";
|
|
23
15
|
|
|
24
16
|
// Behavior hooks
|
|
25
17
|
export { useCreateCheckoutSession } from "./useCreateCheckoutSession.js";
|
|
@@ -34,21 +26,6 @@ export type {
|
|
|
34
26
|
SetAutoRechargeConfigInput,
|
|
35
27
|
UseSetAutoRechargeConfigReturn,
|
|
36
28
|
} from "./useSetAutoRechargeConfig.js";
|
|
37
|
-
export { useDecidePricingOverride } from "./useDecidePricingOverride.js";
|
|
38
|
-
export type {
|
|
39
|
-
DecidePricingOverrideInput,
|
|
40
|
-
UseDecidePricingOverrideReturn,
|
|
41
|
-
} from "./useDecidePricingOverride.js";
|
|
42
|
-
export { useUpsertModelPricingBaseline } from "./useUpsertModelPricingBaseline.js";
|
|
43
|
-
export type {
|
|
44
|
-
UpsertModelPricingBaselineInput,
|
|
45
|
-
UseUpsertModelPricingBaselineReturn,
|
|
46
|
-
} from "./useUpsertModelPricingBaseline.js";
|
|
47
|
-
export { useRetireModelPricingBaseline } from "./useRetireModelPricingBaseline.js";
|
|
48
|
-
export type {
|
|
49
|
-
RetireModelPricingBaselineInput,
|
|
50
|
-
UseRetireModelPricingBaselineReturn,
|
|
51
|
-
} from "./useRetireModelPricingBaseline.js";
|
|
52
29
|
|
|
53
30
|
// Styled components
|
|
54
31
|
export { BillingSection } from "./BillingSection.js";
|
|
@@ -65,15 +42,6 @@ export { CreditLedgerTable } from "./CreditLedgerTable.js";
|
|
|
65
42
|
export type { CreditLedgerTableProps } from "./CreditLedgerTable.js";
|
|
66
43
|
export { LowBalanceBanner } from "./LowBalanceBanner.js";
|
|
67
44
|
export type { LowBalanceBannerProps } from "./LowBalanceBanner.js";
|
|
68
|
-
export { PricingGovernancePanel } from "./PricingGovernancePanel.js";
|
|
69
|
-
export type { PricingGovernancePanelProps } from "./PricingGovernancePanel.js";
|
|
70
|
-
export { ModelCatalogPanel } from "./ModelCatalogPanel.js";
|
|
71
|
-
export type { ModelCatalogPanelProps } from "./ModelCatalogPanel.js";
|
|
72
|
-
export { PricingGovernanceConsole } from "./PricingGovernanceConsole.js";
|
|
73
|
-
export type {
|
|
74
|
-
PricingGovernanceConsoleProps,
|
|
75
|
-
PricingGovernanceTab,
|
|
76
|
-
} from "./PricingGovernanceConsole.js";
|
|
77
45
|
|
|
78
46
|
// Credit pack catalog and formatting utilities
|
|
79
47
|
export { CREDIT_PACKS, formatPackPrice, formatCreditCount } from "./credit-packs.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
type CursorAccount,
|
|
10
10
|
} from "@stigmer/protos/ai/stigmer/platform/cursoraccount/v1/cursor_account_pb";
|
|
11
11
|
import { Button } from "../button/index.js";
|
|
12
|
-
import { Field, INPUT_CLASSES } from "../
|
|
12
|
+
import { Field, INPUT_CLASSES } from "../internal/form-primitives.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The redaction marker the server uses for stored secrets. Sending it
|
|
@@ -35,13 +35,19 @@ export interface CursorAccountEditorProps {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Create/edit form for one Cursor account: identity, team Admin API key,
|
|
38
|
-
* enablement,
|
|
38
|
+
* enablement, and dedicated-org assignments. The account's class is
|
|
39
|
+
* derived (DD-008): listed org ids make it DEDICATED to them, an empty
|
|
40
|
+
* list makes it a shared-pool account — there is no flag to manage.
|
|
39
41
|
*
|
|
40
42
|
* Admin-key semantics mirror the server contract: on edit the field
|
|
41
43
|
* shows the redaction marker and submitting it unchanged keeps the
|
|
42
44
|
* stored key; typing anything else rotates it (validated live against
|
|
43
45
|
* Cursor before persisting). Member keys are NOT edited here — they have
|
|
44
46
|
* their own panel with per-key add/remove/enable.
|
|
47
|
+
*
|
|
48
|
+
* The optional team invite link (Cursor dashboard → Invite Members →
|
|
49
|
+
* Copy Invite Link) round-trips readable — no marker — and powers the
|
|
50
|
+
* coverage table's "Copy invite" action for off-team key owners.
|
|
45
51
|
*/
|
|
46
52
|
export function CursorAccountEditor({
|
|
47
53
|
initial,
|
|
@@ -55,12 +61,21 @@ export function CursorAccountEditor({
|
|
|
55
61
|
const [displayName, setDisplayName] = useState(initial?.displayName ?? "");
|
|
56
62
|
const [adminApiKey, setAdminApiKey] = useState(isCreate ? "" : REDACTED);
|
|
57
63
|
const [enabled, setEnabled] = useState(initial?.enabled ?? true);
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
// UI state is the positive ("on-demand enabled", Cursor's own wording and
|
|
65
|
+
// team default); the proto field is the negative so absence means
|
|
66
|
+
// "assume Cursor's default" on documents that predate the field.
|
|
67
|
+
const [onDemandEnabled, setOnDemandEnabled] = useState(
|
|
68
|
+
!(initial?.onDemandUsageDisabled ?? false),
|
|
60
69
|
);
|
|
61
70
|
const [orgIdsText, setOrgIdsText] = useState(
|
|
62
71
|
(initial?.orgIds ?? []).join("\n"),
|
|
63
72
|
);
|
|
73
|
+
// Unlike the admin key, the invite link round-trips readable (the
|
|
74
|
+
// server decrypts it on read — operators must be able to copy it), so
|
|
75
|
+
// there is no redaction-marker dance: edit the value directly.
|
|
76
|
+
const [teamInviteLink, setTeamInviteLink] = useState(
|
|
77
|
+
initial?.teamInviteLink ?? "",
|
|
78
|
+
);
|
|
64
79
|
|
|
65
80
|
const canSubmit =
|
|
66
81
|
displayName.trim() !== "" && adminApiKey.trim() !== "" && !isSubmitting;
|
|
@@ -74,7 +89,10 @@ export function CursorAccountEditor({
|
|
|
74
89
|
displayName: displayName.trim(),
|
|
75
90
|
adminApiKey: adminApiKey.trim(),
|
|
76
91
|
enabled,
|
|
77
|
-
|
|
92
|
+
// is_platform_default is deprecated (DD-008): the shared pool is
|
|
93
|
+
// derived from empty org_ids, so current clients never write it.
|
|
94
|
+
onDemandUsageDisabled: !onDemandEnabled,
|
|
95
|
+
teamInviteLink: teamInviteLink.trim(),
|
|
78
96
|
orgIds: orgIdsText
|
|
79
97
|
.split(/[\s,]+/)
|
|
80
98
|
.map((s) => s.trim())
|
|
@@ -117,15 +135,43 @@ export function CursorAccountEditor({
|
|
|
117
135
|
</p>
|
|
118
136
|
)}
|
|
119
137
|
|
|
120
|
-
<Field label="
|
|
138
|
+
<Field label="Team invite link">
|
|
139
|
+
<input
|
|
140
|
+
className={INPUT_CLASSES}
|
|
141
|
+
type="url"
|
|
142
|
+
value={teamInviteLink}
|
|
143
|
+
onChange={(e) => setTeamInviteLink(e.target.value)}
|
|
144
|
+
placeholder="https://… (Cursor dashboard → Invite Members → Copy Invite Link)"
|
|
145
|
+
disabled={isSubmitting}
|
|
146
|
+
autoComplete="off"
|
|
147
|
+
spellCheck={false}
|
|
148
|
+
/>
|
|
149
|
+
</Field>
|
|
150
|
+
<p className="text-[11px] text-muted-foreground">
|
|
151
|
+
Optional. Powers one-click "Copy invite" on coverage rows
|
|
152
|
+
whose key owner is not on the team. The link is long-lived and
|
|
153
|
+
joinable by anyone holding it (each join consumes a paid seat) —
|
|
154
|
+
share it deliberately, and revoke or rotate it from the Cursor
|
|
155
|
+
dashboard. Leave empty to clear.
|
|
156
|
+
</p>
|
|
157
|
+
|
|
158
|
+
<Field label="Dedicated organization ids">
|
|
121
159
|
<textarea
|
|
122
160
|
className={cn(INPUT_CLASSES, "min-h-16 font-mono")}
|
|
123
161
|
value={orgIdsText}
|
|
124
162
|
onChange={(e) => setOrgIdsText(e.target.value)}
|
|
125
|
-
placeholder={"one org id per line\n(
|
|
163
|
+
placeholder={"one org id per line\n(leave empty for a shared-pool account)"}
|
|
126
164
|
disabled={isSubmitting}
|
|
127
165
|
/>
|
|
128
166
|
</Field>
|
|
167
|
+
<p className="text-[11px] text-muted-foreground">
|
|
168
|
+
Listing org ids DEDICATES this account to them: their sessions use
|
|
169
|
+
only this account's keys and fail with a clear message when it
|
|
170
|
+
runs dry. Leaving this empty makes the account part of the shared
|
|
171
|
+
pool that serves every other org — pool sessions may move between
|
|
172
|
+
pool accounts when one is depleted. Each org may appear in at most
|
|
173
|
+
one account.
|
|
174
|
+
</p>
|
|
129
175
|
|
|
130
176
|
<div className="space-y-2">
|
|
131
177
|
<div>
|
|
@@ -148,16 +194,18 @@ export function CursorAccountEditor({
|
|
|
148
194
|
<label className="flex items-center gap-1.5 text-xs text-foreground">
|
|
149
195
|
<input
|
|
150
196
|
type="checkbox"
|
|
151
|
-
checked={
|
|
152
|
-
onChange={(e) =>
|
|
197
|
+
checked={onDemandEnabled}
|
|
198
|
+
onChange={(e) => setOnDemandEnabled(e.target.checked)}
|
|
153
199
|
disabled={isSubmitting}
|
|
154
200
|
/>
|
|
155
|
-
|
|
201
|
+
On-demand usage enabled (as configured in the Cursor dashboard)
|
|
156
202
|
</label>
|
|
157
203
|
<p className="mt-0.5 pl-[1.375rem] text-[11px] text-muted-foreground">
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
204
|
+
Declared here because Cursor's Admin API cannot report the
|
|
205
|
+
team's on-demand setting. Uncheck only when the dashboard has
|
|
206
|
+
on-demand usage OFF: new sessions then avoid member keys whose
|
|
207
|
+
included third-party (API) pool is nearly spent, since such keys
|
|
208
|
+
can no longer serve third-party models at all.
|
|
161
209
|
</p>
|
|
162
210
|
</div>
|
|
163
211
|
</div>
|