@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,270 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
containsRedactedSecrets,
|
|
6
|
+
parseManifest,
|
|
7
|
+
type AppliedManifest,
|
|
8
|
+
type ManifestDocument,
|
|
9
|
+
} from "@stigmer/sdk";
|
|
10
|
+
import { useStigmer } from "../hooks.js";
|
|
11
|
+
import { toError } from "../internal/toError.js";
|
|
12
|
+
|
|
13
|
+
/** Per-document apply lifecycle within one manifest. */
|
|
14
|
+
export type ManifestEntryStatus =
|
|
15
|
+
| "pending"
|
|
16
|
+
| "applying"
|
|
17
|
+
| "applied"
|
|
18
|
+
| "failed"
|
|
19
|
+
/** A prior document failed; this one was not attempted. */
|
|
20
|
+
| "skipped";
|
|
21
|
+
|
|
22
|
+
/** One document of the manifest, with its preview and apply state. */
|
|
23
|
+
export interface ManifestPreviewEntry {
|
|
24
|
+
/** The parsed document (kind handler, message, name/slug/org). */
|
|
25
|
+
readonly document: ManifestDocument;
|
|
26
|
+
/** What applying will do, resolved against live server state. */
|
|
27
|
+
readonly action: "create" | "update" | "unknown";
|
|
28
|
+
/** Apply lifecycle status. */
|
|
29
|
+
readonly status: ManifestEntryStatus;
|
|
30
|
+
/** The applied resource, present when `status` is `"applied"`. */
|
|
31
|
+
readonly result?: AppliedManifest;
|
|
32
|
+
/** User-facing failure message, present when `status` is `"failed"`. */
|
|
33
|
+
readonly errorMessage?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Return value of {@link useApplyManifest}. */
|
|
37
|
+
export interface UseApplyManifestReturn {
|
|
38
|
+
/** Current manifest text (paste target). */
|
|
39
|
+
readonly content: string;
|
|
40
|
+
/** Update the manifest text. Re-validates (debounced). */
|
|
41
|
+
readonly setContent: (value: string) => void;
|
|
42
|
+
/** Read a `.yaml`/`.yml`/`.json` file into `content`. */
|
|
43
|
+
readonly readFile: (file: File) => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Validated per-document preview in dependency apply order, or `null`
|
|
46
|
+
* while the content is empty or invalid.
|
|
47
|
+
*/
|
|
48
|
+
readonly entries: readonly ManifestPreviewEntry[] | null;
|
|
49
|
+
/** Validation error for the current content, or `null` when valid. */
|
|
50
|
+
readonly validationError: string | null;
|
|
51
|
+
/** `true` while the (debounced) validation + existence checks run. */
|
|
52
|
+
readonly isValidating: boolean;
|
|
53
|
+
/** `true` when the content contains `***REDACTED***` secret markers. */
|
|
54
|
+
readonly hasRedactedSecrets: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Apply all documents sequentially in dependency order. Entries update
|
|
57
|
+
* live. Stops at the first failure (later entries become `"skipped"`).
|
|
58
|
+
* Resolves `true` when every document applied.
|
|
59
|
+
*/
|
|
60
|
+
readonly applyAll: () => Promise<boolean>;
|
|
61
|
+
/** `true` while applies are in flight. */
|
|
62
|
+
readonly isApplying: boolean;
|
|
63
|
+
/** Clear all state (content, preview, errors). */
|
|
64
|
+
readonly reset: () => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Validation parses + resolves existence server-side; wait for a typing pause.
|
|
68
|
+
const VALIDATE_DEBOUNCE_MS = 500;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Headless "apply a YAML manifest" flow for any registry-supported kind —
|
|
72
|
+
* the console counterpart of `stigmer apply -f`.
|
|
73
|
+
*
|
|
74
|
+
* Orchestrates: paste or upload → strict parse against generated proto
|
|
75
|
+
* schemas ({@link parseManifest}) → per-document create-vs-update preview
|
|
76
|
+
* (server existence check) → sequential apply in dependency order with
|
|
77
|
+
* live per-document status.
|
|
78
|
+
*
|
|
79
|
+
* Accepts multi-document manifests (`---` separators) and JSON content
|
|
80
|
+
* (YAML is a superset). The target `org` is injected into documents that
|
|
81
|
+
* omit `metadata.org`; documents naming a *different* org are honored and
|
|
82
|
+
* apply there (matching `stigmer apply` semantics — the org-mismatch
|
|
83
|
+
* warning surfaces on the parsed document).
|
|
84
|
+
*
|
|
85
|
+
* @param org - Target organization slug for `metadata.org` injection.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* const manifest = useApplyManifest(activeOrg);
|
|
90
|
+
*
|
|
91
|
+
* <textarea value={manifest.content}
|
|
92
|
+
* onChange={(e) => manifest.setContent(e.target.value)} />
|
|
93
|
+
* {manifest.entries?.map((e) => (
|
|
94
|
+
* <PreviewRow key={e.document.slug} entry={e} />
|
|
95
|
+
* ))}
|
|
96
|
+
* <button onClick={manifest.applyAll} disabled={!manifest.entries}>Apply</button>
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
99
|
+
* @see {@link ApplyManifestDialog} for the styled component composing this hook
|
|
100
|
+
* @see {@link useEditResourceYaml} for the edit-in-place counterpart
|
|
101
|
+
*/
|
|
102
|
+
export function useApplyManifest(org: string): UseApplyManifestReturn {
|
|
103
|
+
const stigmer = useStigmer();
|
|
104
|
+
|
|
105
|
+
const [content, setContentState] = useState("");
|
|
106
|
+
const [entries, setEntries] = useState<readonly ManifestPreviewEntry[] | null>(null);
|
|
107
|
+
const [validationError, setValidationError] = useState<string | null>(null);
|
|
108
|
+
const [isValidating, setIsValidating] = useState(false);
|
|
109
|
+
const [isApplying, setIsApplying] = useState(false);
|
|
110
|
+
|
|
111
|
+
const orgRef = useRef(org);
|
|
112
|
+
orgRef.current = org;
|
|
113
|
+
|
|
114
|
+
const setContent = useCallback((value: string) => {
|
|
115
|
+
setContentState(value);
|
|
116
|
+
}, []);
|
|
117
|
+
|
|
118
|
+
const readFile = useCallback(async (file: File) => {
|
|
119
|
+
let text: string;
|
|
120
|
+
try {
|
|
121
|
+
text = await file.text();
|
|
122
|
+
} catch {
|
|
123
|
+
setContentState("");
|
|
124
|
+
setEntries(null);
|
|
125
|
+
setValidationError(`Failed to read ${file.name}.`);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
setContentState(text);
|
|
129
|
+
}, []);
|
|
130
|
+
|
|
131
|
+
const reset = useCallback(() => {
|
|
132
|
+
setContentState("");
|
|
133
|
+
setEntries(null);
|
|
134
|
+
setValidationError(null);
|
|
135
|
+
setIsValidating(false);
|
|
136
|
+
setIsApplying(false);
|
|
137
|
+
}, []);
|
|
138
|
+
|
|
139
|
+
// Debounced validation + existence resolution, cancellation-safe. Applies
|
|
140
|
+
// freeze the preview: entries carry live statuses the validator must not
|
|
141
|
+
// clobber mid-run.
|
|
142
|
+
const validateSeq = useRef(0);
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (isApplying) return;
|
|
145
|
+
|
|
146
|
+
const seq = ++validateSeq.current;
|
|
147
|
+
|
|
148
|
+
if (!content.trim()) {
|
|
149
|
+
setEntries(null);
|
|
150
|
+
setValidationError(null);
|
|
151
|
+
setIsValidating(false);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
setIsValidating(true);
|
|
156
|
+
|
|
157
|
+
const timer = setTimeout(async () => {
|
|
158
|
+
let documents: ManifestDocument[];
|
|
159
|
+
try {
|
|
160
|
+
documents = parseManifest(content, { org: orgRef.current });
|
|
161
|
+
} catch (err) {
|
|
162
|
+
if (validateSeq.current === seq) {
|
|
163
|
+
setEntries(null);
|
|
164
|
+
setValidationError(toError(err).message);
|
|
165
|
+
setIsValidating(false);
|
|
166
|
+
}
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const resolved = await Promise.all(
|
|
171
|
+
documents.map(async (document): Promise<ManifestPreviewEntry> => {
|
|
172
|
+
let action: ManifestPreviewEntry["action"];
|
|
173
|
+
try {
|
|
174
|
+
const existing = await stigmer.manifest.getByReference(
|
|
175
|
+
document.handler.yamlKind,
|
|
176
|
+
document.org,
|
|
177
|
+
document.slug,
|
|
178
|
+
);
|
|
179
|
+
action = existing !== null ? "update" : "create";
|
|
180
|
+
} catch {
|
|
181
|
+
action = "unknown";
|
|
182
|
+
}
|
|
183
|
+
return { document, action, status: "pending" };
|
|
184
|
+
}),
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
if (validateSeq.current === seq) {
|
|
188
|
+
setEntries(resolved);
|
|
189
|
+
setValidationError(null);
|
|
190
|
+
setIsValidating(false);
|
|
191
|
+
}
|
|
192
|
+
}, VALIDATE_DEBOUNCE_MS);
|
|
193
|
+
|
|
194
|
+
return () => clearTimeout(timer);
|
|
195
|
+
}, [content, stigmer, isApplying]);
|
|
196
|
+
|
|
197
|
+
const applyAll = useCallback(async (): Promise<boolean> => {
|
|
198
|
+
if (!entries || entries.length === 0) return false;
|
|
199
|
+
|
|
200
|
+
// Invalidate any in-flight validation so it cannot clobber apply statuses.
|
|
201
|
+
validateSeq.current++;
|
|
202
|
+
setIsApplying(true);
|
|
203
|
+
|
|
204
|
+
// Local working copy — React state is updated per transition so the
|
|
205
|
+
// dialog renders progress live.
|
|
206
|
+
const working = entries.map((entry): ManifestPreviewEntry => ({ ...entry, status: "pending" }));
|
|
207
|
+
const commit = () => setEntries([...working]);
|
|
208
|
+
|
|
209
|
+
let allApplied = true;
|
|
210
|
+
|
|
211
|
+
for (let i = 0; i < working.length; i++) {
|
|
212
|
+
if (!allApplied) {
|
|
213
|
+
working[i] = { ...working[i], status: "skipped" };
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
working[i] = { ...working[i], status: "applying" };
|
|
218
|
+
commit();
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
const result = await stigmer.manifest.apply(working[i].document);
|
|
222
|
+
working[i] = { ...working[i], status: "applied", result };
|
|
223
|
+
} catch (err) {
|
|
224
|
+
working[i] = {
|
|
225
|
+
...working[i],
|
|
226
|
+
status: "failed",
|
|
227
|
+
errorMessage: toError(err).message,
|
|
228
|
+
};
|
|
229
|
+
allApplied = false;
|
|
230
|
+
}
|
|
231
|
+
commit();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
commit();
|
|
235
|
+
setIsApplying(false);
|
|
236
|
+
return allApplied;
|
|
237
|
+
}, [entries, stigmer]);
|
|
238
|
+
|
|
239
|
+
const hasRedactedSecrets = useMemo(
|
|
240
|
+
() => containsRedactedSecrets(content),
|
|
241
|
+
[content],
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
return useMemo(
|
|
245
|
+
() => ({
|
|
246
|
+
content,
|
|
247
|
+
setContent,
|
|
248
|
+
readFile,
|
|
249
|
+
entries,
|
|
250
|
+
validationError,
|
|
251
|
+
isValidating,
|
|
252
|
+
hasRedactedSecrets,
|
|
253
|
+
applyAll,
|
|
254
|
+
isApplying,
|
|
255
|
+
reset,
|
|
256
|
+
}),
|
|
257
|
+
[
|
|
258
|
+
content,
|
|
259
|
+
setContent,
|
|
260
|
+
readFile,
|
|
261
|
+
entries,
|
|
262
|
+
validationError,
|
|
263
|
+
isValidating,
|
|
264
|
+
hasRedactedSecrets,
|
|
265
|
+
applyAll,
|
|
266
|
+
isApplying,
|
|
267
|
+
reset,
|
|
268
|
+
],
|
|
269
|
+
);
|
|
270
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
5
|
+
import {
|
|
6
|
+
containsRedactedSecrets,
|
|
7
|
+
parseManifest,
|
|
8
|
+
serializeManifest,
|
|
9
|
+
type AppliedManifest,
|
|
10
|
+
type ManifestDocument,
|
|
11
|
+
} from "@stigmer/sdk";
|
|
12
|
+
import { useStigmer } from "../hooks.js";
|
|
13
|
+
import { toError } from "../internal/toError.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Result of validating the edited YAML against the source resource.
|
|
17
|
+
*
|
|
18
|
+
* Discriminated on `status` so consumers can render exactly one of:
|
|
19
|
+
* a disabled state (`empty`), an inline error (`invalid`), or the
|
|
20
|
+
* apply affordance (`valid`).
|
|
21
|
+
*/
|
|
22
|
+
export type EditYamlValidation =
|
|
23
|
+
| { readonly status: "empty" }
|
|
24
|
+
| { readonly status: "invalid"; readonly message: string }
|
|
25
|
+
| { readonly status: "valid"; readonly document: ManifestDocument };
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* What applying the current content will do — resolved against live
|
|
29
|
+
* server state so renames surface as "create" before the user commits.
|
|
30
|
+
*/
|
|
31
|
+
export type EditYamlTarget =
|
|
32
|
+
| { readonly action: "update"; readonly slug: string }
|
|
33
|
+
| { readonly action: "create"; readonly slug: string }
|
|
34
|
+
/** Existence lookup failed (offline, permissions) — wording degrades. */
|
|
35
|
+
| { readonly action: "unknown"; readonly slug: string };
|
|
36
|
+
|
|
37
|
+
/** Options for {@link useEditResourceYaml}. */
|
|
38
|
+
export interface UseEditResourceYamlOptions {
|
|
39
|
+
/**
|
|
40
|
+
* The resource to edit, as returned by the server (e.g. from `useAgent`
|
|
41
|
+
* or a list panel row). `null` while the resource is loading — the hook
|
|
42
|
+
* seeds the editor when it arrives.
|
|
43
|
+
*/
|
|
44
|
+
readonly resource: Message | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Return value of {@link useEditResourceYaml}. */
|
|
48
|
+
export interface UseEditResourceYamlReturn {
|
|
49
|
+
/** Current editor content. */
|
|
50
|
+
readonly yaml: string;
|
|
51
|
+
/** Update the editor content (wire to the YAML editor's `onChange`). */
|
|
52
|
+
readonly setYaml: (value: string) => void;
|
|
53
|
+
/** `true` when the content differs from the seeded serialization. */
|
|
54
|
+
readonly isDirty: boolean;
|
|
55
|
+
/** Live validation of the current content. */
|
|
56
|
+
readonly validation: EditYamlValidation;
|
|
57
|
+
/**
|
|
58
|
+
* Create-vs-update preview for the current content, or `null` while
|
|
59
|
+
* validation fails or the existence check is in flight.
|
|
60
|
+
*/
|
|
61
|
+
readonly target: EditYamlTarget | null;
|
|
62
|
+
/** `true` when the content contains `***REDACTED***` secret markers. */
|
|
63
|
+
readonly hasRedactedSecrets: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Apply the edited YAML. Resolves with the applied resource, or `null`
|
|
66
|
+
* when the content is not currently valid (check `validation`).
|
|
67
|
+
*/
|
|
68
|
+
readonly apply: () => Promise<AppliedManifest | null>;
|
|
69
|
+
/** `true` while the apply RPC is in flight. */
|
|
70
|
+
readonly isApplying: boolean;
|
|
71
|
+
/** Error from the last failed apply, or `null` when healthy. */
|
|
72
|
+
readonly error: Error | null;
|
|
73
|
+
/** Clear the apply error (e.g. when the user edits again). */
|
|
74
|
+
readonly clearError: () => void;
|
|
75
|
+
/** Discard edits and reseed from the resource. */
|
|
76
|
+
readonly reset: () => void;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Existence checks run against live server state; wait for a typing pause.
|
|
80
|
+
const TARGET_CHECK_DEBOUNCE_MS = 400;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Behavior hook for editing an existing resource as YAML and applying the
|
|
84
|
+
* result — the console's kind-agnostic "Edit YAML" flow.
|
|
85
|
+
*
|
|
86
|
+
* Seeds the editor from {@link serializeManifest} (full fidelity minus
|
|
87
|
+
* system-managed state), validates every edit against the kind's generated
|
|
88
|
+
* proto schema via {@link parseManifest} (strict — unknown fields fail
|
|
89
|
+
* loudly), previews create-vs-update by resolving the edited document's
|
|
90
|
+
* reference against the server, and applies through
|
|
91
|
+
* `stigmer.manifest.apply()`.
|
|
92
|
+
*
|
|
93
|
+
* Guardrails beyond the raw engine:
|
|
94
|
+
* - the edited document must stay the same kind as the source resource
|
|
95
|
+
* (pasting an Environment into an Agent editor is an error, not an apply)
|
|
96
|
+
* - the edited manifest must contain exactly one document
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* const edit = useEditResourceYaml({ resource: agent });
|
|
101
|
+
*
|
|
102
|
+
* <YamlEditor value={edit.yaml} onChange={edit.setYaml} />
|
|
103
|
+
* {edit.validation.status === "invalid" && <p>{edit.validation.message}</p>}
|
|
104
|
+
* <button disabled={edit.validation.status !== "valid"} onClick={edit.apply}>
|
|
105
|
+
* {edit.target?.action === "create" ? "Create" : "Apply changes"}
|
|
106
|
+
* </button>
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @see {@link EditResourceYamlDialog} for the styled component composing this hook
|
|
110
|
+
* @see {@link useApplyManifest} for the paste/upload counterpart
|
|
111
|
+
*/
|
|
112
|
+
export function useEditResourceYaml({
|
|
113
|
+
resource,
|
|
114
|
+
}: UseEditResourceYamlOptions): UseEditResourceYamlReturn {
|
|
115
|
+
const stigmer = useStigmer();
|
|
116
|
+
|
|
117
|
+
// The serialized source of truth. Recomputed when the resource changes;
|
|
118
|
+
// only reseeds the editor while the user hasn't started editing.
|
|
119
|
+
const seeded = useMemo(
|
|
120
|
+
() => (resource ? serializeManifest(resource) : ""),
|
|
121
|
+
[resource],
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const [yaml, setYamlState] = useState(seeded);
|
|
125
|
+
const [isDirty, setIsDirty] = useState(false);
|
|
126
|
+
const [isApplying, setIsApplying] = useState(false);
|
|
127
|
+
const [error, setError] = useState<Error | null>(null);
|
|
128
|
+
const [target, setTarget] = useState<EditYamlTarget | null>(null);
|
|
129
|
+
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (!isDirty) setYamlState(seeded);
|
|
132
|
+
}, [seeded, isDirty]);
|
|
133
|
+
|
|
134
|
+
const setYaml = useCallback(
|
|
135
|
+
(value: string) => {
|
|
136
|
+
setYamlState(value);
|
|
137
|
+
setIsDirty(value !== seeded);
|
|
138
|
+
},
|
|
139
|
+
[seeded],
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const reset = useCallback(() => {
|
|
143
|
+
setYamlState(seeded);
|
|
144
|
+
setIsDirty(false);
|
|
145
|
+
setError(null);
|
|
146
|
+
}, [seeded]);
|
|
147
|
+
|
|
148
|
+
const clearError = useCallback(() => setError(null), []);
|
|
149
|
+
|
|
150
|
+
const sourceKind = useMemo(() => {
|
|
151
|
+
if (!resource) return null;
|
|
152
|
+
// The seeded YAML's kind is authoritative for the source resource; a
|
|
153
|
+
// parse of our own serialization cannot fail.
|
|
154
|
+
return seeded ? parseManifest(seeded)[0].handler.yamlKind : null;
|
|
155
|
+
}, [resource, seeded]);
|
|
156
|
+
|
|
157
|
+
const validation = useMemo<EditYamlValidation>(() => {
|
|
158
|
+
if (!yaml.trim()) return { status: "empty" };
|
|
159
|
+
|
|
160
|
+
let documents: ManifestDocument[];
|
|
161
|
+
try {
|
|
162
|
+
documents = parseManifest(yaml);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
return { status: "invalid", message: toError(err).message };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (documents.length > 1) {
|
|
168
|
+
return {
|
|
169
|
+
status: "invalid",
|
|
170
|
+
message:
|
|
171
|
+
"This editor applies a single resource. Remove the extra " +
|
|
172
|
+
"documents, or use Apply YAML in the Library for multi-document manifests.",
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const document = documents[0];
|
|
177
|
+
if (sourceKind !== null && document.handler.yamlKind !== sourceKind) {
|
|
178
|
+
return {
|
|
179
|
+
status: "invalid",
|
|
180
|
+
message:
|
|
181
|
+
`The document's kind changed from ${sourceKind} to ` +
|
|
182
|
+
`${document.handler.yamlKind}. To apply a different resource kind, ` +
|
|
183
|
+
"use Apply YAML in the Library instead.",
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return { status: "valid", document };
|
|
188
|
+
}, [yaml, sourceKind]);
|
|
189
|
+
|
|
190
|
+
// Resolve create-vs-update against live state whenever the content
|
|
191
|
+
// becomes valid, debounced across keystrokes and cancellation-safe.
|
|
192
|
+
const checkSeq = useRef(0);
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (validation.status !== "valid") {
|
|
195
|
+
setTarget(null);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const { document } = validation;
|
|
200
|
+
const seq = ++checkSeq.current;
|
|
201
|
+
setTarget(null);
|
|
202
|
+
|
|
203
|
+
const timer = setTimeout(async () => {
|
|
204
|
+
let action: EditYamlTarget["action"];
|
|
205
|
+
try {
|
|
206
|
+
const existing = await stigmer.manifest.getByReference(
|
|
207
|
+
document.handler.yamlKind,
|
|
208
|
+
document.org,
|
|
209
|
+
document.slug,
|
|
210
|
+
);
|
|
211
|
+
action = existing !== null ? "update" : "create";
|
|
212
|
+
} catch {
|
|
213
|
+
action = "unknown";
|
|
214
|
+
}
|
|
215
|
+
if (checkSeq.current === seq) {
|
|
216
|
+
setTarget({ action, slug: document.slug });
|
|
217
|
+
}
|
|
218
|
+
}, TARGET_CHECK_DEBOUNCE_MS);
|
|
219
|
+
|
|
220
|
+
return () => clearTimeout(timer);
|
|
221
|
+
}, [validation, stigmer]);
|
|
222
|
+
|
|
223
|
+
const apply = useCallback(async (): Promise<AppliedManifest | null> => {
|
|
224
|
+
if (validation.status !== "valid") return null;
|
|
225
|
+
|
|
226
|
+
setIsApplying(true);
|
|
227
|
+
setError(null);
|
|
228
|
+
try {
|
|
229
|
+
const applied = await stigmer.manifest.apply(validation.document);
|
|
230
|
+
setIsDirty(false);
|
|
231
|
+
return applied;
|
|
232
|
+
} catch (err) {
|
|
233
|
+
setError(toError(err));
|
|
234
|
+
throw err;
|
|
235
|
+
} finally {
|
|
236
|
+
setIsApplying(false);
|
|
237
|
+
}
|
|
238
|
+
}, [validation, stigmer]);
|
|
239
|
+
|
|
240
|
+
const hasRedactedSecrets = useMemo(
|
|
241
|
+
() => containsRedactedSecrets(yaml),
|
|
242
|
+
[yaml],
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
return useMemo(
|
|
246
|
+
() => ({
|
|
247
|
+
yaml,
|
|
248
|
+
setYaml,
|
|
249
|
+
isDirty,
|
|
250
|
+
validation,
|
|
251
|
+
target,
|
|
252
|
+
hasRedactedSecrets,
|
|
253
|
+
apply,
|
|
254
|
+
isApplying,
|
|
255
|
+
error,
|
|
256
|
+
clearError,
|
|
257
|
+
reset,
|
|
258
|
+
}),
|
|
259
|
+
[
|
|
260
|
+
yaml,
|
|
261
|
+
setYaml,
|
|
262
|
+
isDirty,
|
|
263
|
+
validation,
|
|
264
|
+
target,
|
|
265
|
+
hasRedactedSecrets,
|
|
266
|
+
apply,
|
|
267
|
+
isApplying,
|
|
268
|
+
error,
|
|
269
|
+
clearError,
|
|
270
|
+
reset,
|
|
271
|
+
],
|
|
272
|
+
);
|
|
273
|
+
}
|
|
@@ -407,10 +407,14 @@ export function McpServerDetailView({
|
|
|
407
407
|
updatedAt: specAudit?.updatedAt ? timestampDate(specAudit.updatedAt) : null,
|
|
408
408
|
};
|
|
409
409
|
|
|
410
|
-
// Inline visibility is
|
|
411
|
-
//
|
|
410
|
+
// Inline visibility is at-a-glance AND a shortcut into the Manage access
|
|
411
|
+
// dialog — the single writer for both access axes. The chip is navigation
|
|
412
|
+
// only; it stays a static badge for users who cannot view access.
|
|
412
413
|
const visibilityControl = meta ? (
|
|
413
|
-
<VisibilityBadge
|
|
414
|
+
<VisibilityBadge
|
|
415
|
+
visibility={meta.visibility}
|
|
416
|
+
onClick={access.action ? access.open : undefined}
|
|
417
|
+
/>
|
|
414
418
|
) : undefined;
|
|
415
419
|
|
|
416
420
|
const mergedActions = access.action
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { cn } from "@stigmer/theme";
|
|
5
|
-
import { getUserMessage } from "@stigmer/sdk";
|
|
5
|
+
import { buildMcpServerProto, getUserMessage, serializeManifest } from "@stigmer/sdk";
|
|
6
6
|
import type { McpServerInput } from "@stigmer/sdk";
|
|
7
|
-
import { serializeMcpServerInputYaml } from "../../library/serialize-resource-yaml.js";
|
|
8
7
|
import type { McpServerWizardData } from "./types.js";
|
|
9
8
|
|
|
10
9
|
/** Props for {@link ReviewStep}. */
|
|
@@ -33,7 +32,7 @@ export function ReviewStep({
|
|
|
33
32
|
[org, data],
|
|
34
33
|
);
|
|
35
34
|
const yamlPreview = useMemo(
|
|
36
|
-
() =>
|
|
35
|
+
() => serializeManifest(buildMcpServerProto(mcpServerInput)),
|
|
37
36
|
[mcpServerInput],
|
|
38
37
|
);
|
|
39
38
|
|
|
@@ -122,7 +122,7 @@ spec:
|
|
|
122
122
|
- name: extract_findings
|
|
123
123
|
kind: llm_call
|
|
124
124
|
task_config:
|
|
125
|
-
model: "
|
|
125
|
+
model: "claude-haiku-4.5"
|
|
126
126
|
system_prompt: "Extract structured key findings from the analysis."
|
|
127
127
|
prompt: >
|
|
128
128
|
Extract the key findings from this analysis as structured data:
|
|
@@ -280,7 +280,7 @@ spec:
|
|
|
280
280
|
- name: classify_ticket
|
|
281
281
|
kind: llm_call
|
|
282
282
|
task_config:
|
|
283
|
-
model: "
|
|
283
|
+
model: "claude-haiku-4.5"
|
|
284
284
|
system_prompt: >
|
|
285
285
|
You are a support ticket classifier. Analyze the ticket and classify
|
|
286
286
|
it by severity and category. Be conservative with critical/high
|
|
@@ -923,7 +923,7 @@ spec:
|
|
|
923
923
|
- name: diagnose_error
|
|
924
924
|
kind: llm_call
|
|
925
925
|
task_config:
|
|
926
|
-
model: "
|
|
926
|
+
model: "claude-haiku-4.5"
|
|
927
927
|
system_prompt: >
|
|
928
928
|
You are an API integration specialist. Given an error from
|
|
929
929
|
an HTTP call, provide a brief, actionable diagnosis.
|
|
@@ -1010,7 +1010,7 @@ spec:
|
|
|
1010
1010
|
description: "Comma-separated list of topics the response should cover"
|
|
1011
1011
|
optional: true
|
|
1012
1012
|
MODEL_UNDER_TEST:
|
|
1013
|
-
description: "Model to evaluate (default:
|
|
1013
|
+
description: "Model to evaluate (default: claude-haiku-4.5)"
|
|
1014
1014
|
optional: true
|
|
1015
1015
|
budget:
|
|
1016
1016
|
max_cost_micros: 2000000
|
|
@@ -817,7 +817,13 @@ const ConversationColumn = memo(function ConversationColumn({
|
|
|
817
817
|
// a plan read-only in the panel remains — reading is the point.
|
|
818
818
|
onRetrySend={isObserver ? undefined : conv.retryLastSend}
|
|
819
819
|
onRetryExecution={isObserver ? undefined : onRetryExecution}
|
|
820
|
-
|
|
820
|
+
// Approval mechanics are an OPERATOR surface, never a guest's
|
|
821
|
+
// (DD-014): the HITL gate protects the org's tools, and an anonymous
|
|
822
|
+
// visitor is not its trustee. Guest executions run unattended
|
|
823
|
+
// (gated tools auto-skip server-side), so nothing is ever pending on
|
|
824
|
+
// a new execution — withholding the callback is the belt-and-braces
|
|
825
|
+
// for pre-existing sessions and embedders composing the SDK directly.
|
|
826
|
+
onApprovalSubmit={isObserver || isGuest ? undefined : flow.submitApproval}
|
|
821
827
|
submittingApprovalIds={conv.submittingApprovalIds}
|
|
822
828
|
approvalErrors={conv.approvalErrors}
|
|
823
829
|
showFileReviewRecords
|
|
@@ -35,8 +35,12 @@ vi.mock("../facets/SetupTab", () => ({
|
|
|
35
35
|
},
|
|
36
36
|
}));
|
|
37
37
|
|
|
38
|
+
const threadProps: CapturedProps[] = [];
|
|
38
39
|
vi.mock("../../execution/MessageThread", () => ({
|
|
39
|
-
MessageThread: () =>
|
|
40
|
+
MessageThread: (props: CapturedProps) => {
|
|
41
|
+
threadProps.push(props);
|
|
42
|
+
return <div data-testid="thread-probe" />;
|
|
43
|
+
},
|
|
40
44
|
}));
|
|
41
45
|
|
|
42
46
|
// ---------------------------------------------------------------------------
|
|
@@ -93,6 +97,7 @@ const stubConv = {
|
|
|
93
97
|
isSending: false,
|
|
94
98
|
sendError: null,
|
|
95
99
|
clearSendError: vi.fn(),
|
|
100
|
+
retryLastSend: vi.fn(),
|
|
96
101
|
pendingUserMessage: null,
|
|
97
102
|
workspaceEntries: [],
|
|
98
103
|
mcpServerUsages: [],
|
|
@@ -159,6 +164,11 @@ function lastComposerProps(): CapturedProps {
|
|
|
159
164
|
return composerProps.at(-1)!;
|
|
160
165
|
}
|
|
161
166
|
|
|
167
|
+
function lastThreadProps(): CapturedProps {
|
|
168
|
+
expect(threadProps.length).toBeGreaterThan(0);
|
|
169
|
+
return threadProps.at(-1)!;
|
|
170
|
+
}
|
|
171
|
+
|
|
162
172
|
/**
|
|
163
173
|
* Reach the Config facet through the unified panel: expand it via the
|
|
164
174
|
* top-right chip, pick Config in the rail, and return the props the (mocked)
|
|
@@ -174,6 +184,7 @@ function openedConfigFacet(): { mutations?: unknown } {
|
|
|
174
184
|
beforeEach(() => {
|
|
175
185
|
composerProps.length = 0;
|
|
176
186
|
setupTabProps.length = 0;
|
|
187
|
+
threadProps.length = 0;
|
|
177
188
|
stubSessionPageFlow.submitError = null;
|
|
178
189
|
});
|
|
179
190
|
|
|
@@ -375,6 +386,25 @@ describe("SessionViewer — audience wiring", () => {
|
|
|
375
386
|
);
|
|
376
387
|
});
|
|
377
388
|
|
|
389
|
+
it("guest: approval mechanics are withheld from the thread (DD-014)", () => {
|
|
390
|
+
// The HITL gate protects the ORG's tools; an anonymous visitor is not
|
|
391
|
+
// its trustee. Guest executions run unattended server-side, so nothing
|
|
392
|
+
// is ever pending on a new execution — withholding the callback is the
|
|
393
|
+
// belt-and-braces for pre-existing sessions and direct SDK embedders.
|
|
394
|
+
render(<SessionViewer sessionId="ses_1" org="acme" audience="guest" />);
|
|
395
|
+
|
|
396
|
+
const props = lastThreadProps();
|
|
397
|
+
expect(props.onApprovalSubmit).toBeUndefined();
|
|
398
|
+
// Chat interaction survives — a guest owns their own conversation.
|
|
399
|
+
expect(props.onRetrySend).toBeDefined();
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
it("integrator: approvals stay wired on the thread", () => {
|
|
403
|
+
render(<SessionViewer sessionId="ses_1" org="acme" />);
|
|
404
|
+
|
|
405
|
+
expect(lastThreadProps().onApprovalSubmit).toBeDefined();
|
|
406
|
+
});
|
|
407
|
+
|
|
378
408
|
it("forwards getRuntimeEnv to the flow", () => {
|
|
379
409
|
const getRuntimeEnv = vi.fn();
|
|
380
410
|
render(
|