@stigmer/react 3.2.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +6 -3
- package/agent/AgentDetailView.js.map +1 -1
- package/agent/steps/ReviewStep.d.ts.map +1 -1
- package/agent/steps/ReviewStep.js +2 -3
- package/agent/steps/ReviewStep.js.map +1 -1
- package/billing/BaselineEditor.d.ts +9 -0
- package/billing/BaselineEditor.d.ts.map +1 -0
- package/billing/BaselineEditor.js +253 -0
- package/billing/BaselineEditor.js.map +1 -0
- package/billing/ModelCatalogPanel.d.ts +28 -0
- package/billing/ModelCatalogPanel.d.ts.map +1 -0
- package/billing/ModelCatalogPanel.js +102 -0
- package/billing/ModelCatalogPanel.js.map +1 -0
- package/billing/ModelGovernanceDetail.d.ts +8 -0
- package/billing/ModelGovernanceDetail.d.ts.map +1 -0
- package/billing/ModelGovernanceDetail.js +64 -0
- package/billing/ModelGovernanceDetail.js.map +1 -0
- package/billing/OperatorAccessNotice.d.ts +12 -0
- package/billing/OperatorAccessNotice.d.ts.map +1 -0
- package/billing/OperatorAccessNotice.js +15 -0
- package/billing/OperatorAccessNotice.js.map +1 -0
- package/billing/PricingGovernanceConsole.d.ts +57 -0
- package/billing/PricingGovernanceConsole.d.ts.map +1 -0
- package/billing/PricingGovernanceConsole.js +164 -0
- package/billing/PricingGovernanceConsole.js.map +1 -0
- package/billing/PricingGovernancePanel.d.ts +26 -0
- package/billing/PricingGovernancePanel.d.ts.map +1 -0
- package/billing/PricingGovernancePanel.js +64 -0
- package/billing/PricingGovernancePanel.js.map +1 -0
- package/billing/RetireConfirm.d.ts +9 -0
- package/billing/RetireConfirm.d.ts.map +1 -0
- package/billing/RetireConfirm.js +19 -0
- package/billing/RetireConfirm.js.map +1 -0
- package/billing/form-primitives.d.ts +18 -0
- package/billing/form-primitives.d.ts.map +1 -0
- package/billing/form-primitives.js +19 -0
- package/billing/form-primitives.js.map +1 -0
- package/billing/governance-primitives.d.ts +33 -0
- package/billing/governance-primitives.d.ts.map +1 -0
- package/billing/governance-primitives.js +43 -0
- package/billing/governance-primitives.js.map +1 -0
- package/billing/index.d.ts +18 -0
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +9 -0
- package/billing/index.js.map +1 -1
- package/billing/pricing-format.d.ts +12 -0
- package/billing/pricing-format.d.ts.map +1 -0
- package/billing/pricing-format.js +50 -0
- package/billing/pricing-format.js.map +1 -0
- package/billing/useDecidePricingOverride.d.ts +46 -0
- package/billing/useDecidePricingOverride.d.ts.map +1 -0
- package/billing/useDecidePricingOverride.js +44 -0
- package/billing/useDecidePricingOverride.js.map +1 -0
- package/billing/useModelGovernanceView.d.ts +103 -0
- package/billing/useModelGovernanceView.d.ts.map +1 -0
- package/billing/useModelGovernanceView.js +144 -0
- package/billing/useModelGovernanceView.js.map +1 -0
- package/billing/useModelPricingBaselines.d.ts +40 -0
- package/billing/useModelPricingBaselines.d.ts.map +1 -0
- package/billing/useModelPricingBaselines.js +32 -0
- package/billing/useModelPricingBaselines.js.map +1 -0
- package/billing/usePricingGovernance.d.ts +39 -0
- package/billing/usePricingGovernance.d.ts.map +1 -0
- package/billing/usePricingGovernance.js +31 -0
- package/billing/usePricingGovernance.js.map +1 -0
- package/billing/useRetireModelPricingBaseline.d.ts +31 -0
- package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/billing/useRetireModelPricingBaseline.js +36 -0
- package/billing/useRetireModelPricingBaseline.js.map +1 -0
- package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
- package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/billing/useUpsertModelPricingBaseline.js +37 -0
- package/billing/useUpsertModelPricingBaseline.js.map +1 -0
- package/channel/AgentChannelsPanel.d.ts.map +1 -1
- package/channel/AgentChannelsPanel.js +11 -5
- package/channel/AgentChannelsPanel.js.map +1 -1
- package/composer/SessionComposer.d.ts +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountEditor.js +51 -0
- package/cursor-accounts/CursorAccountEditor.js.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.js +275 -0
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +10 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-format.js +26 -0
- package/cursor-accounts/cursor-account-format.js.map +1 -0
- package/cursor-accounts/index.d.ts +18 -0
- package/cursor-accounts/index.d.ts.map +1 -0
- package/cursor-accounts/index.js +13 -0
- package/cursor-accounts/index.js.map +1 -0
- package/cursor-accounts/useCursorAccountView.d.ts +30 -0
- package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccountView.js +25 -0
- package/cursor-accounts/useCursorAccountView.js.map +1 -0
- package/cursor-accounts/useCursorAccounts.d.ts +33 -0
- package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccounts.js +25 -0
- package/cursor-accounts/useCursorAccounts.js.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
- package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.js +32 -0
- package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.js +31 -0
- package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.js +34 -0
- package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
- package/datastore/CollectionRecordsBrowser.d.ts +34 -0
- package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
- package/datastore/CollectionRecordsBrowser.js +209 -0
- package/datastore/CollectionRecordsBrowser.js.map +1 -0
- package/datastore/CollectionSchemaView.d.ts +29 -0
- package/datastore/CollectionSchemaView.d.ts.map +1 -0
- package/datastore/CollectionSchemaView.js +93 -0
- package/datastore/CollectionSchemaView.js.map +1 -0
- package/datastore/DatastoreDetailView.d.ts +44 -0
- package/datastore/DatastoreDetailView.d.ts.map +1 -0
- package/datastore/DatastoreDetailView.js +76 -0
- package/datastore/DatastoreDetailView.js.map +1 -0
- package/datastore/DatastoreSyncReport.d.ts +19 -0
- package/datastore/DatastoreSyncReport.d.ts.map +1 -0
- package/datastore/DatastoreSyncReport.js +45 -0
- package/datastore/DatastoreSyncReport.js.map +1 -0
- package/datastore/DeleteDatastoreDialog.d.ts +35 -0
- package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
- package/datastore/DeleteDatastoreDialog.js +90 -0
- package/datastore/DeleteDatastoreDialog.js.map +1 -0
- package/datastore/FieldValueControl.d.ts +55 -0
- package/datastore/FieldValueControl.d.ts.map +1 -0
- package/datastore/FieldValueControl.js +138 -0
- package/datastore/FieldValueControl.js.map +1 -0
- package/datastore/RecordFilterBuilder.d.ts +30 -0
- package/datastore/RecordFilterBuilder.d.ts.map +1 -0
- package/datastore/RecordFilterBuilder.js +122 -0
- package/datastore/RecordFilterBuilder.js.map +1 -0
- package/datastore/RecordFormPanel.d.ts +45 -0
- package/datastore/RecordFormPanel.d.ts.map +1 -0
- package/datastore/RecordFormPanel.js +215 -0
- package/datastore/RecordFormPanel.js.map +1 -0
- package/datastore/index.d.ts +43 -0
- package/datastore/index.d.ts.map +1 -0
- package/datastore/index.js +22 -0
- package/datastore/index.js.map +1 -0
- package/datastore/recordFilter.d.ts +54 -0
- package/datastore/recordFilter.d.ts.map +1 -0
- package/datastore/recordFilter.js +93 -0
- package/datastore/recordFilter.js.map +1 -0
- package/datastore/recordValues.d.ts +85 -0
- package/datastore/recordValues.d.ts.map +1 -0
- package/datastore/recordValues.js +282 -0
- package/datastore/recordValues.js.map +1 -0
- package/datastore/useDatastore.d.ts +39 -0
- package/datastore/useDatastore.d.ts.map +1 -0
- package/datastore/useDatastore.js +44 -0
- package/datastore/useDatastore.js.map +1 -0
- package/datastore/useDatastoreCount.d.ts +48 -0
- package/datastore/useDatastoreCount.d.ts.map +1 -0
- package/datastore/useDatastoreCount.js +27 -0
- package/datastore/useDatastoreCount.js.map +1 -0
- package/datastore/useDatastoreDescription.d.ts +54 -0
- package/datastore/useDatastoreDescription.d.ts.map +1 -0
- package/datastore/useDatastoreDescription.js +50 -0
- package/datastore/useDatastoreDescription.js.map +1 -0
- package/datastore/useDatastoreList.d.ts +57 -0
- package/datastore/useDatastoreList.d.ts.map +1 -0
- package/datastore/useDatastoreList.js +29 -0
- package/datastore/useDatastoreList.js.map +1 -0
- package/datastore/useDatastoreSearch.d.ts +19 -0
- package/datastore/useDatastoreSearch.d.ts.map +1 -0
- package/datastore/useDatastoreSearch.js +22 -0
- package/datastore/useDatastoreSearch.js.map +1 -0
- package/datastore/useDeleteDatastore.d.ts +53 -0
- package/datastore/useDeleteDatastore.d.ts.map +1 -0
- package/datastore/useDeleteDatastore.js +40 -0
- package/datastore/useDeleteDatastore.js.map +1 -0
- package/datastore/useDeleteRecord.d.ts +34 -0
- package/datastore/useDeleteRecord.d.ts.map +1 -0
- package/datastore/useDeleteRecord.js +43 -0
- package/datastore/useDeleteRecord.js.map +1 -0
- package/datastore/useInsertRecord.d.ts +50 -0
- package/datastore/useInsertRecord.d.ts.map +1 -0
- package/datastore/useInsertRecord.js +55 -0
- package/datastore/useInsertRecord.js.map +1 -0
- package/datastore/useRecordCollection.d.ts +104 -0
- package/datastore/useRecordCollection.d.ts.map +1 -0
- package/datastore/useRecordCollection.js +136 -0
- package/datastore/useRecordCollection.js.map +1 -0
- package/datastore/useRecordList.d.ts +66 -0
- package/datastore/useRecordList.d.ts.map +1 -0
- package/datastore/useRecordList.js +58 -0
- package/datastore/useRecordList.js.map +1 -0
- package/datastore/useUpdateRecord.d.ts +52 -0
- package/datastore/useUpdateRecord.d.ts.map +1 -0
- package/datastore/useUpdateRecord.js +55 -0
- package/datastore/useUpdateRecord.js.map +1 -0
- package/environment/EnvironmentListPanel.d.ts.map +1 -1
- package/environment/EnvironmentListPanel.js +12 -7
- package/environment/EnvironmentListPanel.js.map +1 -1
- package/execution/index.d.ts +1 -2
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +0 -1
- package/execution/index.js.map +1 -1
- package/execution/useLiveAgentExecution.d.ts +17 -1
- package/execution/useLiveAgentExecution.d.ts.map +1 -1
- package/execution/useLiveAgentExecution.js +19 -4
- package/execution/useLiveAgentExecution.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 +16 -10
- package/index.d.ts.map +1 -1
- package/index.js +16 -5
- package/index.js.map +1 -1
- package/internal/useInViewport.d.ts +24 -0
- package/internal/useInViewport.d.ts.map +1 -0
- package/internal/useInViewport.js +49 -0
- package/internal/useInViewport.js.map +1 -0
- package/library/VisibilitySelector.d.ts +22 -6
- package/library/VisibilitySelector.d.ts.map +1 -1
- package/library/VisibilitySelector.js +12 -4
- package/library/VisibilitySelector.js.map +1 -1
- package/library/index.d.ts +1 -8
- 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/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +4 -3
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
- package/mcp-server/steps/ReviewStep.js +2 -3
- package/mcp-server/steps/ReviewStep.js.map +1 -1
- package/package.json +4 -4
- package/resource-creation/templates/workflow-templates.js +4 -4
- package/session/SessionViewer.js +8 -1
- package/session/SessionViewer.js.map +1 -1
- package/session/audience.d.ts +6 -1
- package/session/audience.d.ts.map +1 -1
- package/session/useEditSessionPrep.js +3 -3
- package/session/useEditSessionPrep.js.map +1 -1
- package/settings/index.d.ts +2 -1
- package/settings/index.d.ts.map +1 -1
- package/settings/index.js +2 -1
- package/settings/index.js.map +1 -1
- package/settings/settings-nav.d.ts +22 -0
- package/settings/settings-nav.d.ts.map +1 -1
- package/settings/settings-nav.js +32 -1
- package/settings/settings-nav.js.map +1 -1
- package/settings/useSettingsNavGroups.d.ts +29 -0
- package/settings/useSettingsNavGroups.d.ts.map +1 -0
- package/settings/useSettingsNavGroups.js +61 -0
- package/settings/useSettingsNavGroups.js.map +1 -0
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +4 -3
- package/skill/SkillDetailView.js.map +1 -1
- package/src/access/__tests__/useManageAccess.test.tsx +104 -0
- package/src/agent/AgentDetailView.tsx +9 -3
- package/src/agent/steps/ReviewStep.tsx +2 -3
- package/src/billing/BaselineEditor.tsx +619 -0
- package/src/billing/ModelCatalogPanel.tsx +283 -0
- package/src/billing/ModelGovernanceDetail.tsx +289 -0
- package/src/billing/OperatorAccessNotice.tsx +32 -0
- package/src/billing/PricingGovernanceConsole.tsx +465 -0
- package/src/billing/PricingGovernancePanel.tsx +166 -0
- package/src/billing/RetireConfirm.tsx +82 -0
- package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
- package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
- package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
- package/src/billing/form-primitives.tsx +68 -0
- package/src/billing/governance-primitives.tsx +133 -0
- package/src/billing/index.ts +37 -0
- package/src/billing/pricing-format.ts +53 -0
- package/src/billing/useDecidePricingOverride.ts +78 -0
- package/src/billing/useModelGovernanceView.ts +290 -0
- package/src/billing/useModelPricingBaselines.ts +69 -0
- package/src/billing/usePricingGovernance.ts +57 -0
- package/src/billing/useRetireModelPricingBaseline.ts +65 -0
- package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
- package/src/channel/AgentChannelsPanel.tsx +27 -1
- package/src/composer/SessionComposer.tsx +1 -1
- package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
- package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
- package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
- package/src/cursor-accounts/cursor-account-format.ts +29 -0
- package/src/cursor-accounts/index.ts +29 -0
- package/src/cursor-accounts/useCursorAccountView.ts +49 -0
- package/src/cursor-accounts/useCursorAccounts.ts +49 -0
- package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
- package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
- package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
- package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
- package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
- package/src/datastore/CollectionSchemaView.tsx +247 -0
- package/src/datastore/DatastoreDetailView.tsx +201 -0
- package/src/datastore/DatastoreSyncReport.tsx +105 -0
- package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
- package/src/datastore/FieldValueControl.tsx +289 -0
- package/src/datastore/RecordFilterBuilder.tsx +411 -0
- package/src/datastore/RecordFormPanel.tsx +432 -0
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
- package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
- package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
- package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
- package/src/datastore/__tests__/recordFilter.test.ts +156 -0
- package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
- package/src/datastore/__tests__/recordValues.test.ts +359 -0
- package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
- package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
- package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
- package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
- package/src/datastore/index.ts +111 -0
- package/src/datastore/recordFilter.ts +140 -0
- package/src/datastore/recordValues.ts +327 -0
- package/src/datastore/useDatastore.ts +67 -0
- package/src/datastore/useDatastoreCount.ts +67 -0
- package/src/datastore/useDatastoreDescription.ts +90 -0
- package/src/datastore/useDatastoreList.ts +79 -0
- package/src/datastore/useDatastoreSearch.ts +39 -0
- package/src/datastore/useDeleteDatastore.ts +87 -0
- package/src/datastore/useDeleteRecord.ts +77 -0
- package/src/datastore/useInsertRecord.ts +92 -0
- package/src/datastore/useRecordCollection.ts +256 -0
- package/src/datastore/useRecordList.ts +131 -0
- package/src/datastore/useUpdateRecord.ts +95 -0
- package/src/environment/EnvironmentListPanel.tsx +24 -0
- package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
- package/src/execution/__tests__/useLiveAgentExecution.test.tsx +125 -0
- package/src/execution/index.ts +4 -7
- package/src/execution/useLiveAgentExecution.ts +41 -3
- 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 +167 -18
- package/src/internal/__tests__/useInViewport.test.tsx +115 -0
- package/src/internal/useInViewport.ts +63 -0
- package/src/library/VisibilitySelector.tsx +50 -9
- package/src/library/__tests__/VisibilitySelector.test.tsx +38 -0
- package/src/library/index.ts +4 -21
- 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/McpServerDetailView.tsx +7 -3
- package/src/mcp-server/steps/ReviewStep.tsx +2 -3
- package/src/resource-creation/templates/workflow-templates.ts +4 -4
- package/src/session/SessionViewer.tsx +7 -1
- package/src/session/__tests__/audienceWiring.test.tsx +31 -1
- package/src/session/audience.ts +6 -1
- package/src/session/useEditSessionPrep.ts +3 -3
- package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
- package/src/settings/index.ts +5 -1
- package/src/settings/settings-nav.ts +43 -0
- package/src/settings/useSettingsNavGroups.ts +81 -0
- package/src/skill/SkillDetailView.tsx +7 -3
- package/src/workflow/WorkflowAgentCallTranscript.tsx +279 -0
- package/src/workflow/WorkflowDetailView.tsx +7 -3
- package/src/workflow/WorkflowExecutionViewer.tsx +20 -77
- package/src/workflow/WorkflowTaskApprovalSummary.tsx +45 -8
- package/src/workflow/WorkflowYamlEditor.tsx +6 -270
- package/src/workflow/__tests__/WorkflowAgentCallTranscript.liveregion.test.tsx +124 -0
- package/src/workflow/__tests__/{WorkflowAgentExecutionDocument.test.tsx → WorkflowAgentCallTranscript.test.tsx} +146 -121
- package/src/workflow/__tests__/WorkflowExecutionViewer.approvals.test.tsx +81 -220
- package/src/workflow/__tests__/WorkflowExecutionViewer.reconciliation.test.tsx +17 -16
- package/src/workflow/__tests__/WorkflowTaskApprovalSummary.test.tsx +52 -2
- package/src/workflow/__tests__/WorkflowTaskThread.test.tsx +168 -185
- package/src/workflow/__tests__/agent-call-live-experience.test.ts +4 -4
- package/src/workflow/__tests__/task-approval.test.ts +119 -0
- package/src/workflow/__tests__/task-presentation.test.ts +35 -1
- package/src/workflow/__tests__/useWorkflowExecutionPanel.test.ts +0 -57
- package/src/workflow/index.ts +6 -3
- package/src/workflow/task-detail/index.ts +3 -0
- package/src/workflow/task-detail/task-approval.ts +95 -1
- package/src/workflow/thread/WorkflowTaskThread.tsx +96 -252
- package/src/workflow/thread/task-presentation.ts +8 -2
- package/src/workflow/useWorkflowExecutionPanel.ts +0 -47
- package/styles.css +1 -1
- package/workflow/CanvasTransitionEdge.d.ts +1 -1
- package/workflow/WorkflowAgentCallTranscript.d.ts +87 -0
- package/workflow/WorkflowAgentCallTranscript.d.ts.map +1 -0
- package/workflow/WorkflowAgentCallTranscript.js +98 -0
- package/workflow/WorkflowAgentCallTranscript.js.map +1 -0
- package/workflow/WorkflowDetailView.d.ts.map +1 -1
- package/workflow/WorkflowDetailView.js +4 -3
- package/workflow/WorkflowDetailView.js.map +1 -1
- package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
- package/workflow/WorkflowExecutionViewer.js +23 -52
- package/workflow/WorkflowExecutionViewer.js.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.js +18 -1
- package/workflow/WorkflowTaskApprovalSummary.js.map +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/workflow/index.d.ts +2 -2
- package/workflow/index.d.ts.map +1 -1
- package/workflow/index.js +2 -2
- package/workflow/index.js.map +1 -1
- package/workflow/task-detail/index.d.ts +1 -1
- package/workflow/task-detail/index.d.ts.map +1 -1
- package/workflow/task-detail/index.js +1 -1
- package/workflow/task-detail/index.js.map +1 -1
- package/workflow/task-detail/task-approval.d.ts +44 -1
- package/workflow/task-detail/task-approval.d.ts.map +1 -1
- package/workflow/task-detail/task-approval.js +47 -0
- package/workflow/task-detail/task-approval.js.map +1 -1
- package/workflow/thread/WorkflowTaskThread.d.ts +17 -25
- package/workflow/thread/WorkflowTaskThread.d.ts.map +1 -1
- package/workflow/thread/WorkflowTaskThread.js +60 -105
- package/workflow/thread/WorkflowTaskThread.js.map +1 -1
- package/workflow/thread/task-presentation.d.ts.map +1 -1
- package/workflow/thread/task-presentation.js +7 -2
- package/workflow/thread/task-presentation.js.map +1 -1
- package/workflow/useWorkflowExecutionPanel.d.ts +0 -12
- package/workflow/useWorkflowExecutionPanel.d.ts.map +1 -1
- package/workflow/useWorkflowExecutionPanel.js +0 -12
- package/workflow/useWorkflowExecutionPanel.js.map +1 -1
- package/execution/agent-execution-document.d.ts +0 -31
- package/execution/agent-execution-document.d.ts.map +0 -1
- package/execution/agent-execution-document.js +0 -48
- package/execution/agent-execution-document.js.map +0 -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/execution/__tests__/agent-execution-document.test.ts +0 -45
- package/src/execution/agent-execution-document.ts +0 -54
- 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
- package/src/workflow/WorkflowAgentExecutionDocument.tsx +0 -283
- package/workflow/WorkflowAgentExecutionDocument.d.ts +0 -79
- package/workflow/WorkflowAgentExecutionDocument.d.ts.map +0 -1
- package/workflow/WorkflowAgentExecutionDocument.js +0 -87
- package/workflow/WorkflowAgentExecutionDocument.js.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { getUserMessage, isPermissionDenied } from "@stigmer/sdk";
|
|
5
|
+
import { OperatorAccessNotice } from "./OperatorAccessNotice.js";
|
|
6
|
+
import { GovernanceBadge, PendingOverrideCard, RateCell } from "./governance-primitives.js";
|
|
7
|
+
import { usePricingGovernance } from "./usePricingGovernance.js";
|
|
8
|
+
import { useDecidePricingOverride } from "./useDecidePricingOverride.js";
|
|
9
|
+
/**
|
|
10
|
+
* Platform-operator panel for the pricing feedback loop: pending
|
|
11
|
+
* override sign-offs (approve/reject) and the effective-vs-baseline
|
|
12
|
+
* pricing state of every model.
|
|
13
|
+
*
|
|
14
|
+
* Prefer {@link PricingGovernanceConsole} for new surfaces — it
|
|
15
|
+
* composes this panel's content with the model catalog into one tabbed
|
|
16
|
+
* console. This standalone panel remains for consumers embedding just
|
|
17
|
+
* the governance view.
|
|
18
|
+
*
|
|
19
|
+
* Requires `can_manage_model_pricing` on `platform:stigmer` — render it
|
|
20
|
+
* only in operator-scoped surfaces. Rates shown are raw provider prices
|
|
21
|
+
* (pre-markup), not customer prices.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <PricingGovernancePanel />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function PricingGovernancePanel({ className }) {
|
|
29
|
+
const { governance, isLoading, error, refetch } = usePricingGovernance();
|
|
30
|
+
const { decide, isSubmitting, error: decisionError } = useDecidePricingOverride();
|
|
31
|
+
if (isLoading) {
|
|
32
|
+
return (_jsxs("div", { className: cn("space-y-2", className), "aria-busy": "true", children: [_jsx("div", { className: "h-4 w-40 animate-pulse rounded bg-muted-subtle" }), Array.from({ length: 4 }, (_, i) => (_jsx("div", { className: "h-10 animate-pulse rounded-lg bg-muted-subtle" }, i)))] }));
|
|
33
|
+
}
|
|
34
|
+
if (error) {
|
|
35
|
+
// A non-operator landing here is expected (the route is reachable by
|
|
36
|
+
// URL) — show the designed access notice, not a raw RPC error.
|
|
37
|
+
if (isPermissionDenied(error)) {
|
|
38
|
+
return _jsx(OperatorAccessNotice, { className: className });
|
|
39
|
+
}
|
|
40
|
+
return (_jsx("p", { className: cn("text-destructive text-xs", className), role: "alert", children: getUserMessage(error) }));
|
|
41
|
+
}
|
|
42
|
+
if (!governance)
|
|
43
|
+
return null;
|
|
44
|
+
const onDecide = async (overrideId, approve) => {
|
|
45
|
+
try {
|
|
46
|
+
await decide({ overrideId, approve });
|
|
47
|
+
// A decision changes both the pending queue and (on approval) the
|
|
48
|
+
// effective rates — reload the whole view.
|
|
49
|
+
refetch();
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Surfaced via decisionError below.
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return (_jsxs("div", { className: cn("space-y-6", className), children: [_jsxs("section", { "aria-label": "Pending pricing override proposals", children: [_jsx("h3", { className: "mb-2 text-xs font-semibold text-foreground", children: "Pending Sign-Offs" }), decisionError && (_jsx("p", { className: "mb-2 text-destructive text-xs", role: "alert", children: getUserMessage(decisionError) })), governance.pendingOverrides.length === 0 ? (_jsx("p", { className: "text-xs text-muted-foreground", children: "No pricing overrides awaiting a decision." })) : (_jsx("div", { className: "space-y-2", children: governance.pendingOverrides.map((override) => (_jsx(PendingOverrideCard, { override: override, isSubmitting: isSubmitting, onDecide: onDecide }, override.overrideId))) }))] }), _jsxs("section", { "aria-label": "Model pricing state", children: [_jsx("h3", { className: "mb-2 text-xs font-semibold text-foreground", children: "Model Pricing" }), _jsxs("div", { className: "rounded-lg border border-border bg-card", role: "table", "aria-label": "Model pricing governance", children: [_jsxs("div", { role: "row", className: "grid grid-cols-[2fr_1fr_1fr_1fr_1fr] gap-2 border-b border-border px-3 py-2 text-[11px] font-medium text-muted-foreground", children: [_jsx("span", { role: "columnheader", children: "Model" }), _jsx("span", { role: "columnheader", children: "Harness" }), _jsx("span", { role: "columnheader", className: "text-right", children: "Input" }), _jsx("span", { role: "columnheader", className: "text-right", children: "Output" }), _jsx("span", { role: "columnheader", className: "text-right", children: "Governance" })] }), governance.entries.map((entry) => (_jsx(GovernanceRow, { entry: entry }, `${entry.modelId}-${entry.harness}-${entry.variant}`)))] })] })] }));
|
|
56
|
+
}
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
// GovernanceRow (internal)
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
function GovernanceRow({ entry }) {
|
|
61
|
+
const hasOverrides = entry.activeOverrides.length > 0;
|
|
62
|
+
return (_jsxs("div", { role: "row", className: "grid grid-cols-[2fr_1fr_1fr_1fr_1fr] items-center gap-2 border-b border-border px-3 py-2 text-xs last:border-b-0", children: [_jsx("span", { role: "cell", className: "truncate font-medium text-foreground", title: entry.modelId, children: entry.displayName || entry.modelId }), _jsx("span", { role: "cell", className: "text-muted-foreground", children: entry.harness }), _jsx(RateCell, { role: "cell", baseline: entry.baselineInputMicrosPerMillion, effective: entry.effectiveInputMicrosPerMillion }), _jsx(RateCell, { role: "cell", baseline: entry.baselineOutputMicrosPerMillion, effective: entry.effectiveOutputMicrosPerMillion }), _jsx("span", { role: "cell", className: "text-right", children: _jsx(GovernanceBadge, { ledgerReconcilable: entry.ledgerReconcilable, hasOverrides: hasOverrides }) })] }));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=PricingGovernancePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PricingGovernancePanel.js","sourceRoot":"","sources":["../../src/billing/PricingGovernancePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAQzE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAE,SAAS,EAA+B;IAC/E,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,oBAAoB,EAAE,CAAC;IACzE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,wBAAwB,EAAE,CAAC;IAElF,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,eAAY,MAAM,aAC1D,cAAK,SAAS,EAAC,gDAAgD,GAAG,EACjE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACnC,cAAa,SAAS,EAAC,+CAA+C,IAA5D,CAAC,CAA8D,CAC1E,CAAC,IACE,CACP,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,EAAE,CA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AC1E,KAAC,QAAQ,IACP,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,KAAK,CAAC,6BAA6B,EAC7C,SAAS,EAAE,KAAK,CAAC,8BAA8B,GAC/C,EACF,KAAC,QAAQ,IACP,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,KAAK,CAAC,8BAA8B,EAC9C,SAAS,EAAE,KAAK,CAAC,+BAA+B,GAChD,EACF,eAAM,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,YAAY,YACtC,KAAC,eAAe,IACd,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,YAAY,EAAE,YAAY,GAC1B,GACG,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ModelPricingBaseline } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
2
|
+
export declare function RetireConfirm({ target, isSubmitting, submitError, onConfirm, onCancel, }: {
|
|
3
|
+
readonly target: ModelPricingBaseline;
|
|
4
|
+
readonly isSubmitting: boolean;
|
|
5
|
+
readonly submitError: Error | null;
|
|
6
|
+
readonly onConfirm: (target: ModelPricingBaseline, revisionNote: string) => Promise<void>;
|
|
7
|
+
readonly onCancel: () => void;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=RetireConfirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RetireConfirm.d.ts","sourceRoot":"","sources":["../../src/billing/RetireConfirm.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAW5G,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1F,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC/B,2CAsDA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
5
|
+
import { Button } from "../button/index.js";
|
|
6
|
+
import { INPUT_CLASSES } from "./form-primitives.js";
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// RetireConfirm — typed confirmation for retiring a catalog entry (a
|
|
9
|
+
// destructive, billing-visible action). Internal to the billing module:
|
|
10
|
+
// rendered by PricingGovernanceConsole and ModelCatalogPanel, never
|
|
11
|
+
// exported from the barrel.
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
export function RetireConfirm({ target, isSubmitting, submitError, onConfirm, onCancel, }) {
|
|
14
|
+
const [typed, setTyped] = useState("");
|
|
15
|
+
const [note, setNote] = useState("");
|
|
16
|
+
const confirmed = typed === target.modelId;
|
|
17
|
+
return (_jsxs("div", { className: "space-y-2 rounded-lg border border-destructive bg-card px-3 py-3", children: [_jsxs("h4", { className: "text-xs font-semibold text-foreground", children: ["Retire ", target.displayName || target.modelId, "?"] }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["The model disappears from every price surface (billing lookups, model pickers, the served registry) and any active pricing overrides on it are archived. The revision history is kept, and the key can be revived by a later upsert. Type ", _jsx("span", { className: "font-medium text-foreground", children: target.modelId }), " ", "to confirm."] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsx("input", { className: INPUT_CLASSES, value: typed, onChange: (e) => setTyped(e.target.value), placeholder: target.modelId, disabled: isSubmitting, "aria-label": "Type the model id to confirm retirement" }), _jsx("input", { className: INPUT_CLASSES, value: note, onChange: (e) => setNote(e.target.value), placeholder: "Reason (audit trail)", disabled: isSubmitting })] }), submitError && (_jsx("p", { className: "text-destructive text-xs", role: "alert", children: getUserMessage(submitError) })), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { size: "sm", variant: "destructive", disabled: !confirmed || isSubmitting, onClick: () => onConfirm(target, note.trim()).catch(() => undefined), children: isSubmitting ? "Retiring…" : "Retire model" }), _jsx(Button, { size: "sm", variant: "outline", disabled: isSubmitting, onClick: onCancel, children: "Cancel" })] })] }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=RetireConfirm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RetireConfirm.js","sourceRoot":"","sources":["../../src/billing/RetireConfirm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,8EAA8E;AAC9E,qEAAqE;AACrE,wEAAwE;AACxE,oEAAoE;AACpE,4BAA4B;AAC5B,8EAA8E;AAE9E,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,GAOT;IACC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,KAAK,KAAK,MAAM,CAAC,OAAO,CAAC;IAE3C,OAAO,CACL,eAAK,SAAS,EAAC,kEAAkE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AY,EAAE,OAAO,EAAE,QAAQ,uBAEpE,IACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Standard text-input styling for the pricing surfaces. */
|
|
2
|
+
export declare const INPUT_CLASSES: string;
|
|
3
|
+
/** Labelled form field wrapper. */
|
|
4
|
+
export declare function Field({ label, required, className, children, }: {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly required?: boolean;
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
readonly children: React.ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/** Dollar-rate input field (decimal keypad, "$ per million tokens"). */
|
|
11
|
+
export declare function RateField({ label, value, placeholder, disabled, onChange, }: {
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly value: string;
|
|
14
|
+
readonly placeholder?: string;
|
|
15
|
+
readonly disabled: boolean;
|
|
16
|
+
readonly onChange: (value: string) => void;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=form-primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-primitives.d.ts","sourceRoot":"","sources":["../../src/billing/form-primitives.tsx"],"names":[],"mappings":"AAUA,4DAA4D;AAC5D,eAAO,MAAM,aAAa,QAKzB,CAAC;AAEF,mCAAmC;AACnC,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC,2CAUA;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C,2CAaA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
// ---------------------------------------------------------------------------
|
|
5
|
+
// Shared form primitives for the operator pricing surfaces (BaselineEditor,
|
|
6
|
+
// RetireConfirm, the console's search inputs). Internal — not exported
|
|
7
|
+
// from the billing barrel.
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/** Standard text-input styling for the pricing surfaces. */
|
|
10
|
+
export const INPUT_CLASSES = cn("w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-xs text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50");
|
|
11
|
+
/** Labelled form field wrapper. */
|
|
12
|
+
export function Field({ label, required, className, children, }) {
|
|
13
|
+
return (_jsxs("label", { className: cn("block space-y-1", className), children: [_jsxs("span", { className: "text-[11px] font-medium text-muted-foreground", children: [label, required ? " *" : ""] }), children] }));
|
|
14
|
+
}
|
|
15
|
+
/** Dollar-rate input field (decimal keypad, "$ per million tokens"). */
|
|
16
|
+
export function RateField({ label, value, placeholder, disabled, onChange, }) {
|
|
17
|
+
return (_jsx(Field, { label: label, children: _jsx("input", { className: INPUT_CLASSES, inputMode: "decimal", value: value, onChange: (e) => onChange(e.target.value), placeholder: placeholder ?? "0.00", disabled: disabled }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=form-primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-primitives.js","sourceRoot":"","sources":["../../src/billing/form-primitives.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,8EAA8E;AAC9E,4EAA4E;AAC5E,uEAAuE;AACvE,2BAA2B;AAC3B,8EAA8E;AAE9E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAC7B,2FAA2F,EAC3F,mCAAmC,EACnC,yEAAyE,EACzE,kDAAkD,CACnD,CAAC;AAEF,mCAAmC;AACnC,MAAM,UAAU,KAAK,CAAC,EACpB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,GAMT;IACC,OAAO,CACL,iBAAO,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,aAChD,gBAAM,SAAS,EAAC,+CAA+C,aAC5D,KAAK,EACL,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAChB,EACN,QAAQ,IACH,CACT,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,GAOT;IACC,OAAO,CACL,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,YACjB,gBACE,SAAS,EAAE,aAAa,EACxB,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,WAAW,EAAE,WAAW,IAAI,MAAM,EAClC,QAAQ,EAAE,QAAQ,GAClB,GACI,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ModelPricingOverride } from "@stigmer/protos/ai/stigmer/billing/v1/pricing_override_pb";
|
|
2
|
+
/**
|
|
3
|
+
* One PENDING_SIGNOFF pricing override with approve/reject actions and
|
|
4
|
+
* its ledger provenance (what was observed, against what, over which
|
|
5
|
+
* window) so the operator decides from evidence, not a bare number.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PendingOverrideCard({ override, isSubmitting, onDecide, }: {
|
|
8
|
+
readonly override: ModelPricingOverride;
|
|
9
|
+
readonly isSubmitting: boolean;
|
|
10
|
+
readonly onDecide: (overrideId: string, approve: boolean) => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Effective rate; when an override moved it, the baseline shows
|
|
14
|
+
* struck-through. Pass `role="cell"` when rendered inside an ARIA
|
|
15
|
+
* table row; leave unset inside interactive list rows (a `<button>`
|
|
16
|
+
* row cannot contain table cells).
|
|
17
|
+
*/
|
|
18
|
+
export declare function RateCell({ baseline, effective, role, }: {
|
|
19
|
+
readonly baseline: bigint;
|
|
20
|
+
readonly effective: bigint;
|
|
21
|
+
readonly role?: "cell";
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Governance state chip: how this entry's rates are governed —
|
|
25
|
+
* ledger-verified (reconcilable, no overrides), ledger-corrected
|
|
26
|
+
* (reconcilable with active overrides), or manually governed (no
|
|
27
|
+
* external ledger can verify it).
|
|
28
|
+
*/
|
|
29
|
+
export declare function GovernanceBadge({ ledgerReconcilable, hasOverrides, }: {
|
|
30
|
+
readonly ledgerReconcilable: boolean;
|
|
31
|
+
readonly hasOverrides: boolean;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=governance-primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance-primitives.d.ts","sourceRoot":"","sources":["../../src/billing/governance-primitives.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AAStG;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACnE,2CA6CA;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,2CAYA;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,kBAAkB,EAClB,YAAY,GACb,EAAE;IACD,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC,2CAoBA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { Button } from "../button/index.js";
|
|
5
|
+
import { RATE_FIELD_LABELS, formatDeltaBp, formatRate } from "./pricing-format.js";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Shared display primitives for the operator pricing surfaces. Internal —
|
|
8
|
+
// not exported from the billing barrel.
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
/**
|
|
11
|
+
* One PENDING_SIGNOFF pricing override with approve/reject actions and
|
|
12
|
+
* its ledger provenance (what was observed, against what, over which
|
|
13
|
+
* window) so the operator decides from evidence, not a bare number.
|
|
14
|
+
*/
|
|
15
|
+
export function PendingOverrideCard({ override, isSubmitting, onDecide, }) {
|
|
16
|
+
const provenance = override.provenance;
|
|
17
|
+
return (_jsx("div", { className: "rounded-lg border border-border bg-card px-3 py-2", children: _jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsxs("p", { className: "truncate text-xs font-medium text-foreground", children: [override.modelId, override.variant ? ` (${override.variant})` : "", " · ", RATE_FIELD_LABELS[override.rateField] ?? "Rate"] }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: provenance ? (_jsxs(_Fragment, { children: ["Ledger observed ", formatRate(provenance.observedRateMicrosPerMillion), " vs effective ", formatRate(provenance.effectiveRateAtDerivationMicrosPerMillion), " ", "(", formatDeltaBp(provenance.deltaBasisPoints), ") over", " ", provenance.windowFrom, "..", provenance.windowTo] })) : (_jsxs(_Fragment, { children: ["Proposed rate ", formatRate(override.rateMicrosPerMillion)] })) })] }), _jsxs("div", { className: "flex shrink-0 gap-2", children: [_jsx(Button, { size: "sm", disabled: isSubmitting, onClick: () => onDecide(override.overrideId, true), children: "Approve" }), _jsx(Button, { size: "sm", variant: "outline", disabled: isSubmitting, onClick: () => onDecide(override.overrideId, false), children: "Reject" })] })] }) }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Effective rate; when an override moved it, the baseline shows
|
|
21
|
+
* struck-through. Pass `role="cell"` when rendered inside an ARIA
|
|
22
|
+
* table row; leave unset inside interactive list rows (a `<button>`
|
|
23
|
+
* row cannot contain table cells).
|
|
24
|
+
*/
|
|
25
|
+
export function RateCell({ baseline, effective, role, }) {
|
|
26
|
+
const overridden = baseline !== effective;
|
|
27
|
+
return (_jsxs("span", { role: role, className: "text-right text-foreground", children: [overridden && (_jsx("span", { className: "mr-1 text-[10px] text-muted-foreground line-through", children: formatRate(baseline) })), formatRate(effective)] }));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Governance state chip: how this entry's rates are governed —
|
|
31
|
+
* ledger-verified (reconcilable, no overrides), ledger-corrected
|
|
32
|
+
* (reconcilable with active overrides), or manually governed (no
|
|
33
|
+
* external ledger can verify it).
|
|
34
|
+
*/
|
|
35
|
+
export function GovernanceBadge({ ledgerReconcilable, hasOverrides, }) {
|
|
36
|
+
if (!ledgerReconcilable) {
|
|
37
|
+
return (_jsx("span", { className: "rounded bg-muted-subtle px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "Manually governed" }));
|
|
38
|
+
}
|
|
39
|
+
return (_jsx("span", { className: cn("rounded px-1.5 py-0.5 text-[10px] font-medium", hasOverrides
|
|
40
|
+
? "bg-accent text-primary"
|
|
41
|
+
: "bg-muted-subtle text-muted-foreground"), children: hasOverrides ? "Ledger-corrected" : "Ledger-verified" }));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=governance-primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance-primitives.js","sourceRoot":"","sources":["../../src/billing/governance-primitives.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEnF,8EAA8E;AAC9E,0EAA0E;AAC1E,wCAAwC;AACxC,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,YAAY,EACZ,QAAQ,GAKT;IACC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IACvC,OAAO,CACL,cAAK,SAAS,EAAC,mDAAmD,YAChE,eAAK,SAAS,EAAC,yCAAyC,aACtD,eAAK,SAAS,EAAC,SAAS,aACtB,aAAG,SAAS,EAAC,8C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b,eAAM,SAAS,EAAC,qDAAqD,YAClE,UAAU,CAAC,QAAQ,CAAC,GAChB,CACR,EACA,UAAU,CAAC,SAAS,CAAC,IACjB,CACR,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,kBAAkB,EAClB,YAAY,GAIb;IACC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,OAAO,CACL,eAAM,SAAS,EAAC,qFAAqF,kCAE9F,CACR,CAAC;IACJ,CAAC;IACD,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,+CAA+C,EAC/C,YAAY;YACV,CAAC,CAAC,wBAAwB;YAC1B,CAAC,CAAC,uCAAuC,CAC5C,YAEA,YAAY,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,GACjD,CACR,CAAC;AACJ,CAAC"}
|
package/billing/index.d.ts
CHANGED
|
@@ -6,12 +6,24 @@ export { useBillingUsageReport } from "./useBillingUsageReport.js";
|
|
|
6
6
|
export type { UseBillingUsageReportReturn } from "./useBillingUsageReport.js";
|
|
7
7
|
export { useCustomerModelPricing } from "./useCustomerModelPricing.js";
|
|
8
8
|
export type { UseCustomerModelPricingReturn } from "./useCustomerModelPricing.js";
|
|
9
|
+
export { usePricingGovernance } from "./usePricingGovernance.js";
|
|
10
|
+
export type { UsePricingGovernanceReturn } from "./usePricingGovernance.js";
|
|
11
|
+
export { useModelPricingBaselines } from "./useModelPricingBaselines.js";
|
|
12
|
+
export type { UseModelPricingBaselinesOptions, UseModelPricingBaselinesReturn, } from "./useModelPricingBaselines.js";
|
|
13
|
+
export { useModelGovernanceView } from "./useModelGovernanceView.js";
|
|
14
|
+
export type { GovernanceFlow, ModelGovernanceRow, UseModelGovernanceViewReturn, } from "./useModelGovernanceView.js";
|
|
9
15
|
export { useCreateCheckoutSession } from "./useCreateCheckoutSession.js";
|
|
10
16
|
export type { CreateCheckoutSessionInput, UseCreateCheckoutSessionReturn, } from "./useCreateCheckoutSession.js";
|
|
11
17
|
export { useCreateBillingPortalSession } from "./useCreateBillingPortalSession.js";
|
|
12
18
|
export type { UseCreateBillingPortalSessionReturn } from "./useCreateBillingPortalSession.js";
|
|
13
19
|
export { useSetAutoRechargeConfig } from "./useSetAutoRechargeConfig.js";
|
|
14
20
|
export type { SetAutoRechargeConfigInput, UseSetAutoRechargeConfigReturn, } from "./useSetAutoRechargeConfig.js";
|
|
21
|
+
export { useDecidePricingOverride } from "./useDecidePricingOverride.js";
|
|
22
|
+
export type { DecidePricingOverrideInput, UseDecidePricingOverrideReturn, } from "./useDecidePricingOverride.js";
|
|
23
|
+
export { useUpsertModelPricingBaseline } from "./useUpsertModelPricingBaseline.js";
|
|
24
|
+
export type { UpsertModelPricingBaselineInput, UseUpsertModelPricingBaselineReturn, } from "./useUpsertModelPricingBaseline.js";
|
|
25
|
+
export { useRetireModelPricingBaseline } from "./useRetireModelPricingBaseline.js";
|
|
26
|
+
export type { RetireModelPricingBaselineInput, UseRetireModelPricingBaselineReturn, } from "./useRetireModelPricingBaseline.js";
|
|
15
27
|
export { BillingSection } from "./BillingSection.js";
|
|
16
28
|
export type { BillingSectionProps } from "./BillingSection.js";
|
|
17
29
|
export { CreditBalanceCard } from "./CreditBalanceCard.js";
|
|
@@ -26,6 +38,12 @@ export { CreditLedgerTable } from "./CreditLedgerTable.js";
|
|
|
26
38
|
export type { CreditLedgerTableProps } from "./CreditLedgerTable.js";
|
|
27
39
|
export { LowBalanceBanner } from "./LowBalanceBanner.js";
|
|
28
40
|
export type { LowBalanceBannerProps } from "./LowBalanceBanner.js";
|
|
41
|
+
export { PricingGovernancePanel } from "./PricingGovernancePanel.js";
|
|
42
|
+
export type { PricingGovernancePanelProps } from "./PricingGovernancePanel.js";
|
|
43
|
+
export { ModelCatalogPanel } from "./ModelCatalogPanel.js";
|
|
44
|
+
export type { ModelCatalogPanelProps } from "./ModelCatalogPanel.js";
|
|
45
|
+
export { PricingGovernanceConsole } from "./PricingGovernanceConsole.js";
|
|
46
|
+
export type { PricingGovernanceConsoleProps, PricingGovernanceTab, } from "./PricingGovernanceConsole.js";
|
|
29
47
|
export { CREDIT_PACKS, formatPackPrice, formatCreditCount } from "./credit-packs.js";
|
|
30
48
|
export type { CreditPackInfo } from "./credit-packs.js";
|
|
31
49
|
export { formatCreditBalance, formatLedgerAmount, ledgerEntryLabel, isCredit, isHold, formatLedgerDate, } from "./format.js";
|
package/billing/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AA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EACN,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
package/billing/index.js
CHANGED
|
@@ -3,10 +3,16 @@ export { useBillingAccount } from "./useBillingAccount.js";
|
|
|
3
3
|
export { useCreditLedger } from "./useCreditLedger.js";
|
|
4
4
|
export { useBillingUsageReport } from "./useBillingUsageReport.js";
|
|
5
5
|
export { useCustomerModelPricing } from "./useCustomerModelPricing.js";
|
|
6
|
+
export { usePricingGovernance } from "./usePricingGovernance.js";
|
|
7
|
+
export { useModelPricingBaselines } from "./useModelPricingBaselines.js";
|
|
8
|
+
export { useModelGovernanceView } from "./useModelGovernanceView.js";
|
|
6
9
|
// Behavior hooks
|
|
7
10
|
export { useCreateCheckoutSession } from "./useCreateCheckoutSession.js";
|
|
8
11
|
export { useCreateBillingPortalSession } from "./useCreateBillingPortalSession.js";
|
|
9
12
|
export { useSetAutoRechargeConfig } from "./useSetAutoRechargeConfig.js";
|
|
13
|
+
export { useDecidePricingOverride } from "./useDecidePricingOverride.js";
|
|
14
|
+
export { useUpsertModelPricingBaseline } from "./useUpsertModelPricingBaseline.js";
|
|
15
|
+
export { useRetireModelPricingBaseline } from "./useRetireModelPricingBaseline.js";
|
|
10
16
|
// Styled components
|
|
11
17
|
export { BillingSection } from "./BillingSection.js";
|
|
12
18
|
export { CreditBalanceCard } from "./CreditBalanceCard.js";
|
|
@@ -15,6 +21,9 @@ export { AutoRechargeCard } from "./AutoRechargeCard.js";
|
|
|
15
21
|
export { CreditPackGrid } from "./CreditPackGrid.js";
|
|
16
22
|
export { CreditLedgerTable } from "./CreditLedgerTable.js";
|
|
17
23
|
export { LowBalanceBanner } from "./LowBalanceBanner.js";
|
|
24
|
+
export { PricingGovernancePanel } from "./PricingGovernancePanel.js";
|
|
25
|
+
export { ModelCatalogPanel } from "./ModelCatalogPanel.js";
|
|
26
|
+
export { PricingGovernanceConsole } from "./PricingGovernanceConsole.js";
|
|
18
27
|
// Credit pack catalog and formatting utilities
|
|
19
28
|
export { CREDIT_PACKS, formatPackPrice, formatCreditCount } from "./credit-packs.js";
|
|
20
29
|
export { formatCreditBalance, formatLedgerAmount, ledgerEntryLabel, isCredit, isHold, formatLedgerDate, } from "./format.js";
|
package/billing/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/billing/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAOrE,iBAAiB;AACjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAKnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAMnF,oBAAoB;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAMzE,+CAA+C;AAC/C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErF,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const ZERO: bigint;
|
|
2
|
+
/** Human labels for {@link PricingRateField} values. */
|
|
3
|
+
export declare const RATE_FIELD_LABELS: Record<number, string>;
|
|
4
|
+
/** Micro-USD per million tokens → "$X.XX/M" (raw provider rate). */
|
|
5
|
+
export declare function formatRate(microsPerMillion: bigint): string;
|
|
6
|
+
/** Basis points → signed percentage, e.g. 530n → "+5.30%". */
|
|
7
|
+
export declare function formatDeltaBp(deltaBp: bigint): string;
|
|
8
|
+
/** Micro-USD → editable dollar string, trailing zeros trimmed ("0.075"). */
|
|
9
|
+
export declare function microsToDollarString(micros: bigint): string;
|
|
10
|
+
/** Parse a dollar input; returns null for anything that is not a finite, non-negative number. */
|
|
11
|
+
export declare function dollarsToMicros(value: string): bigint | null;
|
|
12
|
+
//# sourceMappingURL=pricing-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-format.d.ts","sourceRoot":"","sources":["../../src/billing/pricing-format.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,IAAI,QAAY,CAAC;AAE9B,wDAAwD;AACxD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpD,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK3D;AAED,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM5D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PricingRateField } from "@stigmer/protos/ai/stigmer/billing/v1/pricing_override_pb";
|
|
2
|
+
// ---------------------------------------------------------------------------
|
|
3
|
+
// Shared money/label helpers for the platform-operator pricing surfaces
|
|
4
|
+
// (PricingGovernanceConsole and the panels it grew out of). Internal —
|
|
5
|
+
// not exported from the billing barrel.
|
|
6
|
+
//
|
|
7
|
+
// The UI works in dollars-per-million tokens; the protos store integer
|
|
8
|
+
// micro-USD. Registry prices carry at most 4 decimal places, so the
|
|
9
|
+
// round-trip through Math.round is exact.
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
// BigInt literals (0n) require an ES2020 target, which not every consuming
|
|
12
|
+
// app's tsconfig guarantees — the constructor form is target-agnostic.
|
|
13
|
+
export const ZERO = BigInt(0);
|
|
14
|
+
/** Human labels for {@link PricingRateField} values. */
|
|
15
|
+
export const RATE_FIELD_LABELS = {
|
|
16
|
+
[PricingRateField.input]: "Input",
|
|
17
|
+
[PricingRateField.output]: "Output",
|
|
18
|
+
[PricingRateField.cache_write]: "Cache write",
|
|
19
|
+
[PricingRateField.cache_read]: "Cache read",
|
|
20
|
+
[PricingRateField.cursor_token_rate]: "Cursor token rate",
|
|
21
|
+
};
|
|
22
|
+
/** Micro-USD per million tokens → "$X.XX/M" (raw provider rate). */
|
|
23
|
+
export function formatRate(microsPerMillion) {
|
|
24
|
+
const dollars = Number(microsPerMillion) / 1_000_000;
|
|
25
|
+
return `$${dollars.toFixed(dollars < 1 ? 4 : 2)}/M`;
|
|
26
|
+
}
|
|
27
|
+
/** Basis points → signed percentage, e.g. 530n → "+5.30%". */
|
|
28
|
+
export function formatDeltaBp(deltaBp) {
|
|
29
|
+
const pct = Number(deltaBp) / 100;
|
|
30
|
+
return `${pct > 0 ? "+" : ""}${pct.toFixed(2)}%`;
|
|
31
|
+
}
|
|
32
|
+
/** Micro-USD → editable dollar string, trailing zeros trimmed ("0.075"). */
|
|
33
|
+
export function microsToDollarString(micros) {
|
|
34
|
+
if (micros === ZERO)
|
|
35
|
+
return "0";
|
|
36
|
+
const dollars = Number(micros) / 1_000_000;
|
|
37
|
+
// Trim trailing zeros without losing sub-cent precision (e.g. 0.075).
|
|
38
|
+
return String(parseFloat(dollars.toFixed(6)));
|
|
39
|
+
}
|
|
40
|
+
/** Parse a dollar input; returns null for anything that is not a finite, non-negative number. */
|
|
41
|
+
export function dollarsToMicros(value) {
|
|
42
|
+
const trimmed = value.trim();
|
|
43
|
+
if (trimmed === "")
|
|
44
|
+
return null;
|
|
45
|
+
const parsed = Number(trimmed);
|
|
46
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
47
|
+
return null;
|
|
48
|
+
return BigInt(Math.round(parsed * 1_000_000));
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=pricing-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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AAU,oBAAoB,CAAC,MAAc;IACjD,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,GAAG,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC3C,sEAAsE;IACtE,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAChC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ModelPricingOverride } from "@stigmer/protos/ai/stigmer/billing/v1/pricing_override_pb";
|
|
2
|
+
/** Input for {@link useDecidePricingOverride}. */
|
|
3
|
+
export interface DecidePricingOverrideInput {
|
|
4
|
+
/** The PENDING_SIGNOFF override to decide. */
|
|
5
|
+
readonly overrideId: string;
|
|
6
|
+
/**
|
|
7
|
+
* `true` approves (the override becomes ACTIVE and supersedes any
|
|
8
|
+
* current ACTIVE override on the same pricing key); `false` rejects.
|
|
9
|
+
*/
|
|
10
|
+
readonly approve: boolean;
|
|
11
|
+
/** Optional note recorded on the decision for the audit trail. */
|
|
12
|
+
readonly decisionNote?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Return value of {@link useDecidePricingOverride}. */
|
|
15
|
+
export interface UseDecidePricingOverrideReturn {
|
|
16
|
+
/**
|
|
17
|
+
* Decide a pending pricing override. Returns the decided override with
|
|
18
|
+
* the operator's identity stamped.
|
|
19
|
+
*/
|
|
20
|
+
readonly decide: (input: DecidePricingOverrideInput) => Promise<ModelPricingOverride>;
|
|
21
|
+
/** `true` while a decision is being recorded. */
|
|
22
|
+
readonly isSubmitting: boolean;
|
|
23
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
24
|
+
readonly error: Error | null;
|
|
25
|
+
/** Reset `error` to `null`. */
|
|
26
|
+
readonly clearError: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Behavior hook for deciding PENDING_SIGNOFF pricing overrides from the
|
|
30
|
+
* pricing feedback loop.
|
|
31
|
+
*
|
|
32
|
+
* Wraps `billing.decideModelPricingOverride` with loading and error
|
|
33
|
+
* state. On approval the platform recomposes the effective registry
|
|
34
|
+
* immediately, so the parent should refetch its governance view after a
|
|
35
|
+
* successful decision.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* const { decide, isSubmitting } = useDecidePricingOverride();
|
|
40
|
+
*
|
|
41
|
+
* await decide({ overrideId, approve: true, decisionNote: "Verified vs ledger" });
|
|
42
|
+
* refetchGovernance();
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function useDecidePricingOverride(): UseDecidePricingOverrideReturn;
|
|
46
|
+
//# sourceMappingURL=useDecidePricingOverride.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDecidePricingOverride.d.ts","sourceRoot":"","sources":["../../src/billing/useDecidePricingOverride.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AAItG,kDAAkD;AAClD,MAAM,WAAW,0BAA0B;IACzC,8CAA8C;IAC9C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,wDAAwD;AACxD,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACtF,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,IAAI,8BAA8B,CAyBzE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../hooks.js";
|
|
4
|
+
import { toError } from "../internal/toError.js";
|
|
5
|
+
/**
|
|
6
|
+
* Behavior hook for deciding PENDING_SIGNOFF pricing overrides from the
|
|
7
|
+
* pricing feedback loop.
|
|
8
|
+
*
|
|
9
|
+
* Wraps `billing.decideModelPricingOverride` with loading and error
|
|
10
|
+
* state. On approval the platform recomposes the effective registry
|
|
11
|
+
* immediately, so the parent should refetch its governance view after a
|
|
12
|
+
* successful decision.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const { decide, isSubmitting } = useDecidePricingOverride();
|
|
17
|
+
*
|
|
18
|
+
* await decide({ overrideId, approve: true, decisionNote: "Verified vs ledger" });
|
|
19
|
+
* refetchGovernance();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function useDecidePricingOverride() {
|
|
23
|
+
const stigmer = useStigmer();
|
|
24
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
25
|
+
const [error, setError] = useState(null);
|
|
26
|
+
const decide = useCallback(async (input) => {
|
|
27
|
+
setIsSubmitting(true);
|
|
28
|
+
setError(null);
|
|
29
|
+
try {
|
|
30
|
+
return await stigmer.billing.decideModelPricingOverride(input);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
const err = toError(e);
|
|
34
|
+
setError(err);
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
setIsSubmitting(false);
|
|
39
|
+
}
|
|
40
|
+
}, [stigmer.billing]);
|
|
41
|
+
const clearError = useCallback(() => setError(null), []);
|
|
42
|
+
return { decide, isSubmitting, error, clearError };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=useDecidePricingOverride.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDecidePricingOverride.js","sourceRoot":"","sources":["../../src/billing/useDecidePricingOverride.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AA8BjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAAiC,EAAiC,EAAE;QACzE,eAAe,CAAC,IAAI,CAAC,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,KAAK,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