@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,237 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { renderHook, act } from "@testing-library/react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { StigmerContext } from "../../context";
|
|
5
|
+
import { useApplyManifest } from "../useApplyManifest";
|
|
6
|
+
|
|
7
|
+
// The hook runs the real manifest engine (parseManifest from @stigmer/sdk);
|
|
8
|
+
// only the network-facing manifest client is mocked.
|
|
9
|
+
function createMockStigmer(overrides: {
|
|
10
|
+
apply?: (...args: unknown[]) => Promise<unknown>;
|
|
11
|
+
getByReference?: (...args: unknown[]) => Promise<unknown>;
|
|
12
|
+
} = {}) {
|
|
13
|
+
return {
|
|
14
|
+
manifest: {
|
|
15
|
+
apply:
|
|
16
|
+
overrides.apply ??
|
|
17
|
+
vi.fn().mockImplementation((doc: { handler: { yamlKind: string; displayName: string }; name: string; slug: string; org: string }) =>
|
|
18
|
+
Promise.resolve({
|
|
19
|
+
yamlKind: doc.handler.yamlKind,
|
|
20
|
+
displayName: doc.handler.displayName,
|
|
21
|
+
name: doc.name,
|
|
22
|
+
slug: doc.slug,
|
|
23
|
+
org: doc.org,
|
|
24
|
+
id: "res_01",
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
getByReference: overrides.getByReference ?? vi.fn().mockResolvedValue(null),
|
|
28
|
+
},
|
|
29
|
+
} as never;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function wrapper(client: unknown) {
|
|
33
|
+
return function Wrapper({ children }: { children: ReactNode }) {
|
|
34
|
+
return (
|
|
35
|
+
<StigmerContext.Provider value={client as never}>
|
|
36
|
+
{children}
|
|
37
|
+
</StigmerContext.Provider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const AGENT_YAML = `
|
|
43
|
+
apiVersion: agentic.stigmer.ai/v1
|
|
44
|
+
kind: Agent
|
|
45
|
+
metadata:
|
|
46
|
+
name: clinic-patient-assistant
|
|
47
|
+
spec:
|
|
48
|
+
instructions: Short messages.
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const CHANNEL_AND_ENV_YAML = `
|
|
52
|
+
apiVersion: agentic.stigmer.ai/v1
|
|
53
|
+
kind: AgentChannel
|
|
54
|
+
metadata:
|
|
55
|
+
name: clinic-patient-whatsapp
|
|
56
|
+
org: rakeshreddi098
|
|
57
|
+
spec:
|
|
58
|
+
agent_ref:
|
|
59
|
+
kind: agent
|
|
60
|
+
org: rakeshreddi098
|
|
61
|
+
slug: clinic-patient-assistant
|
|
62
|
+
enabled: true
|
|
63
|
+
---
|
|
64
|
+
apiVersion: agentic.stigmer.ai/v1
|
|
65
|
+
kind: Environment
|
|
66
|
+
metadata:
|
|
67
|
+
name: clinic-patient-db
|
|
68
|
+
org: rakeshreddi098
|
|
69
|
+
spec:
|
|
70
|
+
data:
|
|
71
|
+
POSTGRES_CONNECTION_URL:
|
|
72
|
+
value: "***REDACTED***"
|
|
73
|
+
is_secret: true
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
// Validation (parse + existence resolution) debounces across keystrokes.
|
|
77
|
+
const DEBOUNCE_MS = 500;
|
|
78
|
+
|
|
79
|
+
async function settleValidation() {
|
|
80
|
+
await vi.advanceTimersByTimeAsync(DEBOUNCE_MS + 10);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
describe("useApplyManifest", () => {
|
|
84
|
+
beforeEach(() => {
|
|
85
|
+
vi.useFakeTimers();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
afterEach(() => {
|
|
89
|
+
vi.useRealTimers();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("validates pasted content and injects the target org", async () => {
|
|
93
|
+
const { result } = renderHook(() => useApplyManifest("acme"), {
|
|
94
|
+
wrapper: wrapper(createMockStigmer()),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
act(() => {
|
|
98
|
+
result.current.setContent(AGENT_YAML);
|
|
99
|
+
});
|
|
100
|
+
expect(result.current.isValidating).toBe(true);
|
|
101
|
+
|
|
102
|
+
await act(settleValidation);
|
|
103
|
+
|
|
104
|
+
expect(result.current.validationError).toBeNull();
|
|
105
|
+
expect(result.current.entries).toHaveLength(1);
|
|
106
|
+
expect(result.current.entries![0]).toMatchObject({
|
|
107
|
+
action: "create",
|
|
108
|
+
status: "pending",
|
|
109
|
+
});
|
|
110
|
+
expect(result.current.entries![0].document.org).toBe("acme");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("surfaces parse errors with the schema complaint", async () => {
|
|
114
|
+
const { result } = renderHook(() => useApplyManifest("acme"), {
|
|
115
|
+
wrapper: wrapper(createMockStigmer()),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
act(() => {
|
|
119
|
+
result.current.setContent("kind: Agent\nmetadata:\n name: x\nspec:\n bogus_field: 1\n");
|
|
120
|
+
});
|
|
121
|
+
await act(settleValidation);
|
|
122
|
+
|
|
123
|
+
expect(result.current.entries).toBeNull();
|
|
124
|
+
expect(result.current.validationError).toContain("Invalid Agent");
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("orders multi-document manifests by dependency (Environment before AgentChannel)", async () => {
|
|
128
|
+
const { result } = renderHook(() => useApplyManifest("rakeshreddi098"), {
|
|
129
|
+
wrapper: wrapper(createMockStigmer()),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
act(() => {
|
|
133
|
+
result.current.setContent(CHANNEL_AND_ENV_YAML);
|
|
134
|
+
});
|
|
135
|
+
await act(settleValidation);
|
|
136
|
+
|
|
137
|
+
expect(
|
|
138
|
+
result.current.entries!.map((e) => e.document.handler.yamlKind),
|
|
139
|
+
).toEqual(["Environment", "AgentChannel"]);
|
|
140
|
+
expect(result.current.hasRedactedSecrets).toBe(true);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("marks existing resources as updates in the preview", async () => {
|
|
144
|
+
const getByReference = vi.fn().mockResolvedValue({ metadata: {} });
|
|
145
|
+
const { result } = renderHook(() => useApplyManifest("acme"), {
|
|
146
|
+
wrapper: wrapper(createMockStigmer({ getByReference })),
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
act(() => {
|
|
150
|
+
result.current.setContent(AGENT_YAML);
|
|
151
|
+
});
|
|
152
|
+
await act(settleValidation);
|
|
153
|
+
|
|
154
|
+
expect(result.current.entries![0].action).toBe("update");
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it("applies all documents sequentially and reports success", async () => {
|
|
158
|
+
const apply = vi.fn().mockImplementation((doc: { handler: { yamlKind: string; displayName: string }; name: string; slug: string; org: string }) =>
|
|
159
|
+
Promise.resolve({
|
|
160
|
+
yamlKind: doc.handler.yamlKind,
|
|
161
|
+
displayName: doc.handler.displayName,
|
|
162
|
+
name: doc.name,
|
|
163
|
+
slug: doc.slug,
|
|
164
|
+
org: doc.org,
|
|
165
|
+
id: "res_01",
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
const { result } = renderHook(() => useApplyManifest("rakeshreddi098"), {
|
|
169
|
+
wrapper: wrapper(createMockStigmer({ apply })),
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
act(() => {
|
|
173
|
+
result.current.setContent(CHANNEL_AND_ENV_YAML);
|
|
174
|
+
});
|
|
175
|
+
await act(settleValidation);
|
|
176
|
+
|
|
177
|
+
let allApplied = false;
|
|
178
|
+
await act(async () => {
|
|
179
|
+
allApplied = await result.current.applyAll();
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
expect(allApplied).toBe(true);
|
|
183
|
+
expect(apply).toHaveBeenCalledTimes(2);
|
|
184
|
+
expect(result.current.entries!.map((e) => e.status)).toEqual([
|
|
185
|
+
"applied",
|
|
186
|
+
"applied",
|
|
187
|
+
]);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it("stops at the first failure and marks the rest skipped", async () => {
|
|
191
|
+
const apply = vi
|
|
192
|
+
.fn()
|
|
193
|
+
.mockRejectedValueOnce(new Error("environment rejected"))
|
|
194
|
+
.mockResolvedValue({});
|
|
195
|
+
const { result } = renderHook(() => useApplyManifest("rakeshreddi098"), {
|
|
196
|
+
wrapper: wrapper(createMockStigmer({ apply })),
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
act(() => {
|
|
200
|
+
result.current.setContent(CHANNEL_AND_ENV_YAML);
|
|
201
|
+
});
|
|
202
|
+
await act(settleValidation);
|
|
203
|
+
|
|
204
|
+
let allApplied = true;
|
|
205
|
+
await act(async () => {
|
|
206
|
+
allApplied = await result.current.applyAll();
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
expect(allApplied).toBe(false);
|
|
210
|
+
expect(apply).toHaveBeenCalledTimes(1);
|
|
211
|
+
expect(result.current.entries!.map((e) => e.status)).toEqual([
|
|
212
|
+
"failed",
|
|
213
|
+
"skipped",
|
|
214
|
+
]);
|
|
215
|
+
expect(result.current.entries![0].errorMessage).toBe("environment rejected");
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it("reset clears content, preview, and errors", async () => {
|
|
219
|
+
const { result } = renderHook(() => useApplyManifest("acme"), {
|
|
220
|
+
wrapper: wrapper(createMockStigmer()),
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
act(() => {
|
|
224
|
+
result.current.setContent(AGENT_YAML);
|
|
225
|
+
});
|
|
226
|
+
await act(settleValidation);
|
|
227
|
+
expect(result.current.entries).not.toBeNull();
|
|
228
|
+
|
|
229
|
+
act(() => {
|
|
230
|
+
result.current.reset();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
expect(result.current.content).toBe("");
|
|
234
|
+
expect(result.current.entries).toBeNull();
|
|
235
|
+
expect(result.current.validationError).toBeNull();
|
|
236
|
+
});
|
|
237
|
+
});
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { renderHook, act } from "@testing-library/react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { create } from "@bufbuild/protobuf";
|
|
5
|
+
import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
6
|
+
import { StigmerContext } from "../../context";
|
|
7
|
+
import { useEditResourceYaml } from "../useEditResourceYaml";
|
|
8
|
+
|
|
9
|
+
// The hooks run the real manifest engine (serializeManifest/parseManifest
|
|
10
|
+
// from @stigmer/sdk); only the network-facing manifest client is mocked.
|
|
11
|
+
function createMockStigmer(overrides: {
|
|
12
|
+
apply?: (...args: unknown[]) => Promise<unknown>;
|
|
13
|
+
getByReference?: (...args: unknown[]) => Promise<unknown>;
|
|
14
|
+
} = {}) {
|
|
15
|
+
return {
|
|
16
|
+
manifest: {
|
|
17
|
+
apply:
|
|
18
|
+
overrides.apply ??
|
|
19
|
+
vi.fn().mockResolvedValue({
|
|
20
|
+
yamlKind: "Agent",
|
|
21
|
+
displayName: "Agent",
|
|
22
|
+
name: "clinic-patient-assistant",
|
|
23
|
+
slug: "clinic-patient-assistant",
|
|
24
|
+
org: "rakeshreddi098",
|
|
25
|
+
id: "agt_01",
|
|
26
|
+
}),
|
|
27
|
+
getByReference:
|
|
28
|
+
overrides.getByReference ?? vi.fn().mockResolvedValue({ metadata: {} }),
|
|
29
|
+
},
|
|
30
|
+
} as never;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function wrapper(client: unknown) {
|
|
34
|
+
return function Wrapper({ children }: { children: ReactNode }) {
|
|
35
|
+
return (
|
|
36
|
+
<StigmerContext.Provider value={client as never}>
|
|
37
|
+
{children}
|
|
38
|
+
</StigmerContext.Provider>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const agent = create(AgentSchema, {
|
|
44
|
+
metadata: {
|
|
45
|
+
id: "agt_01",
|
|
46
|
+
name: "clinic-patient-assistant",
|
|
47
|
+
slug: "clinic-patient-assistant",
|
|
48
|
+
org: "rakeshreddi098",
|
|
49
|
+
},
|
|
50
|
+
spec: { instructions: "Short messages." },
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// The create-vs-update check debounces across keystrokes.
|
|
54
|
+
const DEBOUNCE_MS = 400;
|
|
55
|
+
|
|
56
|
+
describe("useEditResourceYaml", () => {
|
|
57
|
+
beforeEach(() => {
|
|
58
|
+
vi.useFakeTimers();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
afterEach(() => {
|
|
62
|
+
vi.useRealTimers();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("seeds the editor from the serialized resource", () => {
|
|
66
|
+
const { result } = renderHook(
|
|
67
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
68
|
+
{ wrapper: wrapper(createMockStigmer()) },
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(result.current.yaml).toContain("kind: Agent");
|
|
72
|
+
expect(result.current.yaml).toContain("clinic-patient-assistant");
|
|
73
|
+
expect(result.current.yaml).not.toContain("status:");
|
|
74
|
+
expect(result.current.isDirty).toBe(false);
|
|
75
|
+
expect(result.current.validation.status).toBe("valid");
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("reports schema violations inline as the user edits", () => {
|
|
79
|
+
const { result } = renderHook(
|
|
80
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
81
|
+
{ wrapper: wrapper(createMockStigmer()) },
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
act(() => {
|
|
85
|
+
result.current.setYaml(
|
|
86
|
+
result.current.yaml.replace("instructions:", "instrctions:"),
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
expect(result.current.validation).toMatchObject({
|
|
91
|
+
status: "invalid",
|
|
92
|
+
message: expect.stringContaining("Invalid Agent"),
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("rejects a kind change, pointing at the Apply YAML flow instead", () => {
|
|
97
|
+
const { result } = renderHook(
|
|
98
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
99
|
+
{ wrapper: wrapper(createMockStigmer()) },
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
act(() => {
|
|
103
|
+
// A structurally valid Environment — the schema accepts it, so the
|
|
104
|
+
// kind guard (not the schema) must be what rejects it.
|
|
105
|
+
result.current.setYaml(
|
|
106
|
+
[
|
|
107
|
+
"apiVersion: agentic.stigmer.ai/v1",
|
|
108
|
+
"kind: Environment",
|
|
109
|
+
"metadata:",
|
|
110
|
+
" name: clinic-patient-db",
|
|
111
|
+
" org: rakeshreddi098",
|
|
112
|
+
"spec:",
|
|
113
|
+
" description: not an agent",
|
|
114
|
+
].join("\n"),
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
expect(result.current.validation).toMatchObject({
|
|
119
|
+
status: "invalid",
|
|
120
|
+
message: expect.stringContaining("kind changed from Agent to Environment"),
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("resolves the target to 'update' when the reference exists", async () => {
|
|
125
|
+
const getByReference = vi.fn().mockResolvedValue({ metadata: {} });
|
|
126
|
+
const { result } = renderHook(
|
|
127
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
128
|
+
{ wrapper: wrapper(createMockStigmer({ getByReference })) },
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
act(() => {
|
|
132
|
+
result.current.setYaml(
|
|
133
|
+
result.current.yaml.replace("Short messages.", "Long messages."),
|
|
134
|
+
);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
await act(async () => {
|
|
138
|
+
await vi.advanceTimersByTimeAsync(DEBOUNCE_MS + 10);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
expect(getByReference).toHaveBeenCalledWith(
|
|
142
|
+
"Agent",
|
|
143
|
+
"rakeshreddi098",
|
|
144
|
+
"clinic-patient-assistant",
|
|
145
|
+
);
|
|
146
|
+
expect(result.current.target).toEqual({
|
|
147
|
+
action: "update",
|
|
148
|
+
slug: "clinic-patient-assistant",
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it("resolves the target to 'create' after a rename (honest preview)", async () => {
|
|
153
|
+
const getByReference = vi.fn().mockResolvedValue(null);
|
|
154
|
+
const { result } = renderHook(
|
|
155
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
156
|
+
{ wrapper: wrapper(createMockStigmer({ getByReference })) },
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
act(() => {
|
|
160
|
+
// Rename name AND slug — the slug is the apply routing key, so this
|
|
161
|
+
// is the edit that would land as a brand-new resource.
|
|
162
|
+
result.current.setYaml(
|
|
163
|
+
result.current.yaml.replaceAll(
|
|
164
|
+
"clinic-patient-assistant",
|
|
165
|
+
"renamed-assistant",
|
|
166
|
+
),
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
await act(async () => {
|
|
171
|
+
await vi.advanceTimersByTimeAsync(DEBOUNCE_MS + 10);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
expect(getByReference).toHaveBeenCalledWith(
|
|
175
|
+
"Agent",
|
|
176
|
+
"rakeshreddi098",
|
|
177
|
+
"renamed-assistant",
|
|
178
|
+
);
|
|
179
|
+
expect(result.current.target).toEqual({
|
|
180
|
+
action: "create",
|
|
181
|
+
slug: "renamed-assistant",
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
it("applies the edited document and clears the dirty flag", async () => {
|
|
186
|
+
const apply = vi.fn().mockResolvedValue({
|
|
187
|
+
yamlKind: "Agent",
|
|
188
|
+
displayName: "Agent",
|
|
189
|
+
name: "clinic-patient-assistant",
|
|
190
|
+
slug: "clinic-patient-assistant",
|
|
191
|
+
org: "rakeshreddi098",
|
|
192
|
+
id: "agt_01",
|
|
193
|
+
});
|
|
194
|
+
const { result } = renderHook(
|
|
195
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
196
|
+
{ wrapper: wrapper(createMockStigmer({ apply })) },
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
act(() => {
|
|
200
|
+
result.current.setYaml(
|
|
201
|
+
result.current.yaml.replace("Short messages.", "Long messages."),
|
|
202
|
+
);
|
|
203
|
+
});
|
|
204
|
+
expect(result.current.isDirty).toBe(true);
|
|
205
|
+
|
|
206
|
+
await act(async () => {
|
|
207
|
+
const applied = await result.current.apply();
|
|
208
|
+
expect(applied?.slug).toBe("clinic-patient-assistant");
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
expect(apply).toHaveBeenCalledTimes(1);
|
|
212
|
+
expect(result.current.isDirty).toBe(false);
|
|
213
|
+
expect(result.current.error).toBeNull();
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it("surfaces apply failures as error state and re-throws", async () => {
|
|
217
|
+
const apply = vi.fn().mockRejectedValue(new Error("permission denied"));
|
|
218
|
+
const { result } = renderHook(
|
|
219
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
220
|
+
{ wrapper: wrapper(createMockStigmer({ apply })) },
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
act(() => {
|
|
224
|
+
result.current.setYaml(
|
|
225
|
+
result.current.yaml.replace("Short messages.", "Long messages."),
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
await act(async () => {
|
|
230
|
+
await expect(result.current.apply()).rejects.toThrow("permission denied");
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
expect(result.current.error?.message).toBe("permission denied");
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it("flags redacted secret markers in the content", () => {
|
|
237
|
+
const { result } = renderHook(
|
|
238
|
+
() => useEditResourceYaml({ resource: agent }),
|
|
239
|
+
{ wrapper: wrapper(createMockStigmer()) },
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
expect(result.current.hasRedactedSecrets).toBe(false);
|
|
243
|
+
|
|
244
|
+
act(() => {
|
|
245
|
+
result.current.setYaml(
|
|
246
|
+
result.current.yaml.replace("Short messages.", "***REDACTED***"),
|
|
247
|
+
);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
expect(result.current.hasRedactedSecrets).toBe(true);
|
|
251
|
+
});
|
|
252
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Manifest domain: the console-facing YAML edit/apply experience for every
|
|
2
|
+
// registry-supported resource kind, built on the @stigmer/sdk manifest
|
|
3
|
+
// engine (parseManifest / serializeManifest / stigmer.manifest).
|
|
4
|
+
//
|
|
5
|
+
// Headless-first (DD-003): the hooks are independently importable; the
|
|
6
|
+
// dialogs compose them with the shared YamlEditor.
|
|
7
|
+
|
|
8
|
+
export { YamlEditor } from "./YamlEditor.js";
|
|
9
|
+
export type { YamlEditorProps } from "./YamlEditor.js";
|
|
10
|
+
|
|
11
|
+
export { useEditResourceYaml } from "./useEditResourceYaml.js";
|
|
12
|
+
export type {
|
|
13
|
+
EditYamlTarget,
|
|
14
|
+
EditYamlValidation,
|
|
15
|
+
UseEditResourceYamlOptions,
|
|
16
|
+
UseEditResourceYamlReturn,
|
|
17
|
+
} from "./useEditResourceYaml.js";
|
|
18
|
+
|
|
19
|
+
export { useApplyManifest } from "./useApplyManifest.js";
|
|
20
|
+
export type {
|
|
21
|
+
ManifestEntryStatus,
|
|
22
|
+
ManifestPreviewEntry,
|
|
23
|
+
UseApplyManifestReturn,
|
|
24
|
+
} from "./useApplyManifest.js";
|
|
25
|
+
|
|
26
|
+
export { EditResourceYamlDialog } from "./EditResourceYamlDialog.js";
|
|
27
|
+
export type { EditResourceYamlDialogProps } from "./EditResourceYamlDialog.js";
|
|
28
|
+
|
|
29
|
+
export { ApplyManifestDialog } from "./ApplyManifestDialog.js";
|
|
30
|
+
export type { ApplyManifestDialogProps } from "./ApplyManifestDialog.js";
|
|
31
|
+
|
|
32
|
+
export { RedactedSecretsNotice } from "./RedactedSecretsNotice.js";
|
|
33
|
+
export type { RedactedSecretsNoticeProps } from "./RedactedSecretsNotice.js";
|