@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,359 @@
|
|
|
1
|
+
// Tests for the client-side projection of the DD-004 canonical value
|
|
2
|
+
// contract. The cases mirror the authoritative Go schema tests
|
|
3
|
+
// (pkg/domain/datastore/schema) so a drift between projection and
|
|
4
|
+
// enforcement shows up here first.
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import { create } from "@bufbuild/protobuf";
|
|
8
|
+
import {
|
|
9
|
+
FieldDeclarationSchema,
|
|
10
|
+
FieldType,
|
|
11
|
+
} from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
12
|
+
import { RecordConditionOp } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/record_io_pb";
|
|
13
|
+
import {
|
|
14
|
+
buildUpdateFields,
|
|
15
|
+
coerceFieldValue,
|
|
16
|
+
formatFieldValue,
|
|
17
|
+
formatSystemTimestamp,
|
|
18
|
+
isListOperator,
|
|
19
|
+
isSortableField,
|
|
20
|
+
isValuelessOperator,
|
|
21
|
+
operatorsForField,
|
|
22
|
+
RESERVED_FIELD_NAMES,
|
|
23
|
+
SYSTEM_FIELD_OPERATORS,
|
|
24
|
+
} from "../recordValues.js";
|
|
25
|
+
|
|
26
|
+
function field(overrides: {
|
|
27
|
+
name?: string;
|
|
28
|
+
type: FieldType;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
enumValues?: string[];
|
|
31
|
+
}) {
|
|
32
|
+
return create(FieldDeclarationSchema, {
|
|
33
|
+
name: overrides.name ?? "f",
|
|
34
|
+
type: overrides.type,
|
|
35
|
+
required: overrides.required ?? false,
|
|
36
|
+
enumValues: overrides.enumValues ?? [],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
describe("coerceFieldValue", () => {
|
|
41
|
+
it("passes explicit null through for every type (tri-state clear)", () => {
|
|
42
|
+
for (const type of [
|
|
43
|
+
FieldType.string,
|
|
44
|
+
FieldType.integer,
|
|
45
|
+
FieldType.number,
|
|
46
|
+
FieldType.bool,
|
|
47
|
+
FieldType.timestamp,
|
|
48
|
+
FieldType.date,
|
|
49
|
+
FieldType.time,
|
|
50
|
+
FieldType.json,
|
|
51
|
+
]) {
|
|
52
|
+
expect(coerceFieldValue(field({ type }), null)).toEqual({ ok: true, value: null });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe("string", () => {
|
|
57
|
+
it("accepts a plain string", () => {
|
|
58
|
+
expect(coerceFieldValue(field({ type: FieldType.string }), "hello")).toEqual({
|
|
59
|
+
ok: true,
|
|
60
|
+
value: "hello",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("rejects non-strings", () => {
|
|
65
|
+
const r = coerceFieldValue(field({ name: "note", type: FieldType.string }), 5);
|
|
66
|
+
expect(r).toEqual({ ok: false, error: 'field "note" must be a string' });
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("enforces enum_values membership", () => {
|
|
70
|
+
const f = field({
|
|
71
|
+
name: "status",
|
|
72
|
+
type: FieldType.string,
|
|
73
|
+
enumValues: ["confirmed", "cancelled"],
|
|
74
|
+
});
|
|
75
|
+
expect(coerceFieldValue(f, "confirmed")).toEqual({ ok: true, value: "confirmed" });
|
|
76
|
+
expect(coerceFieldValue(f, "pending")).toEqual({
|
|
77
|
+
ok: false,
|
|
78
|
+
error: 'field "status" must be one of [confirmed cancelled]',
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe("integer", () => {
|
|
84
|
+
it("accepts integral numbers", () => {
|
|
85
|
+
expect(coerceFieldValue(field({ type: FieldType.integer }), 42)).toEqual({
|
|
86
|
+
ok: true,
|
|
87
|
+
value: 42,
|
|
88
|
+
});
|
|
89
|
+
expect(coerceFieldValue(field({ type: FieldType.integer }), -7)).toEqual({
|
|
90
|
+
ok: true,
|
|
91
|
+
value: -7,
|
|
92
|
+
});
|
|
93
|
+
expect(coerceFieldValue(field({ type: FieldType.integer }), 0)).toEqual({
|
|
94
|
+
ok: true,
|
|
95
|
+
value: 0,
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("rejects fractional, non-numeric, and unsafe values", () => {
|
|
100
|
+
const f = field({ name: "n", type: FieldType.integer });
|
|
101
|
+
expect(coerceFieldValue(f, 1.5)).toMatchObject({ ok: false });
|
|
102
|
+
expect(coerceFieldValue(f, "3")).toMatchObject({ ok: false });
|
|
103
|
+
expect(coerceFieldValue(f, Number.MAX_SAFE_INTEGER + 2)).toMatchObject({ ok: false });
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
describe("number", () => {
|
|
108
|
+
it("accepts finite numbers", () => {
|
|
109
|
+
expect(coerceFieldValue(field({ type: FieldType.number }), 3.14)).toEqual({
|
|
110
|
+
ok: true,
|
|
111
|
+
value: 3.14,
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("rejects non-numbers and non-finite values", () => {
|
|
116
|
+
const f = field({ name: "n", type: FieldType.number });
|
|
117
|
+
expect(coerceFieldValue(f, "3.14")).toMatchObject({ ok: false });
|
|
118
|
+
expect(coerceFieldValue(f, Number.POSITIVE_INFINITY)).toMatchObject({ ok: false });
|
|
119
|
+
expect(coerceFieldValue(f, Number.NaN)).toMatchObject({ ok: false });
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe("bool", () => {
|
|
124
|
+
it("accepts booleans and rejects everything else", () => {
|
|
125
|
+
const f = field({ name: "b", type: FieldType.bool });
|
|
126
|
+
expect(coerceFieldValue(f, true)).toEqual({ ok: true, value: true });
|
|
127
|
+
expect(coerceFieldValue(f, false)).toEqual({ ok: true, value: false });
|
|
128
|
+
expect(coerceFieldValue(f, "true")).toMatchObject({ ok: false });
|
|
129
|
+
expect(coerceFieldValue(f, 1)).toMatchObject({ ok: false });
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
describe("timestamp", () => {
|
|
134
|
+
const f = field({ name: "at", type: FieldType.timestamp });
|
|
135
|
+
|
|
136
|
+
it("accepts RFC 3339 UTC and offset forms", () => {
|
|
137
|
+
expect(coerceFieldValue(f, "2026-07-21T04:30:00Z")).toEqual({
|
|
138
|
+
ok: true,
|
|
139
|
+
value: "2026-07-21T04:30:00Z",
|
|
140
|
+
});
|
|
141
|
+
expect(coerceFieldValue(f, "2026-07-21T04:30:00.123Z")).toMatchObject({ ok: true });
|
|
142
|
+
expect(coerceFieldValue(f, "2026-07-21T10:00:00+05:30")).toMatchObject({ ok: true });
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("rejects date-only, missing zone, and garbage", () => {
|
|
146
|
+
expect(coerceFieldValue(f, "2026-07-21")).toMatchObject({ ok: false });
|
|
147
|
+
expect(coerceFieldValue(f, "2026-07-21T04:30:00")).toMatchObject({ ok: false });
|
|
148
|
+
expect(coerceFieldValue(f, "yesterday")).toMatchObject({ ok: false });
|
|
149
|
+
expect(coerceFieldValue(f, 1721536200)).toMatchObject({ ok: false });
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
describe("date", () => {
|
|
154
|
+
const f = field({ name: "day", type: FieldType.date });
|
|
155
|
+
|
|
156
|
+
it("accepts valid YYYY-MM-DD", () => {
|
|
157
|
+
expect(coerceFieldValue(f, "2026-07-21")).toEqual({ ok: true, value: "2026-07-21" });
|
|
158
|
+
expect(coerceFieldValue(f, "2024-02-29")).toMatchObject({ ok: true }); // leap day
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("rejects impossible dates and other shapes", () => {
|
|
162
|
+
expect(coerceFieldValue(f, "2026-02-30")).toMatchObject({ ok: false });
|
|
163
|
+
expect(coerceFieldValue(f, "2026-13-01")).toMatchObject({ ok: false });
|
|
164
|
+
expect(coerceFieldValue(f, "2023-02-29")).toMatchObject({ ok: false }); // not a leap year
|
|
165
|
+
expect(coerceFieldValue(f, "21-07-2026")).toMatchObject({ ok: false });
|
|
166
|
+
expect(coerceFieldValue(f, "2026-7-1")).toMatchObject({ ok: false }); // unpadded
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
describe("time", () => {
|
|
171
|
+
const f = field({ name: "slot", type: FieldType.time });
|
|
172
|
+
|
|
173
|
+
it("canonicalizes HH:MM to HH:MM:SS", () => {
|
|
174
|
+
expect(coerceFieldValue(f, "09:30")).toEqual({ ok: true, value: "09:30:00" });
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it("passes HH:MM:SS through", () => {
|
|
178
|
+
expect(coerceFieldValue(f, "23:59:59")).toEqual({ ok: true, value: "23:59:59" });
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("rejects unpadded, out-of-range, and garbage input", () => {
|
|
182
|
+
expect(coerceFieldValue(f, "9:30")).toMatchObject({ ok: false }); // unpadded
|
|
183
|
+
expect(coerceFieldValue(f, "24:00")).toMatchObject({ ok: false });
|
|
184
|
+
expect(coerceFieldValue(f, "12:60")).toMatchObject({ ok: false });
|
|
185
|
+
expect(coerceFieldValue(f, "12:00:60")).toMatchObject({ ok: false });
|
|
186
|
+
expect(coerceFieldValue(f, "noon")).toMatchObject({ ok: false });
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
describe("json", () => {
|
|
191
|
+
it("passes any JSON value through untouched", () => {
|
|
192
|
+
const f = field({ type: FieldType.json });
|
|
193
|
+
const nested = { a: [1, "two", { three: true }] };
|
|
194
|
+
expect(coerceFieldValue(f, nested)).toEqual({ ok: true, value: nested });
|
|
195
|
+
expect(coerceFieldValue(f, [1, 2])).toMatchObject({ ok: true });
|
|
196
|
+
expect(coerceFieldValue(f, "plain")).toMatchObject({ ok: true });
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("rejects unspecified field types", () => {
|
|
201
|
+
expect(
|
|
202
|
+
coerceFieldValue(field({ type: FieldType.field_type_unspecified }), "x"),
|
|
203
|
+
).toMatchObject({ ok: false });
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
describe("formatFieldValue", () => {
|
|
208
|
+
it("renders null/undefined as empty", () => {
|
|
209
|
+
expect(formatFieldValue(FieldType.string, null)).toBe("");
|
|
210
|
+
expect(formatFieldValue(FieldType.integer, undefined)).toBe("");
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("trims the stored timestamp's zero fraction", () => {
|
|
214
|
+
expect(formatFieldValue(FieldType.timestamp, "2026-07-21T04:30:00.000000000Z")).toBe(
|
|
215
|
+
"2026-07-21T04:30:00Z",
|
|
216
|
+
);
|
|
217
|
+
// Non-zero fractions carry information and stay.
|
|
218
|
+
expect(formatFieldValue(FieldType.timestamp, "2026-07-21T04:30:00.500000000Z")).toBe(
|
|
219
|
+
"2026-07-21T04:30:00.500000000Z",
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it("stringifies json values compactly", () => {
|
|
224
|
+
expect(formatFieldValue(FieldType.json, { a: 1 })).toBe('{"a":1}');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it("renders scalars canonically", () => {
|
|
228
|
+
expect(formatFieldValue(FieldType.bool, true)).toBe("true");
|
|
229
|
+
expect(formatFieldValue(FieldType.integer, 42)).toBe("42");
|
|
230
|
+
expect(formatFieldValue(FieldType.date, "2026-07-21")).toBe("2026-07-21");
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it("formats system timestamps the same way", () => {
|
|
234
|
+
expect(formatSystemTimestamp("2026-07-21T04:30:00.000000000Z")).toBe(
|
|
235
|
+
"2026-07-21T04:30:00Z",
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
describe("operator matrix", () => {
|
|
241
|
+
it("string fields get equality operators", () => {
|
|
242
|
+
expect(operatorsForField(field({ type: FieldType.string, required: true }))).toEqual([
|
|
243
|
+
RecordConditionOp.eq,
|
|
244
|
+
RecordConditionOp.neq,
|
|
245
|
+
RecordConditionOp.is_in,
|
|
246
|
+
RecordConditionOp.not_in,
|
|
247
|
+
]);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("bool fields get eq/neq only", () => {
|
|
251
|
+
expect(operatorsForField(field({ type: FieldType.bool, required: true }))).toEqual([
|
|
252
|
+
RecordConditionOp.eq,
|
|
253
|
+
RecordConditionOp.neq,
|
|
254
|
+
]);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("numeric and temporal fields get range operators", () => {
|
|
258
|
+
for (const type of [
|
|
259
|
+
FieldType.integer,
|
|
260
|
+
FieldType.number,
|
|
261
|
+
FieldType.timestamp,
|
|
262
|
+
FieldType.date,
|
|
263
|
+
FieldType.time,
|
|
264
|
+
]) {
|
|
265
|
+
expect(operatorsForField(field({ type, required: true }))).toEqual([
|
|
266
|
+
RecordConditionOp.eq,
|
|
267
|
+
RecordConditionOp.neq,
|
|
268
|
+
RecordConditionOp.gt,
|
|
269
|
+
RecordConditionOp.gte,
|
|
270
|
+
RecordConditionOp.lt,
|
|
271
|
+
RecordConditionOp.lte,
|
|
272
|
+
]);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it("json fields are not filterable — even optional ones get no null tests", () => {
|
|
277
|
+
expect(operatorsForField(field({ type: FieldType.json }))).toEqual([]);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it("optional fields additionally get null tests", () => {
|
|
281
|
+
const ops = operatorsForField(field({ type: FieldType.string, required: false }));
|
|
282
|
+
expect(ops).toContain(RecordConditionOp.is_null);
|
|
283
|
+
expect(ops).toContain(RecordConditionOp.not_null);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it("required fields never get null tests", () => {
|
|
287
|
+
const ops = operatorsForField(field({ type: FieldType.string, required: true }));
|
|
288
|
+
expect(ops).not.toContain(RecordConditionOp.is_null);
|
|
289
|
+
expect(ops).not.toContain(RecordConditionOp.not_null);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it("system fields mirror the server matrix", () => {
|
|
293
|
+
expect(SYSTEM_FIELD_OPERATORS.get("id")).toEqual([
|
|
294
|
+
RecordConditionOp.eq,
|
|
295
|
+
RecordConditionOp.is_in,
|
|
296
|
+
]);
|
|
297
|
+
expect(SYSTEM_FIELD_OPERATORS.get("created_at")).toEqual([
|
|
298
|
+
RecordConditionOp.gt,
|
|
299
|
+
RecordConditionOp.gte,
|
|
300
|
+
RecordConditionOp.lt,
|
|
301
|
+
RecordConditionOp.lte,
|
|
302
|
+
]);
|
|
303
|
+
expect(SYSTEM_FIELD_OPERATORS.get("updated_at")).toEqual(
|
|
304
|
+
SYSTEM_FIELD_OPERATORS.get("created_at"),
|
|
305
|
+
);
|
|
306
|
+
// Not filterable: attribution and ambient scope.
|
|
307
|
+
expect(SYSTEM_FIELD_OPERATORS.has("created_by")).toBe(false);
|
|
308
|
+
expect(SYSTEM_FIELD_OPERATORS.has("org")).toBe(false);
|
|
309
|
+
expect(SYSTEM_FIELD_OPERATORS.has("partition")).toBe(false);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it("classifies operator arity", () => {
|
|
313
|
+
expect(isValuelessOperator(RecordConditionOp.is_null)).toBe(true);
|
|
314
|
+
expect(isValuelessOperator(RecordConditionOp.not_null)).toBe(true);
|
|
315
|
+
expect(isValuelessOperator(RecordConditionOp.eq)).toBe(false);
|
|
316
|
+
expect(isListOperator(RecordConditionOp.is_in)).toBe(true);
|
|
317
|
+
expect(isListOperator(RecordConditionOp.not_in)).toBe(true);
|
|
318
|
+
expect(isListOperator(RecordConditionOp.eq)).toBe(false);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
describe("isSortableField", () => {
|
|
323
|
+
it("declared non-json fields sort; json does not", () => {
|
|
324
|
+
expect(isSortableField(field({ type: FieldType.date }))).toBe(true);
|
|
325
|
+
expect(isSortableField(field({ type: FieldType.string }))).toBe(true);
|
|
326
|
+
expect(isSortableField(field({ type: FieldType.json }))).toBe(false);
|
|
327
|
+
expect(isSortableField(field({ type: FieldType.field_type_unspecified }))).toBe(false);
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
describe("buildUpdateFields", () => {
|
|
332
|
+
it("carries dirty values and explicit nulls, omits untouched fields", () => {
|
|
333
|
+
const payload = buildUpdateFields(
|
|
334
|
+
new Map<string, string | null>([
|
|
335
|
+
["patient_phone", "+15550100"],
|
|
336
|
+
["notes", null],
|
|
337
|
+
]),
|
|
338
|
+
);
|
|
339
|
+
expect(payload).toEqual({ patient_phone: "+15550100", notes: null });
|
|
340
|
+
expect("slot_time" in payload).toBe(false);
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
it("produces an empty object for no edits", () => {
|
|
344
|
+
expect(buildUpdateFields(new Map())).toEqual({});
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
describe("RESERVED_FIELD_NAMES", () => {
|
|
349
|
+
it("matches the server's reserved set", () => {
|
|
350
|
+
expect([...RESERVED_FIELD_NAMES].sort()).toEqual([
|
|
351
|
+
"created_at",
|
|
352
|
+
"created_by",
|
|
353
|
+
"id",
|
|
354
|
+
"org",
|
|
355
|
+
"partition",
|
|
356
|
+
"updated_at",
|
|
357
|
+
]);
|
|
358
|
+
});
|
|
359
|
+
});
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Render tests for the two Overview views: the schema view (spec for
|
|
2
|
+
// structure — fields, constraints with authored messages, authorization
|
|
3
|
+
// summary) and the sync report (status for health).
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect, afterEach } from "vitest";
|
|
6
|
+
import { render, screen, cleanup } from "@testing-library/react";
|
|
7
|
+
import { create } from "@bufbuild/protobuf";
|
|
8
|
+
import {
|
|
9
|
+
DatastoreSpecSchema,
|
|
10
|
+
FieldType,
|
|
11
|
+
} from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/spec_pb";
|
|
12
|
+
import {
|
|
13
|
+
CollectionMaterializationState,
|
|
14
|
+
DatastoreStatusSchema,
|
|
15
|
+
DatastoreSyncOutcome,
|
|
16
|
+
} from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/status_pb";
|
|
17
|
+
import { CollectionSchemaView, formatSubject } from "../CollectionSchemaView";
|
|
18
|
+
import { DatastoreSyncReport } from "../DatastoreSyncReport";
|
|
19
|
+
|
|
20
|
+
afterEach(() => cleanup());
|
|
21
|
+
|
|
22
|
+
describe("CollectionSchemaView", () => {
|
|
23
|
+
const spec = create(DatastoreSpecSchema, {
|
|
24
|
+
timezone: "Asia/Kolkata",
|
|
25
|
+
authorization: {
|
|
26
|
+
roles: [{ name: "admin" }, { name: "patient" }],
|
|
27
|
+
defaultRole: "patient",
|
|
28
|
+
bindings: [
|
|
29
|
+
{
|
|
30
|
+
subject: {
|
|
31
|
+
kind: { case: "channelSender", value: { senderKind: "whatsapp", value: "+15550100" } },
|
|
32
|
+
},
|
|
33
|
+
role: "admin",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
collections: [
|
|
38
|
+
{
|
|
39
|
+
name: "bookings",
|
|
40
|
+
description: "Confirmed appointments",
|
|
41
|
+
fields: [
|
|
42
|
+
{ name: "slot_date", type: FieldType.date, required: true },
|
|
43
|
+
{
|
|
44
|
+
name: "status",
|
|
45
|
+
type: FieldType.string,
|
|
46
|
+
enumValues: ["confirmed", "cancelled"],
|
|
47
|
+
description: "Booking lifecycle",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
uniques: [
|
|
51
|
+
{
|
|
52
|
+
name: "one_confirmed_per_slot",
|
|
53
|
+
fields: ["slot_date"],
|
|
54
|
+
message: "that slot is already booked",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("renders fields, enum values, and required markers", () => {
|
|
62
|
+
render(<CollectionSchemaView spec={spec} />);
|
|
63
|
+
expect(screen.getByText("slot_date")).toBeTruthy();
|
|
64
|
+
expect(screen.getByText(/confirmed \| cancelled/)).toBeTruthy();
|
|
65
|
+
expect(screen.getByText("Booking lifecycle")).toBeTruthy();
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("renders constraints with the operator's authored message verbatim", () => {
|
|
69
|
+
render(<CollectionSchemaView spec={spec} />);
|
|
70
|
+
expect(screen.getByText("one_confirmed_per_slot")).toBeTruthy();
|
|
71
|
+
expect(screen.getByText(/that slot is already booked/)).toBeTruthy();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("summarizes the authorization block: roles, bindings, default_role, timezone", () => {
|
|
75
|
+
render(<CollectionSchemaView spec={spec} />);
|
|
76
|
+
// "admin" appears as a role chip and as the binding's role.
|
|
77
|
+
expect(screen.getAllByText("admin").length).toBeGreaterThan(0);
|
|
78
|
+
// "patient" appears as a role chip and as the default_role chip.
|
|
79
|
+
expect(screen.getAllByText("patient").length).toBeGreaterThan(0);
|
|
80
|
+
expect(screen.getByText("whatsapp:+15550100")).toBeTruthy();
|
|
81
|
+
expect(screen.getByText("Asia/Kolkata")).toBeTruthy();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("states the deny-by-default posture when no default_role is set", () => {
|
|
85
|
+
const noDefault = create(DatastoreSpecSchema, {
|
|
86
|
+
authorization: { roles: [{ name: "admin" }] },
|
|
87
|
+
collections: [{ name: "c", fields: [{ name: "f", type: FieldType.string }] }],
|
|
88
|
+
});
|
|
89
|
+
render(<CollectionSchemaView spec={noDefault} />);
|
|
90
|
+
expect(screen.getByText(/unbound callers are denied/)).toBeTruthy();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("formatSubject", () => {
|
|
95
|
+
it("renders channel senders and principals plainly", () => {
|
|
96
|
+
expect(
|
|
97
|
+
formatSubject({
|
|
98
|
+
kind: { case: "channelSender", value: { senderKind: "whatsapp", value: "+1" } },
|
|
99
|
+
} as never),
|
|
100
|
+
).toBe("whatsapp:+1");
|
|
101
|
+
expect(
|
|
102
|
+
formatSubject({
|
|
103
|
+
kind: { case: "principal", value: { kind: "identity_account", id: "ida_1" } },
|
|
104
|
+
} as never),
|
|
105
|
+
).toBe("identity_account/ida_1");
|
|
106
|
+
expect(formatSubject(undefined)).toBe("unknown");
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
describe("DatastoreSyncReport", () => {
|
|
111
|
+
it("renders the outcome badge and per-collection counts", () => {
|
|
112
|
+
const status = create(DatastoreStatusSchema, {
|
|
113
|
+
lastSyncOutcome: DatastoreSyncOutcome.synced,
|
|
114
|
+
collections: [
|
|
115
|
+
{
|
|
116
|
+
name: "bookings",
|
|
117
|
+
state: CollectionMaterializationState.active,
|
|
118
|
+
recordCount: 214n,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "old_notes",
|
|
122
|
+
state: CollectionMaterializationState.removed,
|
|
123
|
+
recordCount: 3n,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
});
|
|
127
|
+
render(<DatastoreSyncReport status={status} />);
|
|
128
|
+
expect(screen.getByText("synced")).toBeTruthy();
|
|
129
|
+
expect(screen.getByText("214")).toBeTruthy();
|
|
130
|
+
expect(screen.getByText("active")).toBeTruthy();
|
|
131
|
+
expect(screen.getByText("removed")).toBeTruthy();
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("renders the rejected outcome", () => {
|
|
135
|
+
const status = create(DatastoreStatusSchema, {
|
|
136
|
+
lastSyncOutcome: DatastoreSyncOutcome.rejected,
|
|
137
|
+
});
|
|
138
|
+
render(<DatastoreSyncReport status={status} />);
|
|
139
|
+
expect(screen.getByText("rejected")).toBeTruthy();
|
|
140
|
+
expect(screen.getByText(/No collections have been synced yet/)).toBeTruthy();
|
|
141
|
+
});
|
|
142
|
+
});
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { renderHook, waitFor } from "@testing-library/react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { DatastoreDescriptionSchema } from "@stigmer/protos/ai/stigmer/agentic/datastore/v1/record_io_pb";
|
|
6
|
+
import { StigmerContext } from "../../context";
|
|
7
|
+
import { FetchCacheContext } from "../../internal/FetchCacheProvider";
|
|
8
|
+
import { useDatastoreDescription } from "../useDatastoreDescription";
|
|
9
|
+
|
|
10
|
+
function createMockStigmer(overrides: {
|
|
11
|
+
describeDatastore?: (...args: unknown[]) => Promise<unknown>;
|
|
12
|
+
} = {}) {
|
|
13
|
+
return {
|
|
14
|
+
datastore: {
|
|
15
|
+
describeDatastore:
|
|
16
|
+
overrides.describeDatastore ?? vi.fn().mockResolvedValue(null),
|
|
17
|
+
},
|
|
18
|
+
} as never;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function wrapper(client: unknown) {
|
|
22
|
+
return function Wrapper({ children }: { children: ReactNode }) {
|
|
23
|
+
return (
|
|
24
|
+
<FetchCacheContext.Provider value={null}>
|
|
25
|
+
<StigmerContext.Provider value={client as never}>
|
|
26
|
+
{children}
|
|
27
|
+
</StigmerContext.Provider>
|
|
28
|
+
</FetchCacheContext.Provider>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
describe("useDatastoreDescription", () => {
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
vi.restoreAllMocks();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("fetches the description and passes org + datastore through", async () => {
|
|
39
|
+
const description = create(DatastoreDescriptionSchema, {
|
|
40
|
+
datastore: "clinic",
|
|
41
|
+
partitions: ["default", "dr-alt"],
|
|
42
|
+
});
|
|
43
|
+
const describeDatastore = vi.fn().mockResolvedValue(description);
|
|
44
|
+
const client = createMockStigmer({ describeDatastore });
|
|
45
|
+
|
|
46
|
+
const { result } = renderHook(() => useDatastoreDescription("acme", "clinic"), {
|
|
47
|
+
wrapper: wrapper(client),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
await waitFor(() => expect(result.current.isLoading).toBe(false));
|
|
51
|
+
|
|
52
|
+
expect(result.current.description).toBe(description);
|
|
53
|
+
expect(describeDatastore).toHaveBeenCalledWith(
|
|
54
|
+
expect.objectContaining({ org: "acme", datastore: "clinic" }),
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("always offers the default partition even when the catalog is empty", async () => {
|
|
59
|
+
// The catalog materializes with the first record write; an empty
|
|
60
|
+
// datastore reports no partitions but "default" is always addressable.
|
|
61
|
+
const description = create(DatastoreDescriptionSchema, {
|
|
62
|
+
datastore: "clinic",
|
|
63
|
+
partitions: [],
|
|
64
|
+
});
|
|
65
|
+
const client = createMockStigmer({
|
|
66
|
+
describeDatastore: vi.fn().mockResolvedValue(description),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const { result } = renderHook(() => useDatastoreDescription("acme", "clinic"), {
|
|
70
|
+
wrapper: wrapper(client),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
await waitFor(() => expect(result.current.isLoading).toBe(false));
|
|
74
|
+
expect(result.current.partitions).toEqual(["default"]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("prepends default when the catalog holds only named partitions", async () => {
|
|
78
|
+
const description = create(DatastoreDescriptionSchema, {
|
|
79
|
+
datastore: "clinic",
|
|
80
|
+
partitions: ["dr-alt"],
|
|
81
|
+
});
|
|
82
|
+
const client = createMockStigmer({
|
|
83
|
+
describeDatastore: vi.fn().mockResolvedValue(description),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const { result } = renderHook(() => useDatastoreDescription("acme", "clinic"), {
|
|
87
|
+
wrapper: wrapper(client),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
await waitFor(() => expect(result.current.isLoading).toBe(false));
|
|
91
|
+
expect(result.current.partitions).toEqual(["default", "dr-alt"]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("does not duplicate default when the catalog already carries it", async () => {
|
|
95
|
+
const description = create(DatastoreDescriptionSchema, {
|
|
96
|
+
datastore: "clinic",
|
|
97
|
+
partitions: ["default", "dr-alt"],
|
|
98
|
+
});
|
|
99
|
+
const client = createMockStigmer({
|
|
100
|
+
describeDatastore: vi.fn().mockResolvedValue(description),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const { result } = renderHook(() => useDatastoreDescription("acme", "clinic"), {
|
|
104
|
+
wrapper: wrapper(client),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
await waitFor(() => expect(result.current.isLoading).toBe(false));
|
|
108
|
+
expect(result.current.partitions).toEqual(["default", "dr-alt"]);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("skips fetching when org or datastore is null", () => {
|
|
112
|
+
const describeDatastore = vi.fn();
|
|
113
|
+
const client = createMockStigmer({ describeDatastore });
|
|
114
|
+
|
|
115
|
+
const { result } = renderHook(() => useDatastoreDescription(null, "clinic"), {
|
|
116
|
+
wrapper: wrapper(client),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
expect(result.current.isLoading).toBe(false);
|
|
120
|
+
expect(result.current.description).toBeNull();
|
|
121
|
+
expect(result.current.partitions).toEqual(["default"]);
|
|
122
|
+
expect(describeDatastore).not.toHaveBeenCalled();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it("surfaces PERMISSION_DENIED as error — the defensive denied-state branch", async () => {
|
|
126
|
+
// A reach-level denial must be catchable and rendered as the
|
|
127
|
+
// Records-tab denied panel, never a page-level failure.
|
|
128
|
+
const denial = new Error("unauthorized to use records in this datastore");
|
|
129
|
+
const client = createMockStigmer({
|
|
130
|
+
describeDatastore: vi.fn().mockRejectedValue(denial),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const { result } = renderHook(() => useDatastoreDescription("acme", "clinic"), {
|
|
134
|
+
wrapper: wrapper(client),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
await waitFor(() => expect(result.current.isLoading).toBe(false));
|
|
138
|
+
expect(result.current.error?.message).toBe(
|
|
139
|
+
"unauthorized to use records in this datastore",
|
|
140
|
+
);
|
|
141
|
+
expect(result.current.description).toBeNull();
|
|
142
|
+
});
|
|
143
|
+
});
|