@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,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type { ModelPricingOverride } from "@stigmer/protos/ai/stigmer/billing/v1/pricing_override_pb";
|
|
5
|
+
import { useStigmer } from "../hooks.js";
|
|
6
|
+
import { toError } from "../internal/toError.js";
|
|
7
|
+
|
|
8
|
+
/** Input for {@link useDecidePricingOverride}. */
|
|
9
|
+
export interface DecidePricingOverrideInput {
|
|
10
|
+
/** The PENDING_SIGNOFF override to decide. */
|
|
11
|
+
readonly overrideId: string;
|
|
12
|
+
/**
|
|
13
|
+
* `true` approves (the override becomes ACTIVE and supersedes any
|
|
14
|
+
* current ACTIVE override on the same pricing key); `false` rejects.
|
|
15
|
+
*/
|
|
16
|
+
readonly approve: boolean;
|
|
17
|
+
/** Optional note recorded on the decision for the audit trail. */
|
|
18
|
+
readonly decisionNote?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Return value of {@link useDecidePricingOverride}. */
|
|
22
|
+
export interface UseDecidePricingOverrideReturn {
|
|
23
|
+
/**
|
|
24
|
+
* Decide a pending pricing override. Returns the decided override with
|
|
25
|
+
* the operator's identity stamped.
|
|
26
|
+
*/
|
|
27
|
+
readonly decide: (input: DecidePricingOverrideInput) => Promise<ModelPricingOverride>;
|
|
28
|
+
/** `true` while a decision is being recorded. */
|
|
29
|
+
readonly isSubmitting: boolean;
|
|
30
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
31
|
+
readonly error: Error | null;
|
|
32
|
+
/** Reset `error` to `null`. */
|
|
33
|
+
readonly clearError: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Behavior hook for deciding PENDING_SIGNOFF pricing overrides from the
|
|
38
|
+
* pricing feedback loop.
|
|
39
|
+
*
|
|
40
|
+
* Wraps `billing.decideModelPricingOverride` with loading and error
|
|
41
|
+
* state. On approval the platform recomposes the effective registry
|
|
42
|
+
* immediately, so the parent should refetch its governance view after a
|
|
43
|
+
* successful decision.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* const { decide, isSubmitting } = useDecidePricingOverride();
|
|
48
|
+
*
|
|
49
|
+
* await decide({ overrideId, approve: true, decisionNote: "Verified vs ledger" });
|
|
50
|
+
* refetchGovernance();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export function useDecidePricingOverride(): UseDecidePricingOverrideReturn {
|
|
54
|
+
const stigmer = useStigmer();
|
|
55
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
56
|
+
const [error, setError] = useState<Error | null>(null);
|
|
57
|
+
|
|
58
|
+
const decide = useCallback(
|
|
59
|
+
async (input: DecidePricingOverrideInput): Promise<ModelPricingOverride> => {
|
|
60
|
+
setIsSubmitting(true);
|
|
61
|
+
setError(null);
|
|
62
|
+
try {
|
|
63
|
+
return await stigmer.billing.decideModelPricingOverride(input);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
const err = toError(e);
|
|
66
|
+
setError(err);
|
|
67
|
+
throw err;
|
|
68
|
+
} finally {
|
|
69
|
+
setIsSubmitting(false);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
[stigmer.billing],
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const clearError = useCallback(() => setError(null), []);
|
|
76
|
+
|
|
77
|
+
return { decide, isSubmitting, error, clearError };
|
|
78
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useMemo, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
ModelPricingBaselineStatus,
|
|
6
|
+
type ModelPricingBaseline,
|
|
7
|
+
} from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
8
|
+
import type { ModelPricingGovernanceEntry } from "@stigmer/protos/ai/stigmer/billing/v1/io_pb";
|
|
9
|
+
import type { ModelPricingOverride } from "@stigmer/protos/ai/stigmer/billing/v1/pricing_override_pb";
|
|
10
|
+
import { useModelPricingBaselines } from "./useModelPricingBaselines.js";
|
|
11
|
+
import { usePricingGovernance } from "./usePricingGovernance.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* One model in the unified governance view: the ACTIVE catalog baseline
|
|
15
|
+
* joined with its effective-registry governance state and its
|
|
16
|
+
* append-only revision history.
|
|
17
|
+
*/
|
|
18
|
+
export interface ModelGovernanceRow {
|
|
19
|
+
/** Stable identity: `modelId|provider|harness` (the catalog key). */
|
|
20
|
+
readonly key: string;
|
|
21
|
+
/** The ACTIVE baseline revision (catalog fields + list rates). */
|
|
22
|
+
readonly baseline: ModelPricingBaseline;
|
|
23
|
+
/**
|
|
24
|
+
* The base-variant governance entry (baseline vs effective rates,
|
|
25
|
+
* active overrides, ledger reconcilability), or `null` when the
|
|
26
|
+
* governance view has no entry for this key — the row then renders
|
|
27
|
+
* baseline rates with no governance state.
|
|
28
|
+
*/
|
|
29
|
+
readonly governance: ModelPricingGovernanceEntry | null;
|
|
30
|
+
/** Governance entries for this model's named pricing variants. */
|
|
31
|
+
readonly variantGovernance: readonly ModelPricingGovernanceEntry[];
|
|
32
|
+
/** SUPERSEDED / RETIRED revisions, newest first as served. */
|
|
33
|
+
readonly history: readonly ModelPricingBaseline[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Where the operator is in the console: browsing the model list,
|
|
38
|
+
* creating a new catalog entry, or focused on one model (viewing,
|
|
39
|
+
* editing, or retiring it).
|
|
40
|
+
*/
|
|
41
|
+
export type GovernanceFlow =
|
|
42
|
+
| { readonly phase: "list" }
|
|
43
|
+
| { readonly phase: "create" }
|
|
44
|
+
| {
|
|
45
|
+
readonly phase: "detail";
|
|
46
|
+
readonly modelKey: string;
|
|
47
|
+
readonly mode: "view" | "edit" | "retire";
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** Return value of {@link useModelGovernanceView}. */
|
|
51
|
+
export interface UseModelGovernanceViewReturn {
|
|
52
|
+
/** Unified model rows, filtered by {@link modelQuery}, sorted by display name. */
|
|
53
|
+
readonly models: readonly ModelGovernanceRow[];
|
|
54
|
+
/** PENDING_SIGNOFF overrides, filtered by {@link signOffQuery}, oldest first as served. */
|
|
55
|
+
readonly pendingOverrides: readonly ModelPricingOverride[];
|
|
56
|
+
/** Unfiltered pending-override count (for the Sign-Offs tab badge). */
|
|
57
|
+
readonly pendingCount: number;
|
|
58
|
+
/** Current search text over the model list. */
|
|
59
|
+
readonly modelQuery: string;
|
|
60
|
+
/** Set the model-list search text. */
|
|
61
|
+
readonly setModelQuery: (query: string) => void;
|
|
62
|
+
/** Current search text over the sign-off queue. */
|
|
63
|
+
readonly signOffQuery: string;
|
|
64
|
+
/** Set the sign-off search text. */
|
|
65
|
+
readonly setSignOffQuery: (query: string) => void;
|
|
66
|
+
/** Current console flow state. */
|
|
67
|
+
readonly flow: GovernanceFlow;
|
|
68
|
+
/** The focused model when {@link flow} is in the detail phase, else `null`. */
|
|
69
|
+
readonly selected: ModelGovernanceRow | null;
|
|
70
|
+
/** Focus one model (read-only detail). */
|
|
71
|
+
readonly openDetail: (modelKey: string) => void;
|
|
72
|
+
/** Open the add-model editor. */
|
|
73
|
+
readonly openCreate: () => void;
|
|
74
|
+
/** Switch the focused model into the edit form. */
|
|
75
|
+
readonly openEdit: () => void;
|
|
76
|
+
/** Switch the focused model into the retire confirmation. */
|
|
77
|
+
readonly openRetire: () => void;
|
|
78
|
+
/** Leave edit/retire back to the read-only detail. */
|
|
79
|
+
readonly backToDetail: () => void;
|
|
80
|
+
/** Return to the model list. */
|
|
81
|
+
readonly backToList: () => void;
|
|
82
|
+
/** `true` while either underlying fetch is in its initial load. */
|
|
83
|
+
readonly isLoading: boolean;
|
|
84
|
+
/** First error from the underlying fetches, or `null` when healthy. */
|
|
85
|
+
readonly error: Error | null;
|
|
86
|
+
/** Re-fetch both the catalog and the governance view. */
|
|
87
|
+
readonly refetch: () => void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** The catalog identity key shared by both data sources. */
|
|
91
|
+
function modelKey(entry: {
|
|
92
|
+
readonly modelId: string;
|
|
93
|
+
readonly provider: string;
|
|
94
|
+
readonly harness: string;
|
|
95
|
+
}): string {
|
|
96
|
+
return `${entry.modelId}|${entry.provider}|${entry.harness}`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function matchesQuery(query: string, ...fields: readonly string[]): boolean {
|
|
100
|
+
const q = query.trim().toLowerCase();
|
|
101
|
+
if (q === "") return true;
|
|
102
|
+
return fields.some((field) => field.toLowerCase().includes(q));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Behavior hook backing the pricing-governance console: joins the model
|
|
107
|
+
* registry baseline catalog ({@link useModelPricingBaselines}, with
|
|
108
|
+
* history) and the governance view ({@link usePricingGovernance}) into
|
|
109
|
+
* one row per catalog key, and owns the console's search and
|
|
110
|
+
* list/create/detail flow state.
|
|
111
|
+
*
|
|
112
|
+
* The two RPCs describe the same models from different angles — the
|
|
113
|
+
* catalog is what operators author, governance is what the pricing
|
|
114
|
+
* feedback loop composed on top — so the console renders them as one
|
|
115
|
+
* surface instead of two parallel tables. Per-variant governance
|
|
116
|
+
* entries fold into their model's row rather than appearing as
|
|
117
|
+
* top-level rows.
|
|
118
|
+
*
|
|
119
|
+
* Platform-operator surface: the caller needs `can_manage_model_pricing`
|
|
120
|
+
* on `platform:stigmer`; rates are raw provider prices (pre-markup).
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```tsx
|
|
124
|
+
* const view = useModelGovernanceView();
|
|
125
|
+
* return view.models.map((row) => <ModelRow key={row.key} row={row} />);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export function useModelGovernanceView(): UseModelGovernanceViewReturn {
|
|
129
|
+
// History is always fetched so opening a detail view never triggers a
|
|
130
|
+
// second round-trip; the catalog is small (dozens of models) and this
|
|
131
|
+
// is an operator-only surface.
|
|
132
|
+
const baselinesFetch = useModelPricingBaselines({ includeHistory: true });
|
|
133
|
+
const governanceFetch = usePricingGovernance();
|
|
134
|
+
|
|
135
|
+
const [modelQuery, setModelQuery] = useState("");
|
|
136
|
+
const [signOffQuery, setSignOffQuery] = useState("");
|
|
137
|
+
const [flow, setFlow] = useState<GovernanceFlow>({ phase: "list" });
|
|
138
|
+
|
|
139
|
+
const rows = useMemo<readonly ModelGovernanceRow[]>(() => {
|
|
140
|
+
const baselines = baselinesFetch.baselines ?? [];
|
|
141
|
+
const entries = governanceFetch.governance?.entries ?? [];
|
|
142
|
+
|
|
143
|
+
const baseByKey = new Map<string, ModelPricingGovernanceEntry>();
|
|
144
|
+
const variantsByKey = new Map<string, ModelPricingGovernanceEntry[]>();
|
|
145
|
+
for (const entry of entries) {
|
|
146
|
+
const key = modelKey(entry);
|
|
147
|
+
if (entry.variant === "") {
|
|
148
|
+
baseByKey.set(key, entry);
|
|
149
|
+
} else {
|
|
150
|
+
variantsByKey.set(key, [...(variantsByKey.get(key) ?? []), entry]);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const historyByKey = new Map<string, ModelPricingBaseline[]>();
|
|
155
|
+
for (const baseline of baselines) {
|
|
156
|
+
if (baseline.status === ModelPricingBaselineStatus.pricing_baseline_active) continue;
|
|
157
|
+
const key = modelKey(baseline);
|
|
158
|
+
historyByKey.set(key, [...(historyByKey.get(key) ?? []), baseline]);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return baselines
|
|
162
|
+
.filter((b) => b.status === ModelPricingBaselineStatus.pricing_baseline_active)
|
|
163
|
+
.map((baseline) => {
|
|
164
|
+
const key = modelKey(baseline);
|
|
165
|
+
return {
|
|
166
|
+
key,
|
|
167
|
+
baseline,
|
|
168
|
+
governance: baseByKey.get(key) ?? null,
|
|
169
|
+
variantGovernance: variantsByKey.get(key) ?? [],
|
|
170
|
+
history: historyByKey.get(key) ?? [],
|
|
171
|
+
};
|
|
172
|
+
})
|
|
173
|
+
.sort((a, b) =>
|
|
174
|
+
(a.baseline.displayName || a.baseline.modelId).localeCompare(
|
|
175
|
+
b.baseline.displayName || b.baseline.modelId,
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
}, [baselinesFetch.baselines, governanceFetch.governance]);
|
|
179
|
+
|
|
180
|
+
const models = useMemo(
|
|
181
|
+
() =>
|
|
182
|
+
rows.filter((row) =>
|
|
183
|
+
matchesQuery(
|
|
184
|
+
modelQuery,
|
|
185
|
+
row.baseline.modelId,
|
|
186
|
+
row.baseline.displayName,
|
|
187
|
+
row.baseline.provider,
|
|
188
|
+
row.baseline.harness,
|
|
189
|
+
),
|
|
190
|
+
),
|
|
191
|
+
[rows, modelQuery],
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
const allPending = useMemo(
|
|
195
|
+
() => governanceFetch.governance?.pendingOverrides ?? [],
|
|
196
|
+
[governanceFetch.governance],
|
|
197
|
+
);
|
|
198
|
+
const pendingOverrides = useMemo(
|
|
199
|
+
() =>
|
|
200
|
+
allPending.filter((override) =>
|
|
201
|
+
matchesQuery(signOffQuery, override.modelId, override.variant),
|
|
202
|
+
),
|
|
203
|
+
[allPending, signOffQuery],
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
// Resolve the focused row fresh each render so a refetch (e.g. after an
|
|
207
|
+
// edit) is reflected in the open detail; a retired model resolves to
|
|
208
|
+
// null and the console falls back to the list.
|
|
209
|
+
const selected = useMemo(() => {
|
|
210
|
+
if (flow.phase !== "detail") return null;
|
|
211
|
+
return rows.find((row) => row.key === flow.modelKey) ?? null;
|
|
212
|
+
}, [flow, rows]);
|
|
213
|
+
|
|
214
|
+
const openDetail = useCallback(
|
|
215
|
+
(key: string) => setFlow({ phase: "detail", modelKey: key, mode: "view" }),
|
|
216
|
+
[],
|
|
217
|
+
);
|
|
218
|
+
const openCreate = useCallback(() => setFlow({ phase: "create" }), []);
|
|
219
|
+
const openEdit = useCallback(
|
|
220
|
+
() =>
|
|
221
|
+
setFlow((f) =>
|
|
222
|
+
f.phase === "detail" ? { ...f, mode: "edit" } : f,
|
|
223
|
+
),
|
|
224
|
+
[],
|
|
225
|
+
);
|
|
226
|
+
const openRetire = useCallback(
|
|
227
|
+
() =>
|
|
228
|
+
setFlow((f) =>
|
|
229
|
+
f.phase === "detail" ? { ...f, mode: "retire" } : f,
|
|
230
|
+
),
|
|
231
|
+
[],
|
|
232
|
+
);
|
|
233
|
+
const backToDetail = useCallback(
|
|
234
|
+
() =>
|
|
235
|
+
setFlow((f) =>
|
|
236
|
+
f.phase === "detail" ? { ...f, mode: "view" } : f,
|
|
237
|
+
),
|
|
238
|
+
[],
|
|
239
|
+
);
|
|
240
|
+
const backToList = useCallback(() => setFlow({ phase: "list" }), []);
|
|
241
|
+
|
|
242
|
+
const refetch = useCallback(() => {
|
|
243
|
+
baselinesFetch.refetch();
|
|
244
|
+
governanceFetch.refetch();
|
|
245
|
+
}, [baselinesFetch.refetch, governanceFetch.refetch]);
|
|
246
|
+
|
|
247
|
+
const isLoading = baselinesFetch.isLoading || governanceFetch.isLoading;
|
|
248
|
+
const error = baselinesFetch.error ?? governanceFetch.error;
|
|
249
|
+
|
|
250
|
+
return useMemo(
|
|
251
|
+
() => ({
|
|
252
|
+
models,
|
|
253
|
+
pendingOverrides,
|
|
254
|
+
pendingCount: allPending.length,
|
|
255
|
+
modelQuery,
|
|
256
|
+
setModelQuery,
|
|
257
|
+
signOffQuery,
|
|
258
|
+
setSignOffQuery,
|
|
259
|
+
flow,
|
|
260
|
+
selected,
|
|
261
|
+
openDetail,
|
|
262
|
+
openCreate,
|
|
263
|
+
openEdit,
|
|
264
|
+
openRetire,
|
|
265
|
+
backToDetail,
|
|
266
|
+
backToList,
|
|
267
|
+
isLoading,
|
|
268
|
+
error,
|
|
269
|
+
refetch,
|
|
270
|
+
}),
|
|
271
|
+
[
|
|
272
|
+
models,
|
|
273
|
+
pendingOverrides,
|
|
274
|
+
allPending.length,
|
|
275
|
+
modelQuery,
|
|
276
|
+
signOffQuery,
|
|
277
|
+
flow,
|
|
278
|
+
selected,
|
|
279
|
+
openDetail,
|
|
280
|
+
openCreate,
|
|
281
|
+
openEdit,
|
|
282
|
+
openRetire,
|
|
283
|
+
backToDetail,
|
|
284
|
+
backToList,
|
|
285
|
+
isLoading,
|
|
286
|
+
error,
|
|
287
|
+
refetch,
|
|
288
|
+
],
|
|
289
|
+
);
|
|
290
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ModelPricingBaseline,
|
|
5
|
+
} from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
6
|
+
import { useStigmer } from "../hooks.js";
|
|
7
|
+
import { useFetch } from "../internal/useFetch.js";
|
|
8
|
+
|
|
9
|
+
/** Options for {@link useModelPricingBaselines}. */
|
|
10
|
+
export interface UseModelPricingBaselinesOptions {
|
|
11
|
+
/**
|
|
12
|
+
* When `true`, includes SUPERSEDED and RETIRED revisions (the full
|
|
13
|
+
* append-only audit history). Default: ACTIVE entries only.
|
|
14
|
+
*/
|
|
15
|
+
readonly includeHistory?: boolean;
|
|
16
|
+
/** Pass `false` to skip fetching (stable no-op). */
|
|
17
|
+
readonly enabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Return value of {@link useModelPricingBaselines}. */
|
|
21
|
+
export interface UseModelPricingBaselinesReturn {
|
|
22
|
+
/** The catalog entries, or `null` before the first successful fetch. */
|
|
23
|
+
readonly baselines: readonly ModelPricingBaseline[] | null;
|
|
24
|
+
/** `true` while the initial fetch is in flight. */
|
|
25
|
+
readonly isLoading: boolean;
|
|
26
|
+
/** `true` while a background refetch is in flight and stale data is shown. */
|
|
27
|
+
readonly isRefetching: boolean;
|
|
28
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
29
|
+
readonly error: Error | null;
|
|
30
|
+
/** Discard cached data and re-fetch from the server. */
|
|
31
|
+
readonly refetch: () => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Data hook that fetches the model registry baseline catalog: the
|
|
36
|
+
* operator-governed catalog entries and list prices that (composed with
|
|
37
|
+
* any ledger-derived overrides) form the effective registry.
|
|
38
|
+
*
|
|
39
|
+
* Platform-operator surface: the caller needs `can_manage_model_pricing`
|
|
40
|
+
* on `platform:stigmer`, and the rates are raw provider prices
|
|
41
|
+
* (pre-markup) — never render them as customer prices.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* const { baselines, isLoading, refetch } = useModelPricingBaselines();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export function useModelPricingBaselines(
|
|
49
|
+
options?: UseModelPricingBaselinesOptions,
|
|
50
|
+
): UseModelPricingBaselinesReturn {
|
|
51
|
+
const stigmer = useStigmer();
|
|
52
|
+
const enabled = options?.enabled ?? true;
|
|
53
|
+
const includeHistory = options?.includeHistory ?? false;
|
|
54
|
+
|
|
55
|
+
const { data, isLoading, isRefetching, error, refetch } = useFetch(
|
|
56
|
+
enabled
|
|
57
|
+
? async () => {
|
|
58
|
+
const response = await stigmer.billing.listModelPricingBaselines({
|
|
59
|
+
includeHistory,
|
|
60
|
+
});
|
|
61
|
+
return response.baselines;
|
|
62
|
+
}
|
|
63
|
+
: null,
|
|
64
|
+
[enabled, includeHistory, stigmer],
|
|
65
|
+
null as readonly ModelPricingBaseline[] | null,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return { baselines: data, isLoading, isRefetching, error, refetch };
|
|
69
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ModelPricingGovernanceResponse,
|
|
5
|
+
} from "@stigmer/protos/ai/stigmer/billing/v1/io_pb";
|
|
6
|
+
import { useStigmer } from "../hooks.js";
|
|
7
|
+
import { useFetch } from "../internal/useFetch.js";
|
|
8
|
+
|
|
9
|
+
/** Return value of {@link usePricingGovernance}. */
|
|
10
|
+
export interface UsePricingGovernanceReturn {
|
|
11
|
+
/** The governance view, or `null` before the first successful fetch. */
|
|
12
|
+
readonly governance: ModelPricingGovernanceResponse | null;
|
|
13
|
+
/** `true` while the initial fetch is in flight. */
|
|
14
|
+
readonly isLoading: boolean;
|
|
15
|
+
/** `true` while a background refetch is in flight and stale data is shown. */
|
|
16
|
+
readonly isRefetching: boolean;
|
|
17
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
18
|
+
readonly error: Error | null;
|
|
19
|
+
/** Discard cached data and re-fetch from the server. */
|
|
20
|
+
readonly refetch: () => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Data hook that fetches the platform pricing governance view: every
|
|
25
|
+
* model's baseline vs effective rates, the ACTIVE pricing overrides
|
|
26
|
+
* composed into them (with full ledger provenance), and the
|
|
27
|
+
* PENDING_SIGNOFF proposals awaiting an operator decision.
|
|
28
|
+
*
|
|
29
|
+
* Platform-operator surface: the caller needs `can_manage_model_pricing`
|
|
30
|
+
* on `platform:stigmer`, and the rates are raw provider prices
|
|
31
|
+
* (pre-markup) — never render them as customer prices.
|
|
32
|
+
*
|
|
33
|
+
* Pass `enabled: false` to skip fetching (stable no-op) — e.g. while the
|
|
34
|
+
* caller's operator capability is still resolving.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const { governance, isLoading, refetch } = usePricingGovernance();
|
|
39
|
+
*
|
|
40
|
+
* if (isLoading) return <Skeleton />;
|
|
41
|
+
* return <PricingGovernancePanel />;
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function usePricingGovernance(
|
|
45
|
+
options?: { readonly enabled?: boolean },
|
|
46
|
+
): UsePricingGovernanceReturn {
|
|
47
|
+
const stigmer = useStigmer();
|
|
48
|
+
const enabled = options?.enabled ?? true;
|
|
49
|
+
|
|
50
|
+
const { data: governance, isLoading, isRefetching, error, refetch } = useFetch(
|
|
51
|
+
enabled ? () => stigmer.billing.getModelPricingGovernance() : null,
|
|
52
|
+
[enabled, stigmer],
|
|
53
|
+
null as ModelPricingGovernanceResponse | null,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return { governance, isLoading, isRefetching, error, refetch };
|
|
57
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type {
|
|
5
|
+
ModelPricingBaseline,
|
|
6
|
+
} from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
7
|
+
import { useStigmer } from "../hooks.js";
|
|
8
|
+
import { toError } from "../internal/toError.js";
|
|
9
|
+
|
|
10
|
+
/** Input for {@link useRetireModelPricingBaseline}. */
|
|
11
|
+
export interface RetireModelPricingBaselineInput {
|
|
12
|
+
readonly modelId: string;
|
|
13
|
+
readonly provider: string;
|
|
14
|
+
readonly harness: string;
|
|
15
|
+
/** Optional operator note recorded on the retirement. */
|
|
16
|
+
readonly revisionNote?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Return value of {@link useRetireModelPricingBaseline}. */
|
|
20
|
+
export interface UseRetireModelPricingBaselineReturn {
|
|
21
|
+
/** Retire a model from the catalog. Returns the RETIRED document. */
|
|
22
|
+
readonly retire: (input: RetireModelPricingBaselineInput) => Promise<ModelPricingBaseline>;
|
|
23
|
+
/** `true` while a retirement is being recorded. */
|
|
24
|
+
readonly isSubmitting: boolean;
|
|
25
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
26
|
+
readonly error: Error | null;
|
|
27
|
+
/** Reset `error` to `null`. */
|
|
28
|
+
readonly clearError: () => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Behavior hook for retiring models from the registry catalog.
|
|
33
|
+
*
|
|
34
|
+
* Wraps `billing.retireModelPricingBaseline` with loading and error
|
|
35
|
+
* state. Retirement removes the model from every price surface on the
|
|
36
|
+
* next composition pass; the document is kept for audit and the key can
|
|
37
|
+
* be revived by a subsequent upsert. The parent should refetch its
|
|
38
|
+
* catalog view after a successful retirement.
|
|
39
|
+
*/
|
|
40
|
+
export function useRetireModelPricingBaseline(): UseRetireModelPricingBaselineReturn {
|
|
41
|
+
const stigmer = useStigmer();
|
|
42
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
43
|
+
const [error, setError] = useState<Error | null>(null);
|
|
44
|
+
|
|
45
|
+
const retire = useCallback(
|
|
46
|
+
async (input: RetireModelPricingBaselineInput): Promise<ModelPricingBaseline> => {
|
|
47
|
+
setIsSubmitting(true);
|
|
48
|
+
setError(null);
|
|
49
|
+
try {
|
|
50
|
+
return await stigmer.billing.retireModelPricingBaseline(input);
|
|
51
|
+
} catch (e) {
|
|
52
|
+
const err = toError(e);
|
|
53
|
+
setError(err);
|
|
54
|
+
throw err;
|
|
55
|
+
} finally {
|
|
56
|
+
setIsSubmitting(false);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
[stigmer.billing],
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const clearError = useCallback(() => setError(null), []);
|
|
63
|
+
|
|
64
|
+
return { retire, isSubmitting, error, clearError };
|
|
65
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import type {
|
|
5
|
+
ModelPricingBaseline,
|
|
6
|
+
} from "@stigmer/protos/ai/stigmer/billing/v1/model_pricing_baseline_pb";
|
|
7
|
+
import { useStigmer } from "../hooks.js";
|
|
8
|
+
import { toError } from "../internal/toError.js";
|
|
9
|
+
|
|
10
|
+
/** Input for {@link useUpsertModelPricingBaseline}. */
|
|
11
|
+
export interface UpsertModelPricingBaselineInput {
|
|
12
|
+
/**
|
|
13
|
+
* The baseline entry to create or revise, keyed by
|
|
14
|
+
* (modelId, provider, harness). Lifecycle fields (baselineId, status,
|
|
15
|
+
* decision stamps, pricing effectiveAt) are server-owned and ignored.
|
|
16
|
+
*/
|
|
17
|
+
readonly baseline: ModelPricingBaseline;
|
|
18
|
+
/** Optional operator note recorded on the revision for the audit trail. */
|
|
19
|
+
readonly revisionNote?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Return value of {@link useUpsertModelPricingBaseline}. */
|
|
23
|
+
export interface UseUpsertModelPricingBaselineReturn {
|
|
24
|
+
/**
|
|
25
|
+
* Create or revise a baseline entry. Returns the new revision with
|
|
26
|
+
* server-stamped lifecycle fields.
|
|
27
|
+
*/
|
|
28
|
+
readonly upsert: (input: UpsertModelPricingBaselineInput) => Promise<ModelPricingBaseline>;
|
|
29
|
+
/** `true` while a revision is being written. */
|
|
30
|
+
readonly isSubmitting: boolean;
|
|
31
|
+
/** Error from the last failed attempt, or `null` when healthy. */
|
|
32
|
+
readonly error: Error | null;
|
|
33
|
+
/** Reset `error` to `null`. */
|
|
34
|
+
readonly clearError: () => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Behavior hook for creating or revising model registry baseline entries.
|
|
39
|
+
*
|
|
40
|
+
* Wraps `billing.upsertModelPricingBaseline` with loading and error
|
|
41
|
+
* state. The platform recomposes the effective registry immediately, so
|
|
42
|
+
* the parent should refetch its catalog view after a successful upsert.
|
|
43
|
+
*
|
|
44
|
+
* A concurrent-edit conflict surfaces as an ABORTED error telling the
|
|
45
|
+
* operator to reload and re-apply — render it, don't retry silently.
|
|
46
|
+
*/
|
|
47
|
+
export function useUpsertModelPricingBaseline(): UseUpsertModelPricingBaselineReturn {
|
|
48
|
+
const stigmer = useStigmer();
|
|
49
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
50
|
+
const [error, setError] = useState<Error | null>(null);
|
|
51
|
+
|
|
52
|
+
const upsert = useCallback(
|
|
53
|
+
async (input: UpsertModelPricingBaselineInput): Promise<ModelPricingBaseline> => {
|
|
54
|
+
setIsSubmitting(true);
|
|
55
|
+
setError(null);
|
|
56
|
+
try {
|
|
57
|
+
return await stigmer.billing.upsertModelPricingBaseline(input);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
const err = toError(e);
|
|
60
|
+
setError(err);
|
|
61
|
+
throw err;
|
|
62
|
+
} finally {
|
|
63
|
+
setIsSubmitting(false);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
[stigmer.billing],
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const clearError = useCallback(() => setError(null), []);
|
|
70
|
+
|
|
71
|
+
return { upsert, isSubmitting, error, clearError };
|
|
72
|
+
}
|