@stigmer/react 3.2.3 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/steps/ReviewStep.d.ts.map +1 -1
- package/agent/steps/ReviewStep.js +2 -3
- package/agent/steps/ReviewStep.js.map +1 -1
- package/billing/BaselineEditor.d.ts +9 -0
- package/billing/BaselineEditor.d.ts.map +1 -0
- package/billing/BaselineEditor.js +253 -0
- package/billing/BaselineEditor.js.map +1 -0
- package/billing/ModelCatalogPanel.d.ts +28 -0
- package/billing/ModelCatalogPanel.d.ts.map +1 -0
- package/billing/ModelCatalogPanel.js +102 -0
- package/billing/ModelCatalogPanel.js.map +1 -0
- package/billing/ModelGovernanceDetail.d.ts +8 -0
- package/billing/ModelGovernanceDetail.d.ts.map +1 -0
- package/billing/ModelGovernanceDetail.js +64 -0
- package/billing/ModelGovernanceDetail.js.map +1 -0
- package/billing/OperatorAccessNotice.d.ts +12 -0
- package/billing/OperatorAccessNotice.d.ts.map +1 -0
- package/billing/OperatorAccessNotice.js +15 -0
- package/billing/OperatorAccessNotice.js.map +1 -0
- package/billing/PricingGovernanceConsole.d.ts +57 -0
- package/billing/PricingGovernanceConsole.d.ts.map +1 -0
- package/billing/PricingGovernanceConsole.js +164 -0
- package/billing/PricingGovernanceConsole.js.map +1 -0
- package/billing/PricingGovernancePanel.d.ts +26 -0
- package/billing/PricingGovernancePanel.d.ts.map +1 -0
- package/billing/PricingGovernancePanel.js +64 -0
- package/billing/PricingGovernancePanel.js.map +1 -0
- package/billing/RetireConfirm.d.ts +9 -0
- package/billing/RetireConfirm.d.ts.map +1 -0
- package/billing/RetireConfirm.js +19 -0
- package/billing/RetireConfirm.js.map +1 -0
- package/billing/form-primitives.d.ts +18 -0
- package/billing/form-primitives.d.ts.map +1 -0
- package/billing/form-primitives.js +19 -0
- package/billing/form-primitives.js.map +1 -0
- package/billing/governance-primitives.d.ts +33 -0
- package/billing/governance-primitives.d.ts.map +1 -0
- package/billing/governance-primitives.js +43 -0
- package/billing/governance-primitives.js.map +1 -0
- package/billing/index.d.ts +18 -0
- package/billing/index.d.ts.map +1 -1
- package/billing/index.js +9 -0
- package/billing/index.js.map +1 -1
- package/billing/pricing-format.d.ts +12 -0
- package/billing/pricing-format.d.ts.map +1 -0
- package/billing/pricing-format.js +50 -0
- package/billing/pricing-format.js.map +1 -0
- package/billing/useDecidePricingOverride.d.ts +46 -0
- package/billing/useDecidePricingOverride.d.ts.map +1 -0
- package/billing/useDecidePricingOverride.js +44 -0
- package/billing/useDecidePricingOverride.js.map +1 -0
- package/billing/useModelGovernanceView.d.ts +103 -0
- package/billing/useModelGovernanceView.d.ts.map +1 -0
- package/billing/useModelGovernanceView.js +144 -0
- package/billing/useModelGovernanceView.js.map +1 -0
- package/billing/useModelPricingBaselines.d.ts +40 -0
- package/billing/useModelPricingBaselines.d.ts.map +1 -0
- package/billing/useModelPricingBaselines.js +32 -0
- package/billing/useModelPricingBaselines.js.map +1 -0
- package/billing/usePricingGovernance.d.ts +39 -0
- package/billing/usePricingGovernance.d.ts.map +1 -0
- package/billing/usePricingGovernance.js +31 -0
- package/billing/usePricingGovernance.js.map +1 -0
- package/billing/useRetireModelPricingBaseline.d.ts +31 -0
- package/billing/useRetireModelPricingBaseline.d.ts.map +1 -0
- package/billing/useRetireModelPricingBaseline.js +36 -0
- package/billing/useRetireModelPricingBaseline.js.map +1 -0
- package/billing/useUpsertModelPricingBaseline.d.ts +38 -0
- package/billing/useUpsertModelPricingBaseline.d.ts.map +1 -0
- package/billing/useUpsertModelPricingBaseline.js +37 -0
- package/billing/useUpsertModelPricingBaseline.js.map +1 -0
- package/channel/AgentChannelsPanel.d.ts.map +1 -1
- package/channel/AgentChannelsPanel.js +11 -5
- package/channel/AgentChannelsPanel.js.map +1 -1
- package/composer/SessionComposer.d.ts +1 -1
- package/cursor-accounts/CursorAccountEditor.d.ts +28 -0
- package/cursor-accounts/CursorAccountEditor.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountEditor.js +51 -0
- package/cursor-accounts/CursorAccountEditor.js.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts +11 -0
- package/cursor-accounts/CursorAccountsAccessNotice.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js +14 -0
- package/cursor-accounts/CursorAccountsAccessNotice.js.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts +28 -0
- package/cursor-accounts/CursorAccountsConsole.d.ts.map +1 -0
- package/cursor-accounts/CursorAccountsConsole.js +275 -0
- package/cursor-accounts/CursorAccountsConsole.js.map +1 -0
- package/cursor-accounts/cursor-account-format.d.ts +10 -0
- package/cursor-accounts/cursor-account-format.d.ts.map +1 -0
- package/cursor-accounts/cursor-account-format.js +26 -0
- package/cursor-accounts/cursor-account-format.js.map +1 -0
- package/cursor-accounts/index.d.ts +18 -0
- package/cursor-accounts/index.d.ts.map +1 -0
- package/cursor-accounts/index.js +13 -0
- package/cursor-accounts/index.js.map +1 -0
- package/cursor-accounts/useCursorAccountView.d.ts +30 -0
- package/cursor-accounts/useCursorAccountView.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccountView.js +25 -0
- package/cursor-accounts/useCursorAccountView.js.map +1 -0
- package/cursor-accounts/useCursorAccounts.d.ts +33 -0
- package/cursor-accounts/useCursorAccounts.d.ts.map +1 -0
- package/cursor-accounts/useCursorAccounts.js +25 -0
- package/cursor-accounts/useCursorAccounts.js.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts +49 -0
- package/cursor-accounts/useCursorMemberKeyActions.d.ts.map +1 -0
- package/cursor-accounts/useCursorMemberKeyActions.js +38 -0
- package/cursor-accounts/useCursorMemberKeyActions.js.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts +30 -0
- package/cursor-accounts/useDeleteCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useDeleteCursorAccount.js +32 -0
- package/cursor-accounts/useDeleteCursorAccount.js.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts +23 -0
- package/cursor-accounts/useSyncCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useSyncCursorAccount.js +31 -0
- package/cursor-accounts/useSyncCursorAccount.js.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts +26 -0
- package/cursor-accounts/useUpsertCursorAccount.d.ts.map +1 -0
- package/cursor-accounts/useUpsertCursorAccount.js +34 -0
- package/cursor-accounts/useUpsertCursorAccount.js.map +1 -0
- package/datastore/CollectionRecordsBrowser.d.ts +34 -0
- package/datastore/CollectionRecordsBrowser.d.ts.map +1 -0
- package/datastore/CollectionRecordsBrowser.js +209 -0
- package/datastore/CollectionRecordsBrowser.js.map +1 -0
- package/datastore/CollectionSchemaView.d.ts +29 -0
- package/datastore/CollectionSchemaView.d.ts.map +1 -0
- package/datastore/CollectionSchemaView.js +93 -0
- package/datastore/CollectionSchemaView.js.map +1 -0
- package/datastore/DatastoreDetailView.d.ts +44 -0
- package/datastore/DatastoreDetailView.d.ts.map +1 -0
- package/datastore/DatastoreDetailView.js +76 -0
- package/datastore/DatastoreDetailView.js.map +1 -0
- package/datastore/DatastoreSyncReport.d.ts +19 -0
- package/datastore/DatastoreSyncReport.d.ts.map +1 -0
- package/datastore/DatastoreSyncReport.js +45 -0
- package/datastore/DatastoreSyncReport.js.map +1 -0
- package/datastore/DeleteDatastoreDialog.d.ts +35 -0
- package/datastore/DeleteDatastoreDialog.d.ts.map +1 -0
- package/datastore/DeleteDatastoreDialog.js +90 -0
- package/datastore/DeleteDatastoreDialog.js.map +1 -0
- package/datastore/FieldValueControl.d.ts +55 -0
- package/datastore/FieldValueControl.d.ts.map +1 -0
- package/datastore/FieldValueControl.js +138 -0
- package/datastore/FieldValueControl.js.map +1 -0
- package/datastore/RecordFilterBuilder.d.ts +30 -0
- package/datastore/RecordFilterBuilder.d.ts.map +1 -0
- package/datastore/RecordFilterBuilder.js +122 -0
- package/datastore/RecordFilterBuilder.js.map +1 -0
- package/datastore/RecordFormPanel.d.ts +45 -0
- package/datastore/RecordFormPanel.d.ts.map +1 -0
- package/datastore/RecordFormPanel.js +215 -0
- package/datastore/RecordFormPanel.js.map +1 -0
- package/datastore/index.d.ts +43 -0
- package/datastore/index.d.ts.map +1 -0
- package/datastore/index.js +22 -0
- package/datastore/index.js.map +1 -0
- package/datastore/recordFilter.d.ts +54 -0
- package/datastore/recordFilter.d.ts.map +1 -0
- package/datastore/recordFilter.js +93 -0
- package/datastore/recordFilter.js.map +1 -0
- package/datastore/recordValues.d.ts +85 -0
- package/datastore/recordValues.d.ts.map +1 -0
- package/datastore/recordValues.js +282 -0
- package/datastore/recordValues.js.map +1 -0
- package/datastore/useDatastore.d.ts +39 -0
- package/datastore/useDatastore.d.ts.map +1 -0
- package/datastore/useDatastore.js +44 -0
- package/datastore/useDatastore.js.map +1 -0
- package/datastore/useDatastoreCount.d.ts +48 -0
- package/datastore/useDatastoreCount.d.ts.map +1 -0
- package/datastore/useDatastoreCount.js +27 -0
- package/datastore/useDatastoreCount.js.map +1 -0
- package/datastore/useDatastoreDescription.d.ts +54 -0
- package/datastore/useDatastoreDescription.d.ts.map +1 -0
- package/datastore/useDatastoreDescription.js +50 -0
- package/datastore/useDatastoreDescription.js.map +1 -0
- package/datastore/useDatastoreList.d.ts +57 -0
- package/datastore/useDatastoreList.d.ts.map +1 -0
- package/datastore/useDatastoreList.js +29 -0
- package/datastore/useDatastoreList.js.map +1 -0
- package/datastore/useDatastoreSearch.d.ts +19 -0
- package/datastore/useDatastoreSearch.d.ts.map +1 -0
- package/datastore/useDatastoreSearch.js +22 -0
- package/datastore/useDatastoreSearch.js.map +1 -0
- package/datastore/useDeleteDatastore.d.ts +53 -0
- package/datastore/useDeleteDatastore.d.ts.map +1 -0
- package/datastore/useDeleteDatastore.js +40 -0
- package/datastore/useDeleteDatastore.js.map +1 -0
- package/datastore/useDeleteRecord.d.ts +34 -0
- package/datastore/useDeleteRecord.d.ts.map +1 -0
- package/datastore/useDeleteRecord.js +43 -0
- package/datastore/useDeleteRecord.js.map +1 -0
- package/datastore/useInsertRecord.d.ts +50 -0
- package/datastore/useInsertRecord.d.ts.map +1 -0
- package/datastore/useInsertRecord.js +55 -0
- package/datastore/useInsertRecord.js.map +1 -0
- package/datastore/useRecordCollection.d.ts +104 -0
- package/datastore/useRecordCollection.d.ts.map +1 -0
- package/datastore/useRecordCollection.js +136 -0
- package/datastore/useRecordCollection.js.map +1 -0
- package/datastore/useRecordList.d.ts +66 -0
- package/datastore/useRecordList.d.ts.map +1 -0
- package/datastore/useRecordList.js +58 -0
- package/datastore/useRecordList.js.map +1 -0
- package/datastore/useUpdateRecord.d.ts +52 -0
- package/datastore/useUpdateRecord.d.ts.map +1 -0
- package/datastore/useUpdateRecord.js +55 -0
- package/datastore/useUpdateRecord.js.map +1 -0
- package/environment/EnvironmentListPanel.d.ts.map +1 -1
- package/environment/EnvironmentListPanel.js +12 -7
- package/environment/EnvironmentListPanel.js.map +1 -1
- package/iam-policy/index.d.ts +1 -1
- package/iam-policy/index.d.ts.map +1 -1
- package/iam-policy/index.js.map +1 -1
- package/iam-policy/useCheckPermission.d.ts +32 -11
- package/iam-policy/useCheckPermission.d.ts.map +1 -1
- package/iam-policy/useCheckPermission.js +24 -19
- package/iam-policy/useCheckPermission.js.map +1 -1
- package/index.d.ts +12 -6
- package/index.d.ts.map +1 -1
- package/index.js +14 -3
- package/index.js.map +1 -1
- package/library/index.d.ts +0 -7
- package/library/index.d.ts.map +1 -1
- package/library/index.js +0 -4
- package/library/index.js.map +1 -1
- package/library/useApplyResource.d.ts +12 -12
- package/library/useApplyResource.d.ts.map +1 -1
- package/library/useApplyResource.js +16 -25
- package/library/useApplyResource.js.map +1 -1
- package/library/useExportResource.d.ts +13 -9
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +18 -36
- package/library/useExportResource.js.map +1 -1
- package/manifest/ApplyManifestDialog.d.ts +48 -0
- package/manifest/ApplyManifestDialog.d.ts.map +1 -0
- package/manifest/ApplyManifestDialog.js +135 -0
- package/manifest/ApplyManifestDialog.js.map +1 -0
- package/manifest/EditResourceYamlDialog.d.ts +51 -0
- package/manifest/EditResourceYamlDialog.d.ts.map +1 -0
- package/manifest/EditResourceYamlDialog.js +104 -0
- package/manifest/EditResourceYamlDialog.js.map +1 -0
- package/manifest/RedactedSecretsNotice.d.ts +14 -0
- package/manifest/RedactedSecretsNotice.d.ts.map +1 -0
- package/manifest/RedactedSecretsNotice.js +14 -0
- package/manifest/RedactedSecretsNotice.js.map +1 -0
- package/manifest/YamlEditor.d.ts +44 -0
- package/manifest/YamlEditor.d.ts.map +1 -0
- package/manifest/YamlEditor.js +216 -0
- package/manifest/YamlEditor.js.map +1 -0
- package/manifest/index.d.ts +13 -0
- package/manifest/index.d.ts.map +1 -0
- package/manifest/index.js +13 -0
- package/manifest/index.js.map +1 -0
- package/manifest/useApplyManifest.d.ts +82 -0
- package/manifest/useApplyManifest.d.ts.map +1 -0
- package/manifest/useApplyManifest.js +180 -0
- package/manifest/useApplyManifest.js.map +1 -0
- package/manifest/useEditResourceYaml.d.ts +106 -0
- package/manifest/useEditResourceYaml.d.ts.map +1 -0
- package/manifest/useEditResourceYaml.js +168 -0
- package/manifest/useEditResourceYaml.js.map +1 -0
- package/mcp-server/steps/ReviewStep.d.ts.map +1 -1
- package/mcp-server/steps/ReviewStep.js +2 -3
- package/mcp-server/steps/ReviewStep.js.map +1 -1
- package/package.json +4 -4
- package/resource-creation/templates/workflow-templates.js +4 -4
- package/session/useEditSessionPrep.js +3 -3
- package/session/useEditSessionPrep.js.map +1 -1
- package/settings/index.d.ts +2 -1
- package/settings/index.d.ts.map +1 -1
- package/settings/index.js +2 -1
- package/settings/index.js.map +1 -1
- package/settings/settings-nav.d.ts +22 -0
- package/settings/settings-nav.d.ts.map +1 -1
- package/settings/settings-nav.js +32 -1
- package/settings/settings-nav.js.map +1 -1
- package/settings/useSettingsNavGroups.d.ts +29 -0
- package/settings/useSettingsNavGroups.d.ts.map +1 -0
- package/settings/useSettingsNavGroups.js +61 -0
- package/settings/useSettingsNavGroups.js.map +1 -0
- package/src/agent/steps/ReviewStep.tsx +2 -3
- package/src/billing/BaselineEditor.tsx +619 -0
- package/src/billing/ModelCatalogPanel.tsx +283 -0
- package/src/billing/ModelGovernanceDetail.tsx +289 -0
- package/src/billing/OperatorAccessNotice.tsx +32 -0
- package/src/billing/PricingGovernanceConsole.tsx +465 -0
- package/src/billing/PricingGovernancePanel.tsx +166 -0
- package/src/billing/RetireConfirm.tsx +82 -0
- package/src/billing/__tests__/ModelCatalogPanel.test.tsx +253 -0
- package/src/billing/__tests__/PricingGovernanceConsole.test.tsx +410 -0
- package/src/billing/__tests__/useModelGovernanceView.test.tsx +308 -0
- package/src/billing/form-primitives.tsx +68 -0
- package/src/billing/governance-primitives.tsx +133 -0
- package/src/billing/index.ts +37 -0
- package/src/billing/pricing-format.ts +53 -0
- package/src/billing/useDecidePricingOverride.ts +78 -0
- package/src/billing/useModelGovernanceView.ts +290 -0
- package/src/billing/useModelPricingBaselines.ts +69 -0
- package/src/billing/usePricingGovernance.ts +57 -0
- package/src/billing/useRetireModelPricingBaseline.ts +65 -0
- package/src/billing/useUpsertModelPricingBaseline.ts +72 -0
- package/src/channel/AgentChannelsPanel.tsx +27 -1
- package/src/composer/SessionComposer.tsx +1 -1
- package/src/cursor-accounts/CursorAccountEditor.tsx +181 -0
- package/src/cursor-accounts/CursorAccountsAccessNotice.tsx +36 -0
- package/src/cursor-accounts/CursorAccountsConsole.tsx +810 -0
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +384 -0
- package/src/cursor-accounts/cursor-account-format.ts +29 -0
- package/src/cursor-accounts/index.ts +29 -0
- package/src/cursor-accounts/useCursorAccountView.ts +49 -0
- package/src/cursor-accounts/useCursorAccounts.ts +49 -0
- package/src/cursor-accounts/useCursorMemberKeyActions.ts +106 -0
- package/src/cursor-accounts/useDeleteCursorAccount.ts +62 -0
- package/src/cursor-accounts/useSyncCursorAccount.ts +54 -0
- package/src/cursor-accounts/useUpsertCursorAccount.ts +57 -0
- package/src/datastore/CollectionRecordsBrowser.tsx +544 -0
- package/src/datastore/CollectionSchemaView.tsx +247 -0
- package/src/datastore/DatastoreDetailView.tsx +201 -0
- package/src/datastore/DatastoreSyncReport.tsx +105 -0
- package/src/datastore/DeleteDatastoreDialog.tsx +202 -0
- package/src/datastore/FieldValueControl.tsx +289 -0
- package/src/datastore/RecordFilterBuilder.tsx +411 -0
- package/src/datastore/RecordFormPanel.tsx +432 -0
- package/src/datastore/__tests__/CollectionRecordsBrowser.test.tsx +207 -0
- package/src/datastore/__tests__/DeleteDatastoreDialog.test.tsx +133 -0
- package/src/datastore/__tests__/FieldValueControl.test.tsx +160 -0
- package/src/datastore/__tests__/RecordFilterBuilder.test.tsx +141 -0
- package/src/datastore/__tests__/RecordFormPanel.test.tsx +227 -0
- package/src/datastore/__tests__/recordFilter.test.ts +156 -0
- package/src/datastore/__tests__/recordMutations.test.tsx +195 -0
- package/src/datastore/__tests__/recordValues.test.ts +359 -0
- package/src/datastore/__tests__/schemaAndSyncViews.test.tsx +142 -0
- package/src/datastore/__tests__/useDatastoreDescription.test.tsx +143 -0
- package/src/datastore/__tests__/useRecordCollection.test.tsx +250 -0
- package/src/datastore/__tests__/useRecordList.test.tsx +85 -0
- package/src/datastore/index.ts +111 -0
- package/src/datastore/recordFilter.ts +140 -0
- package/src/datastore/recordValues.ts +327 -0
- package/src/datastore/useDatastore.ts +67 -0
- package/src/datastore/useDatastoreCount.ts +67 -0
- package/src/datastore/useDatastoreDescription.ts +90 -0
- package/src/datastore/useDatastoreList.ts +79 -0
- package/src/datastore/useDatastoreSearch.ts +39 -0
- package/src/datastore/useDeleteDatastore.ts +87 -0
- package/src/datastore/useDeleteRecord.ts +77 -0
- package/src/datastore/useInsertRecord.ts +92 -0
- package/src/datastore/useRecordCollection.ts +256 -0
- package/src/datastore/useRecordList.ts +131 -0
- package/src/datastore/useUpdateRecord.ts +95 -0
- package/src/environment/EnvironmentListPanel.tsx +24 -0
- package/src/execution/__tests__/useArtifactInspection.test.tsx +12 -2
- package/src/iam-policy/__tests__/useCheckPermission.test.tsx +221 -0
- package/src/iam-policy/index.ts +1 -0
- package/src/iam-policy/useCheckPermission.ts +45 -19
- package/src/index.ts +163 -13
- package/src/library/index.ts +0 -20
- package/src/library/useApplyResource.ts +27 -34
- package/src/library/useExportResource.ts +21 -40
- package/src/manifest/ApplyManifestDialog.tsx +315 -0
- package/src/manifest/EditResourceYamlDialog.tsx +265 -0
- package/src/manifest/RedactedSecretsNotice.tsx +30 -0
- package/src/manifest/YamlEditor.tsx +272 -0
- package/src/manifest/__tests__/EditResourceYamlDialog.test.tsx +118 -0
- package/src/manifest/__tests__/useApplyManifest.test.tsx +237 -0
- package/src/manifest/__tests__/useEditResourceYaml.test.tsx +252 -0
- package/src/manifest/index.ts +33 -0
- package/src/manifest/useApplyManifest.ts +270 -0
- package/src/manifest/useEditResourceYaml.ts +273 -0
- package/src/mcp-server/steps/ReviewStep.tsx +2 -3
- package/src/resource-creation/templates/workflow-templates.ts +4 -4
- package/src/session/useEditSessionPrep.ts +3 -3
- package/src/settings/__tests__/useSettingsNavGroups.test.tsx +138 -0
- package/src/settings/index.ts +5 -1
- package/src/settings/settings-nav.ts +43 -0
- package/src/settings/useSettingsNavGroups.ts +81 -0
- package/src/workflow/WorkflowYamlEditor.tsx +6 -270
- package/styles.css +1 -1
- package/workflow/CanvasTransitionEdge.d.ts +1 -1
- package/workflow/WorkflowYamlEditor.d.ts +2 -42
- package/workflow/WorkflowYamlEditor.d.ts.map +1 -1
- package/workflow/WorkflowYamlEditor.js +5 -214
- package/workflow/WorkflowYamlEditor.js.map +1 -1
- package/library/ImportResourceDialog.d.ts +0 -43
- package/library/ImportResourceDialog.d.ts.map +0 -1
- package/library/ImportResourceDialog.js +0 -90
- package/library/ImportResourceDialog.js.map +0 -1
- package/library/parse-resource-yaml.d.ts +0 -63
- package/library/parse-resource-yaml.d.ts.map +0 -1
- package/library/parse-resource-yaml.js +0 -407
- package/library/parse-resource-yaml.js.map +0 -1
- package/library/serialize-resource-yaml.d.ts +0 -103
- package/library/serialize-resource-yaml.d.ts.map +0 -1
- package/library/serialize-resource-yaml.js +0 -565
- package/library/serialize-resource-yaml.js.map +0 -1
- package/library/useImportResource.d.ts +0 -84
- package/library/useImportResource.d.ts.map +0 -1
- package/library/useImportResource.js +0 -188
- package/library/useImportResource.js.map +0 -1
- package/src/library/ImportResourceDialog.tsx +0 -227
- package/src/library/parse-resource-yaml.ts +0 -630
- package/src/library/serialize-resource-yaml.ts +0 -756
- package/src/library/useImportResource.ts +0 -253
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage, isPermissionDenied } from "@stigmer/sdk";
|
|
6
|
+
import {
|
|
7
|
+
ModelPricingBaselineStatus,
|
|
8
|
+
type ModelPricingBaseline,
|
|
9
|
+
} from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
10
|
+
import { Button } from "../button/index.js";
|
|
11
|
+
import { BaselineEditor } from "./BaselineEditor.js";
|
|
12
|
+
import { RetireConfirm } from "./RetireConfirm.js";
|
|
13
|
+
import { OperatorAccessNotice } from "./OperatorAccessNotice.js";
|
|
14
|
+
import { ZERO, formatRate } from "./pricing-format.js";
|
|
15
|
+
import { useModelPricingBaselines } from "./useModelPricingBaselines.js";
|
|
16
|
+
import { useUpsertModelPricingBaseline } from "./useUpsertModelPricingBaseline.js";
|
|
17
|
+
import { useRetireModelPricingBaseline } from "./useRetireModelPricingBaseline.js";
|
|
18
|
+
|
|
19
|
+
/** Props for {@link ModelCatalogPanel}. */
|
|
20
|
+
export interface ModelCatalogPanelProps {
|
|
21
|
+
/** Additional CSS class names. */
|
|
22
|
+
readonly className?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type EditorState =
|
|
26
|
+
| { readonly mode: "create" }
|
|
27
|
+
| { readonly mode: "edit"; readonly baseline: ModelPricingBaseline };
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Platform-operator panel for authoring the model registry baseline:
|
|
31
|
+
* the catalog list with revision history, an add/edit form with an
|
|
32
|
+
* explicit old-to-new rate confirmation, and typed-confirmation
|
|
33
|
+
* retirement (DD-004 — this replaces hand edits of
|
|
34
|
+
* `model-registry.json`).
|
|
35
|
+
*
|
|
36
|
+
* Prefer {@link PricingGovernanceConsole} for new surfaces — it
|
|
37
|
+
* composes this catalog with the governance view into one tabbed
|
|
38
|
+
* console. This standalone panel remains for consumers embedding just
|
|
39
|
+
* the catalog editor.
|
|
40
|
+
*
|
|
41
|
+
* Requires `can_manage_model_pricing` on `platform:stigmer` — render it
|
|
42
|
+
* only in operator-scoped surfaces. Rates are raw provider prices
|
|
43
|
+
* (pre-markup), not customer prices.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <ModelCatalogPanel />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export function ModelCatalogPanel({ className }: ModelCatalogPanelProps) {
|
|
51
|
+
const [showHistory, setShowHistory] = useState(false);
|
|
52
|
+
const { baselines, isLoading, error, refetch } = useModelPricingBaselines({
|
|
53
|
+
includeHistory: showHistory,
|
|
54
|
+
});
|
|
55
|
+
const { upsert, isSubmitting: isUpserting, error: upsertError, clearError: clearUpsertError } =
|
|
56
|
+
useUpsertModelPricingBaseline();
|
|
57
|
+
const { retire, isSubmitting: isRetiring, error: retireError, clearError: clearRetireError } =
|
|
58
|
+
useRetireModelPricingBaseline();
|
|
59
|
+
|
|
60
|
+
const [editor, setEditor] = useState<EditorState | null>(null);
|
|
61
|
+
const [retireTarget, setRetireTarget] = useState<ModelPricingBaseline | null>(null);
|
|
62
|
+
|
|
63
|
+
const activeBaselines = useMemo(
|
|
64
|
+
() =>
|
|
65
|
+
(baselines ?? []).filter(
|
|
66
|
+
(b) => b.status === ModelPricingBaselineStatus.pricing_baseline_active,
|
|
67
|
+
),
|
|
68
|
+
[baselines],
|
|
69
|
+
);
|
|
70
|
+
const historyByKey = useMemo(() => {
|
|
71
|
+
const map = new Map<string, ModelPricingBaseline[]>();
|
|
72
|
+
if (!showHistory) return map;
|
|
73
|
+
for (const b of baselines ?? []) {
|
|
74
|
+
if (b.status === ModelPricingBaselineStatus.pricing_baseline_active) continue;
|
|
75
|
+
const key = `${b.modelId}|${b.provider}|${b.harness}`;
|
|
76
|
+
map.set(key, [...(map.get(key) ?? []), b]);
|
|
77
|
+
}
|
|
78
|
+
return map;
|
|
79
|
+
}, [baselines, showHistory]);
|
|
80
|
+
|
|
81
|
+
const closeEditor = useCallback(() => {
|
|
82
|
+
setEditor(null);
|
|
83
|
+
clearUpsertError();
|
|
84
|
+
}, [clearUpsertError]);
|
|
85
|
+
|
|
86
|
+
const handleUpsert = useCallback(
|
|
87
|
+
async (baseline: ModelPricingBaseline, revisionNote: string) => {
|
|
88
|
+
await upsert({ baseline, revisionNote: revisionNote || undefined });
|
|
89
|
+
setEditor(null);
|
|
90
|
+
refetch();
|
|
91
|
+
},
|
|
92
|
+
[upsert, refetch],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const handleRetire = useCallback(
|
|
96
|
+
async (target: ModelPricingBaseline, revisionNote: string) => {
|
|
97
|
+
await retire({
|
|
98
|
+
modelId: target.modelId,
|
|
99
|
+
provider: target.provider,
|
|
100
|
+
harness: target.harness,
|
|
101
|
+
revisionNote: revisionNote || undefined,
|
|
102
|
+
});
|
|
103
|
+
setRetireTarget(null);
|
|
104
|
+
refetch();
|
|
105
|
+
},
|
|
106
|
+
[retire, refetch],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
if (isLoading) {
|
|
110
|
+
return (
|
|
111
|
+
<div className={cn("space-y-2", className)} aria-busy="true">
|
|
112
|
+
<div className="h-4 w-40 animate-pulse rounded bg-muted-subtle" />
|
|
113
|
+
{Array.from({ length: 4 }, (_, i) => (
|
|
114
|
+
<div key={i} className="h-10 animate-pulse rounded-lg bg-muted-subtle" />
|
|
115
|
+
))}
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (error) {
|
|
121
|
+
// A non-operator landing here is expected (the route is reachable by
|
|
122
|
+
// URL) — show the designed access notice, not a raw RPC error.
|
|
123
|
+
if (isPermissionDenied(error)) {
|
|
124
|
+
return <OperatorAccessNotice className={className} />;
|
|
125
|
+
}
|
|
126
|
+
return (
|
|
127
|
+
<p className={cn("text-destructive text-xs", className)} role="alert">
|
|
128
|
+
{getUserMessage(error)}
|
|
129
|
+
</p>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<section className={cn("space-y-3", className)} aria-label="Model catalog">
|
|
135
|
+
<div className="flex items-center justify-between">
|
|
136
|
+
<h3 className="text-xs font-semibold text-foreground">Model Catalog</h3>
|
|
137
|
+
<div className="flex items-center gap-3">
|
|
138
|
+
<label className="flex cursor-pointer items-center gap-1.5 text-[11px] text-muted-foreground">
|
|
139
|
+
<input
|
|
140
|
+
type="checkbox"
|
|
141
|
+
checked={showHistory}
|
|
142
|
+
onChange={(e) => setShowHistory(e.target.checked)}
|
|
143
|
+
/>
|
|
144
|
+
Show revision history
|
|
145
|
+
</label>
|
|
146
|
+
<Button size="sm" onClick={() => setEditor({ mode: "create" })} disabled={editor !== null}>
|
|
147
|
+
Add model
|
|
148
|
+
</Button>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
{editor && (
|
|
153
|
+
<BaselineEditor
|
|
154
|
+
initial={editor.mode === "edit" ? editor.baseline : null}
|
|
155
|
+
isSubmitting={isUpserting}
|
|
156
|
+
submitError={upsertError}
|
|
157
|
+
onSubmit={handleUpsert}
|
|
158
|
+
onCancel={closeEditor}
|
|
159
|
+
/>
|
|
160
|
+
)}
|
|
161
|
+
|
|
162
|
+
{retireTarget && (
|
|
163
|
+
<RetireConfirm
|
|
164
|
+
target={retireTarget}
|
|
165
|
+
isSubmitting={isRetiring}
|
|
166
|
+
submitError={retireError}
|
|
167
|
+
onConfirm={handleRetire}
|
|
168
|
+
onCancel={() => {
|
|
169
|
+
setRetireTarget(null);
|
|
170
|
+
clearRetireError();
|
|
171
|
+
}}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
<div className="rounded-lg border border-border bg-card" role="table" aria-label="Baseline catalog">
|
|
176
|
+
<div
|
|
177
|
+
role="row"
|
|
178
|
+
className="grid grid-cols-[2fr_1fr_1fr_1fr_1fr_auto] gap-2 border-b border-border px-3 py-2 text-[11px] font-medium text-muted-foreground"
|
|
179
|
+
>
|
|
180
|
+
<span role="columnheader">Model</span>
|
|
181
|
+
<span role="columnheader">Harness</span>
|
|
182
|
+
<span role="columnheader" className="text-right">Input</span>
|
|
183
|
+
<span role="columnheader" className="text-right">Output</span>
|
|
184
|
+
<span role="columnheader" className="text-right">Variants</span>
|
|
185
|
+
<span role="columnheader" className="sr-only">Actions</span>
|
|
186
|
+
</div>
|
|
187
|
+
{activeBaselines.length === 0 ? (
|
|
188
|
+
<p className="px-3 py-2 text-xs text-muted-foreground">
|
|
189
|
+
The catalog is empty — has the baseline seed migration run?
|
|
190
|
+
</p>
|
|
191
|
+
) : (
|
|
192
|
+
activeBaselines.map((baseline) => (
|
|
193
|
+
<CatalogRow
|
|
194
|
+
key={baseline.baselineId}
|
|
195
|
+
baseline={baseline}
|
|
196
|
+
history={historyByKey.get(
|
|
197
|
+
`${baseline.modelId}|${baseline.provider}|${baseline.harness}`,
|
|
198
|
+
)}
|
|
199
|
+
disabled={editor !== null || retireTarget !== null}
|
|
200
|
+
onEdit={() => setEditor({ mode: "edit", baseline })}
|
|
201
|
+
onRetire={() => setRetireTarget(baseline)}
|
|
202
|
+
/>
|
|
203
|
+
))
|
|
204
|
+
)}
|
|
205
|
+
</div>
|
|
206
|
+
</section>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// ---------------------------------------------------------------------------
|
|
211
|
+
// CatalogRow (internal)
|
|
212
|
+
// ---------------------------------------------------------------------------
|
|
213
|
+
|
|
214
|
+
function CatalogRow({
|
|
215
|
+
baseline,
|
|
216
|
+
history,
|
|
217
|
+
disabled,
|
|
218
|
+
onEdit,
|
|
219
|
+
onRetire,
|
|
220
|
+
}: {
|
|
221
|
+
readonly baseline: ModelPricingBaseline;
|
|
222
|
+
readonly history?: readonly ModelPricingBaseline[];
|
|
223
|
+
readonly disabled: boolean;
|
|
224
|
+
readonly onEdit: () => void;
|
|
225
|
+
readonly onRetire: () => void;
|
|
226
|
+
}) {
|
|
227
|
+
const variantCount = Object.keys(baseline.pricingVariants).length;
|
|
228
|
+
return (
|
|
229
|
+
<div className="border-b border-border last:border-b-0">
|
|
230
|
+
<div
|
|
231
|
+
role="row"
|
|
232
|
+
className="grid grid-cols-[2fr_1fr_1fr_1fr_1fr_auto] items-center gap-2 px-3 py-2 text-xs"
|
|
233
|
+
>
|
|
234
|
+
<span role="cell" className="min-w-0">
|
|
235
|
+
<span className="block truncate font-medium text-foreground" title={baseline.modelId}>
|
|
236
|
+
{baseline.displayName || baseline.modelId}
|
|
237
|
+
</span>
|
|
238
|
+
<span className="block truncate text-[11px] text-muted-foreground">
|
|
239
|
+
{baseline.modelId}
|
|
240
|
+
{baseline.featured ? " · featured" : ""}
|
|
241
|
+
</span>
|
|
242
|
+
</span>
|
|
243
|
+
<span role="cell" className="text-muted-foreground">
|
|
244
|
+
{baseline.harness}
|
|
245
|
+
</span>
|
|
246
|
+
<span role="cell" className="text-right text-foreground">
|
|
247
|
+
{formatRate(baseline.pricing?.inputPriceMicrosPerMillion ?? ZERO)}
|
|
248
|
+
</span>
|
|
249
|
+
<span role="cell" className="text-right text-foreground">
|
|
250
|
+
{formatRate(baseline.pricing?.outputPriceMicrosPerMillion ?? ZERO)}
|
|
251
|
+
</span>
|
|
252
|
+
<span role="cell" className="text-right text-muted-foreground">
|
|
253
|
+
{variantCount > 0 ? variantCount : "—"}
|
|
254
|
+
</span>
|
|
255
|
+
<span role="cell" className="flex shrink-0 justify-end gap-2">
|
|
256
|
+
<Button size="sm" variant="outline" disabled={disabled} onClick={onEdit}>
|
|
257
|
+
Edit
|
|
258
|
+
</Button>
|
|
259
|
+
<Button size="sm" variant="outline" disabled={disabled} onClick={onRetire}>
|
|
260
|
+
Retire
|
|
261
|
+
</Button>
|
|
262
|
+
</span>
|
|
263
|
+
</div>
|
|
264
|
+
{history && history.length > 0 && (
|
|
265
|
+
<div className="space-y-1 px-3 pb-2">
|
|
266
|
+
{history.map((revision) => (
|
|
267
|
+
<p key={revision.baselineId} className="text-[11px] text-muted-foreground">
|
|
268
|
+
{revision.status === ModelPricingBaselineStatus.pricing_baseline_retired
|
|
269
|
+
? "Retired"
|
|
270
|
+
: "Superseded"}
|
|
271
|
+
{" · "}
|
|
272
|
+
{formatRate(revision.pricing?.inputPriceMicrosPerMillion ?? ZERO)} in /{" "}
|
|
273
|
+
{formatRate(revision.pricing?.outputPriceMicrosPerMillion ?? ZERO)} out
|
|
274
|
+
{" · "}
|
|
275
|
+
{revision.decidedBy}
|
|
276
|
+
{revision.revisionNote ? ` — ${revision.revisionNote}` : ""}
|
|
277
|
+
</p>
|
|
278
|
+
))}
|
|
279
|
+
</div>
|
|
280
|
+
)}
|
|
281
|
+
</div>
|
|
282
|
+
);
|
|
283
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
import { ModelPricingBaselineStatus } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
5
|
+
import type { PricingBlock } from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
6
|
+
import { Button } from "../button/index.js";
|
|
7
|
+
import { GovernanceBadge } from "./governance-primitives.js";
|
|
8
|
+
import type { ModelGovernanceRow } from "./useModelGovernanceView.js";
|
|
9
|
+
import {
|
|
10
|
+
RATE_FIELD_LABELS,
|
|
11
|
+
ZERO,
|
|
12
|
+
formatDeltaBp,
|
|
13
|
+
formatRate,
|
|
14
|
+
} from "./pricing-format.js";
|
|
15
|
+
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// ModelGovernanceDetail — the read-only record of one model: catalog
|
|
18
|
+
// metadata, baseline-vs-effective rate card, variants with wire ids,
|
|
19
|
+
// active overrides with provenance, and revision history. Editing is a
|
|
20
|
+
// separate, deliberate step (Edit / Retire actions in the header).
|
|
21
|
+
// Internal to the billing module.
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
interface RateRow {
|
|
25
|
+
readonly label: string;
|
|
26
|
+
readonly baseline: bigint;
|
|
27
|
+
readonly effective: bigint | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The five rate fields of a pricing block, in canonical display order. */
|
|
31
|
+
function blockRates(pricing: PricingBlock | undefined): readonly (readonly [string, bigint])[] {
|
|
32
|
+
return [
|
|
33
|
+
["Input", pricing?.inputPriceMicrosPerMillion ?? ZERO],
|
|
34
|
+
["Output", pricing?.outputPriceMicrosPerMillion ?? ZERO],
|
|
35
|
+
["Cache write", pricing?.cacheWritePriceMicrosPerMillion ?? ZERO],
|
|
36
|
+
["Cache read", pricing?.cacheReadPriceMicrosPerMillion ?? ZERO],
|
|
37
|
+
["Cursor token rate", pricing?.cursorTokenRateMicrosPerMillion ?? ZERO],
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function ModelGovernanceDetail({
|
|
42
|
+
row,
|
|
43
|
+
onEdit,
|
|
44
|
+
onRetire,
|
|
45
|
+
onBack,
|
|
46
|
+
}: {
|
|
47
|
+
readonly row: ModelGovernanceRow;
|
|
48
|
+
readonly onEdit: () => void;
|
|
49
|
+
readonly onRetire: () => void;
|
|
50
|
+
readonly onBack: () => void;
|
|
51
|
+
}) {
|
|
52
|
+
const { baseline, governance } = row;
|
|
53
|
+
const hasOverrides = (governance?.activeOverrides.length ?? 0) > 0;
|
|
54
|
+
|
|
55
|
+
const baseRates: readonly RateRow[] = [
|
|
56
|
+
{
|
|
57
|
+
label: "Input",
|
|
58
|
+
baseline: baseline.pricing?.inputPriceMicrosPerMillion ?? ZERO,
|
|
59
|
+
effective: governance?.effectiveInputMicrosPerMillion ?? null,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "Output",
|
|
63
|
+
baseline: baseline.pricing?.outputPriceMicrosPerMillion ?? ZERO,
|
|
64
|
+
effective: governance?.effectiveOutputMicrosPerMillion ?? null,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: "Cache write",
|
|
68
|
+
baseline: baseline.pricing?.cacheWritePriceMicrosPerMillion ?? ZERO,
|
|
69
|
+
effective: governance?.effectiveCacheWriteMicrosPerMillion ?? null,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "Cache read",
|
|
73
|
+
baseline: baseline.pricing?.cacheReadPriceMicrosPerMillion ?? ZERO,
|
|
74
|
+
effective: governance?.effectiveCacheReadMicrosPerMillion ?? null,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "Cursor token rate",
|
|
78
|
+
baseline: baseline.pricing?.cursorTokenRateMicrosPerMillion ?? ZERO,
|
|
79
|
+
effective: governance?.effectiveCursorTokenRateMicrosPerMillion ?? null,
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div className="space-y-4 rounded-lg border border-border bg-card px-4 py-3">
|
|
85
|
+
{/* ── header: identity + actions ──────────────────────────────────── */}
|
|
86
|
+
<div className="flex items-start justify-between gap-3">
|
|
87
|
+
<div className="min-w-0">
|
|
88
|
+
<h4 className="flex flex-wrap items-center gap-2 text-sm font-semibold text-foreground">
|
|
89
|
+
{baseline.displayName || baseline.modelId}
|
|
90
|
+
{governance && (
|
|
91
|
+
<GovernanceBadge
|
|
92
|
+
ledgerReconcilable={governance.ledgerReconcilable}
|
|
93
|
+
hasOverrides={hasOverrides}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
{baseline.featured && (
|
|
97
|
+
<span className="rounded bg-accent px-1.5 py-0.5 text-[10px] font-medium text-primary">
|
|
98
|
+
Featured
|
|
99
|
+
</span>
|
|
100
|
+
)}
|
|
101
|
+
</h4>
|
|
102
|
+
<p className="mt-0.5 text-[11px] text-muted-foreground">
|
|
103
|
+
{baseline.modelId} · {baseline.provider} · {baseline.harness}
|
|
104
|
+
{baseline.shortDescription ? ` — ${baseline.shortDescription}` : ""}
|
|
105
|
+
</p>
|
|
106
|
+
</div>
|
|
107
|
+
<div className="flex shrink-0 gap-2">
|
|
108
|
+
<Button size="sm" variant="outline" onClick={onBack}>
|
|
109
|
+
Back
|
|
110
|
+
</Button>
|
|
111
|
+
<Button size="sm" onClick={onEdit}>
|
|
112
|
+
Edit
|
|
113
|
+
</Button>
|
|
114
|
+
<Button size="sm" variant="outline" onClick={onRetire}>
|
|
115
|
+
Retire
|
|
116
|
+
</Button>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
{/* ── rate card: baseline vs effective ────────────────────────────── */}
|
|
121
|
+
<section aria-label="Rates">
|
|
122
|
+
<h5 className="mb-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
123
|
+
Rates ($ per million tokens)
|
|
124
|
+
</h5>
|
|
125
|
+
<div className="rounded-md border border-border-muted" role="table" aria-label="Baseline vs effective rates">
|
|
126
|
+
<div
|
|
127
|
+
role="row"
|
|
128
|
+
className="grid grid-cols-[1.5fr_1fr_1fr] gap-2 border-b border-border-muted px-2.5 py-1.5 text-[11px] font-medium text-muted-foreground"
|
|
129
|
+
>
|
|
130
|
+
<span role="columnheader">Rate</span>
|
|
131
|
+
<span role="columnheader" className="text-right">Baseline</span>
|
|
132
|
+
<span role="columnheader" className="text-right">Effective</span>
|
|
133
|
+
</div>
|
|
134
|
+
{baseRates.map((rate) => {
|
|
135
|
+
const overridden = rate.effective !== null && rate.effective !== rate.baseline;
|
|
136
|
+
return (
|
|
137
|
+
<div
|
|
138
|
+
key={rate.label}
|
|
139
|
+
role="row"
|
|
140
|
+
className="grid grid-cols-[1.5fr_1fr_1fr] gap-2 border-b border-border-muted px-2.5 py-1.5 text-xs last:border-b-0"
|
|
141
|
+
>
|
|
142
|
+
<span role="cell" className="text-muted-foreground">{rate.label}</span>
|
|
143
|
+
<span
|
|
144
|
+
role="cell"
|
|
145
|
+
className={cn("text-right text-foreground", overridden && "line-through text-muted-foreground")}
|
|
146
|
+
>
|
|
147
|
+
{formatRate(rate.baseline)}
|
|
148
|
+
</span>
|
|
149
|
+
<span role="cell" className={cn("text-right text-foreground", overridden && "font-medium")}>
|
|
150
|
+
{rate.effective !== null ? formatRate(rate.effective) : "—"}
|
|
151
|
+
</span>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
})}
|
|
155
|
+
</div>
|
|
156
|
+
</section>
|
|
157
|
+
|
|
158
|
+
{/* ── active overrides with provenance ────────────────────────────── */}
|
|
159
|
+
{hasOverrides && governance && (
|
|
160
|
+
<section aria-label="Active pricing overrides">
|
|
161
|
+
<h5 className="mb-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
162
|
+
Active Overrides
|
|
163
|
+
</h5>
|
|
164
|
+
<div className="space-y-1">
|
|
165
|
+
{governance.activeOverrides.map((override) => (
|
|
166
|
+
<p key={override.overrideId} className="text-[11px] text-muted-foreground">
|
|
167
|
+
<span className="font-medium text-foreground">
|
|
168
|
+
{RATE_FIELD_LABELS[override.rateField] ?? "Rate"}
|
|
169
|
+
{override.variant ? ` (${override.variant})` : ""}
|
|
170
|
+
</span>
|
|
171
|
+
{" → "}
|
|
172
|
+
{formatRate(override.rateMicrosPerMillion)}
|
|
173
|
+
{override.provenance && (
|
|
174
|
+
<>
|
|
175
|
+
{" · ledger observed "}
|
|
176
|
+
{formatRate(override.provenance.observedRateMicrosPerMillion)}
|
|
177
|
+
{" ("}
|
|
178
|
+
{formatDeltaBp(override.provenance.deltaBasisPoints)}
|
|
179
|
+
{") over "}
|
|
180
|
+
{override.provenance.windowFrom}..{override.provenance.windowTo}
|
|
181
|
+
</>
|
|
182
|
+
)}
|
|
183
|
+
</p>
|
|
184
|
+
))}
|
|
185
|
+
</div>
|
|
186
|
+
</section>
|
|
187
|
+
)}
|
|
188
|
+
|
|
189
|
+
{/* ── variants ─────────────────────────────────────────────────────── */}
|
|
190
|
+
{Object.keys(baseline.pricingVariants).length > 0 && (
|
|
191
|
+
<section aria-label="Pricing variants">
|
|
192
|
+
<h5 className="mb-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
193
|
+
Variants
|
|
194
|
+
</h5>
|
|
195
|
+
<div className="space-y-2">
|
|
196
|
+
{Object.entries(baseline.pricingVariants).map(([key, variant]) => {
|
|
197
|
+
const variantEntry =
|
|
198
|
+
row.variantGovernance.find((entry) => entry.variant === key) ?? null;
|
|
199
|
+
return (
|
|
200
|
+
<div key={key} className="rounded-md border border-border-muted px-2.5 py-2">
|
|
201
|
+
<p className="text-xs font-medium text-foreground">
|
|
202
|
+
{key}
|
|
203
|
+
{variantEntry && (
|
|
204
|
+
<span className="ml-2 align-middle">
|
|
205
|
+
<GovernanceBadge
|
|
206
|
+
ledgerReconcilable={variantEntry.ledgerReconcilable}
|
|
207
|
+
hasOverrides={variantEntry.activeOverrides.length > 0}
|
|
208
|
+
/>
|
|
209
|
+
</span>
|
|
210
|
+
)}
|
|
211
|
+
</p>
|
|
212
|
+
<p className="mt-0.5 text-[11px] text-muted-foreground">
|
|
213
|
+
{blockRates(variant.pricing)
|
|
214
|
+
.filter(([, micros]) => micros > ZERO)
|
|
215
|
+
.map(([label, micros]) => `${label} ${formatRate(micros)}`)
|
|
216
|
+
.join(" · ") || "No rates set"}
|
|
217
|
+
</p>
|
|
218
|
+
{variant.wireIds.length > 0 && (
|
|
219
|
+
<p className="mt-0.5 text-[11px] text-muted-foreground">
|
|
220
|
+
Wire ids: {variant.wireIds.join(", ")}
|
|
221
|
+
</p>
|
|
222
|
+
)}
|
|
223
|
+
</div>
|
|
224
|
+
);
|
|
225
|
+
})}
|
|
226
|
+
</div>
|
|
227
|
+
</section>
|
|
228
|
+
)}
|
|
229
|
+
|
|
230
|
+
{/* ── catalog metadata ─────────────────────────────────────────────── */}
|
|
231
|
+
<section aria-label="Catalog metadata">
|
|
232
|
+
<h5 className="mb-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
233
|
+
Catalog
|
|
234
|
+
</h5>
|
|
235
|
+
<dl className="grid grid-cols-2 gap-x-4 gap-y-1 text-xs sm:grid-cols-3">
|
|
236
|
+
<MetaItem label="Provider API id" value={baseline.apiModelId || "—"} />
|
|
237
|
+
<MetaItem label="Speed tier" value={baseline.speedTier || "—"} />
|
|
238
|
+
<MetaItem label="Cost tier" value={baseline.costTier || "—"} />
|
|
239
|
+
<MetaItem
|
|
240
|
+
label="Context window"
|
|
241
|
+
value={baseline.contextWindowTokens > 0 ? baseline.contextWindowTokens.toLocaleString() : "—"}
|
|
242
|
+
/>
|
|
243
|
+
<MetaItem
|
|
244
|
+
label="Max output tokens"
|
|
245
|
+
value={baseline.maxOutputTokens > 0 ? baseline.maxOutputTokens.toLocaleString() : "—"}
|
|
246
|
+
/>
|
|
247
|
+
<MetaItem label="Token counter" value={baseline.tokenCounterMethod || "—"} />
|
|
248
|
+
</dl>
|
|
249
|
+
</section>
|
|
250
|
+
|
|
251
|
+
{/* ── revision history ─────────────────────────────────────────────── */}
|
|
252
|
+
<section aria-label="Revision history">
|
|
253
|
+
<h5 className="mb-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground">
|
|
254
|
+
Revision History
|
|
255
|
+
</h5>
|
|
256
|
+
{row.history.length === 0 ? (
|
|
257
|
+
<p className="text-[11px] text-muted-foreground">
|
|
258
|
+
No previous revisions — this is the original entry.
|
|
259
|
+
</p>
|
|
260
|
+
) : (
|
|
261
|
+
<div className="space-y-1">
|
|
262
|
+
{row.history.map((revision) => (
|
|
263
|
+
<p key={revision.baselineId} className="text-[11px] text-muted-foreground">
|
|
264
|
+
{revision.status === ModelPricingBaselineStatus.pricing_baseline_retired
|
|
265
|
+
? "Retired"
|
|
266
|
+
: "Superseded"}
|
|
267
|
+
{" · "}
|
|
268
|
+
{formatRate(revision.pricing?.inputPriceMicrosPerMillion ?? ZERO)} in /{" "}
|
|
269
|
+
{formatRate(revision.pricing?.outputPriceMicrosPerMillion ?? ZERO)} out
|
|
270
|
+
{" · "}
|
|
271
|
+
{revision.decidedBy}
|
|
272
|
+
{revision.revisionNote ? ` — ${revision.revisionNote}` : ""}
|
|
273
|
+
</p>
|
|
274
|
+
))}
|
|
275
|
+
</div>
|
|
276
|
+
)}
|
|
277
|
+
</section>
|
|
278
|
+
</div>
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function MetaItem({ label, value }: { readonly label: string; readonly value: string }) {
|
|
283
|
+
return (
|
|
284
|
+
<div>
|
|
285
|
+
<dt className="text-[11px] text-muted-foreground">{label}</dt>
|
|
286
|
+
<dd className="text-foreground">{value}</dd>
|
|
287
|
+
</div>
|
|
288
|
+
);
|
|
289
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The access-denied state for platform-operator pricing surfaces
|
|
7
|
+
* (governance + catalog panels). Server-side authorization
|
|
8
|
+
* (`can_manage_model_pricing` on `platform:stigmer`) is the real gate —
|
|
9
|
+
* this is the honest, designed face of that denial for anyone who
|
|
10
|
+
* navigates to an operator route without the permission, instead of a
|
|
11
|
+
* raw RPC error string.
|
|
12
|
+
*/
|
|
13
|
+
export function OperatorAccessNotice({ className }: { readonly className?: string }) {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
className={cn(
|
|
17
|
+
"rounded-lg border border-border bg-card px-4 py-6 text-center",
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
role="status"
|
|
21
|
+
>
|
|
22
|
+
<p className="text-xs font-semibold text-foreground">
|
|
23
|
+
Platform operator access required
|
|
24
|
+
</p>
|
|
25
|
+
<p className="mx-auto mt-1 max-w-md text-xs text-muted-foreground">
|
|
26
|
+
Model pricing governance is a Stigmer-internal surface. It needs the
|
|
27
|
+
platform operator role — organization roles do not grant it. If you
|
|
28
|
+
believe you should have access, contact a platform operator.
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|