@sim-design/training 1.0.0 → 1.1.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/README.md +481 -15
- package/dist/{ArrowLeftOutlined-CiSQq3bL.js → ArrowLeftOutlined-BxA84GXs.js} +1 -1
- package/dist/ArrowLeftOutlined-D785XjyB.js +12 -0
- package/dist/{AssessmentPlugin-Bx4VrBdV.js → AssessmentPlugin-D_iesmyg.js} +7 -7
- package/dist/AssessmentPlugin-zRr-IsdA.js +607 -0
- package/dist/CaseAnalysisPlugin-CXuQpkPd.js +2196 -0
- package/dist/CaseAnalysisPlugin-DytlXsRD.js +2196 -0
- package/dist/CaseDetailContent-DT5nCtRT.js +28613 -0
- package/dist/CaseDetailContent-Y7Q430MG.js +28595 -0
- package/dist/{CharacterDialoguePanel-Bvdab3qj.js → CharacterDialoguePanel-CdtUl-Sv.js} +178 -139
- package/dist/CharacterDialoguePanel-D_4YNFZv.js +815 -0
- package/dist/{CheckCircleFilled-Byo8CDfW.js → CheckCircleFilled-CnslIY7j.js} +1 -1
- package/dist/CheckCircleFilled-NvZaC2sk.js +12 -0
- package/dist/DecisionMakingPlugin-B_KQUFzW.js +1385 -0
- package/dist/DecisionMakingPlugin-ILLGek3S.js +1385 -0
- package/dist/{DecisionSelectPlugin-DtQ2KV34.js → DecisionSelectPlugin-BGQiHGBK.js} +20 -11
- package/dist/DecisionSelectPlugin-Bqmh6XGh.js +872 -0
- package/dist/{DecisionShared-Dh9oeQFT.js → DecisionShared-BHq1lEqt.js} +2 -2
- package/dist/DecisionShared-Be-zKZLT.js +65 -0
- package/dist/DeleteOutlined-BvMjU7m5.js +12 -0
- package/dist/DeleteOutlined-Dqy6M2LH.js +12 -0
- package/dist/{CustomLayoutRenderer--rnQrqQ2.js → DialogueFormPlugin-BpCeFadt.js} +22724 -21631
- package/dist/DialogueFormPlugin-CXlbxX-z.js +123617 -0
- package/dist/DialoguePlugin-CO7Nzv0K.js +596 -0
- package/dist/DialoguePlugin-DDNdsylz.js +596 -0
- package/dist/DocumentReviewPlugin-2CnKQwVG.js +1967 -0
- package/dist/DocumentReviewPlugin-qYYrnjvE.js +1967 -0
- package/dist/{EyeOutlined-XvOAKlLs.js → EyeOutlined-BrKCNjui.js} +1 -1
- package/dist/EyeOutlined-CW0tYV0f.js +12 -0
- package/dist/FormFillingPlugin-C3h8ySOZ.js +969 -0
- package/dist/FormFillingPlugin-CPmd76Qr.js +969 -0
- package/dist/HolderOutlined-CH0tShWu.js +12 -0
- package/dist/HolderOutlined-Dm6TBtqf.js +12 -0
- package/dist/ModelEditor-BjEbFloQ.js +11753 -0
- package/dist/ModelEditor-CwR67DFQ.js +11753 -0
- package/dist/{ProcessOperationPlugin-IijngDlX.js → ProcessOperationPlugin-1Lz431aC.js} +12 -12
- package/dist/ProcessOperationPlugin-BkmdG3ch.js +88 -0
- package/dist/QAPlugin-0C4kpq3J.js +172 -0
- package/dist/QAPlugin-UC8uywcg.js +172 -0
- package/dist/{ReloadOutlined-Daor2m11.js → ReloadOutlined-BZ92nlYF.js} +1 -1
- package/dist/ReloadOutlined-CYoPOwLl.js +12 -0
- package/dist/{SettingOutlined-CLEOgXB-.js → SettingOutlined-F466s0Ti.js} +33 -65
- package/dist/SettingOutlined-c2hikCfN.js +60 -0
- package/dist/StarFilled-Bilmj6UK.js +28 -0
- package/dist/StarFilled-CtH30fL0.js +28 -0
- package/dist/StrategyLabPlugin-CvO07sXV.js +12445 -0
- package/dist/StrategyLabPlugin-DUqZYctQ.js +12445 -0
- package/dist/ThunderboltOutlined-BpmoCKdV.js +28 -0
- package/dist/ThunderboltOutlined-DDQFi5Cv.js +28 -0
- package/dist/TrainingModelContainer-DqCsdC7C.js +11241 -0
- package/dist/TrainingModelContainer-yi8W6KFl.js +11241 -0
- package/dist/{UndoOutlined-ChUQYUul.js → UndoOutlined-6JZVzmdX.js} +26 -42
- package/dist/UndoOutlined-Dw6_9_OL.js +68 -0
- package/dist/{WarningFilled-1Rc4hr0C.js → WarningFilled-Cy1tvuQy.js} +1 -1
- package/dist/WarningFilled-lkr453eh.js +12 -0
- package/dist/{adapters-D1FFZFoA.js → adapters-BbCnXSYo.js} +2 -2
- package/dist/{analysisTools-CXyOvSZT.js → analysisTools-Cp5-3DaU.js} +59 -12
- package/dist/creator.js +4 -2
- package/dist/designTokens-walF_QkZ.js +23 -0
- package/dist/images/healthcare/bg.jpg +0 -0
- package/dist/{index-CYjdXPgc.js → index-C71iHgSs.js} +2640 -2722
- package/dist/{index-XuBVjlmu.js → index-CBvqcbIU.js} +7214 -7643
- package/dist/index-D94YNWTb.js +433 -0
- package/dist/index-DSYmOXnQ.js +6486 -0
- package/dist/index-fP97rKeQ.js +433 -0
- package/dist/index.js +8 -6
- package/dist/judgement-xTGXlDcn.js +29 -0
- package/dist/runtime.js +1 -1
- package/dist/sortable.esm-bm_c5vmI.js +3307 -0
- package/dist/types.js +1 -1
- package/dist/useDialogueLogic-D1lkUKUZ.js +576 -0
- package/dist/useDialogueLogic-vOJ9XRNP.js +576 -0
- package/dist-types/client/src/admin/CaseDataEditor.d.ts +20 -0
- package/dist-types/client/src/admin/CaseEditor.d.ts +19 -0
- package/dist-types/client/src/admin/DialogueFormCheckRulesEditor.d.ts +11 -0
- package/dist-types/client/src/admin/DialogueFormInitDataEditor.d.ts +31 -0
- package/dist-types/client/src/admin/InitDataEditors.d.ts +7 -0
- package/dist-types/client/src/admin/ModelEditor.d.ts +11 -0
- package/dist-types/client/src/admin/ModelPreview.d.ts +13 -0
- package/dist-types/client/src/admin/OptionSelector.d.ts +32 -0
- package/dist-types/client/src/admin/StageStepEditor.d.ts +20 -0
- package/dist-types/client/src/admin/StepAnswerKeyEditor.d.ts +19 -0
- package/dist-types/client/src/admin/StepByStepCreator.d.ts +27 -0
- package/dist-types/client/src/admin/components/AbilityMapEditor.d.ts +12 -0
- package/dist-types/client/src/admin/components/CasePreview.d.ts +8 -0
- package/dist-types/client/src/admin/components/StepAbilitySelector.d.ts +9 -0
- package/dist-types/client/src/admin/constants/creatorConstants.d.ts +39 -0
- package/dist-types/client/src/admin/editors/CaseAnalysisEditor.d.ts +11 -0
- package/dist-types/client/src/admin/editors/DecisionMakingEditor.d.ts +7 -0
- package/dist-types/client/src/admin/editors/DialogueEditor.d.ts +12 -0
- package/dist-types/client/src/admin/editors/DocumentReviewEditor.d.ts +7 -0
- package/dist-types/client/src/admin/editors/DocumentReviewRuntimeRulesEditor.d.ts +15 -0
- package/dist-types/client/src/admin/editors/FormFillingEditor.d.ts +33 -0
- package/dist-types/client/src/admin/editors/ModelUIConfigEditor.d.ts +5 -0
- package/dist-types/client/src/admin/editors/QAEditor.d.ts +6 -0
- package/dist-types/client/src/admin/editors/RouterEditors.d.ts +18 -0
- package/dist-types/client/src/admin/editors/StepBriefingEditor.d.ts +14 -0
- package/dist-types/client/src/admin/editors/StrategyLabEditor.d.ts +24 -0
- package/dist-types/client/src/admin/editors/decisionEditorParts.d.ts +18 -0
- package/dist-types/client/src/admin/editors/index.d.ts +8 -0
- package/dist-types/client/src/admin/editors/shared.d.ts +17 -0
- package/dist-types/client/src/admin/hooks/useStep1Intent.d.ts +16 -0
- package/dist-types/client/src/admin/hooks/useStep2Outline.d.ts +41 -0
- package/dist-types/client/src/admin/hooks/useStep3Details.d.ts +123 -0
- package/dist-types/client/src/admin/hooks/useStep4Cases.d.ts +48 -0
- package/dist-types/client/src/admin/hooks/useStep5Validation.d.ts +16 -0
- package/dist-types/client/src/admin/landingValidation.d.ts +74 -0
- package/dist-types/client/src/admin/schemaFieldUtils.d.ts +55 -0
- package/dist-types/client/src/admin/services.d.ts +461 -0
- package/dist-types/client/src/admin/shared-editors.d.ts +31 -0
- package/dist-types/client/src/admin/types/creatorArtifacts.d.ts +140 -0
- package/dist-types/client/src/components/AbilityMapView.d.ts +15 -0
- package/dist-types/client/src/components/CaseDetail/CaseDetailContent.d.ts +12 -0
- package/dist-types/client/src/components/ConversationalDataCollector/IntentConfirmPanel.d.ts +20 -0
- package/dist-types/client/src/components/ConversationalDataCollector/index.d.ts +7 -0
- package/dist-types/client/src/components/ConversationalDataCollector/intentState.d.ts +24 -0
- package/dist-types/client/src/components/ConversationalDataCollector/types.d.ts +95 -0
- package/dist-types/client/src/components/ConversationalDataCollector/utils.d.ts +62 -0
- package/dist-types/client/src/components/CustomLayoutRenderer.d.ts +8 -0
- package/dist-types/client/src/components/MarkdownRenderer.d.ts +15 -0
- package/dist-types/client/src/components/StrategyLabScene/VisualInputComponents.d.ts +85 -0
- package/dist-types/client/src/components/StrategyLabScene/components/AdversarialView.d.ts +18 -0
- package/dist-types/client/src/components/StrategyLabScene/components/BottomBar.d.ts +22 -0
- package/dist-types/client/src/components/StrategyLabScene/components/CharacterCard.d.ts +14 -0
- package/dist-types/client/src/components/StrategyLabScene/components/CharacterDialoguePanel.d.ts +32 -0
- package/dist-types/client/src/components/StrategyLabScene/components/CollaborativeView.d.ts +20 -0
- package/dist-types/client/src/components/StrategyLabScene/components/ComparisonView.d.ts +16 -0
- package/dist-types/client/src/components/StrategyLabScene/components/DecisionInput.d.ts +27 -0
- package/dist-types/client/src/components/StrategyLabScene/components/DecisionSwitcher.d.ts +14 -0
- package/dist-types/client/src/components/StrategyLabScene/components/EvaluationReport.d.ts +13 -0
- package/dist-types/client/src/components/StrategyLabScene/components/NodeChainPanels.d.ts +32 -0
- package/dist-types/client/src/components/StrategyLabScene/components/ProgressSteps.d.ts +15 -0
- package/dist-types/client/src/components/StrategyLabScene/components/SandboxView.d.ts +19 -0
- package/dist-types/client/src/components/StrategyLabScene/components/ScenarioPanel.d.ts +17 -0
- package/dist-types/client/src/components/StrategyLabScene/components/SimulationAnimation.d.ts +13 -0
- package/dist-types/client/src/components/StrategyLabScene/components/SimulationResult.d.ts +15 -0
- package/dist-types/client/src/components/StrategyLabScene/components/StressTestView.d.ts +22 -0
- package/dist-types/client/src/components/StrategyLabScene/themeMatching.d.ts +21 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/education.d.ts +45 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/healthcare.d.ts +7 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/index.d.ts +22 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/professional.d.ts +7 -0
- package/dist-types/client/src/components/StrategyLabScene/themes/technology.d.ts +7 -0
- package/dist-types/client/src/components/StrategyLabScene/types.d.ts +82 -0
- package/dist-types/client/src/components/StrategyLabScene/views/UnifiedStrategyLabView.d.ts +72 -0
- package/dist-types/client/src/components/TrainingEngine/BriefingQAChat.d.ts +19 -0
- package/dist-types/client/src/components/TrainingEngine/CaseInfoModal.d.ts +12 -0
- package/dist-types/client/src/components/TrainingEngine/CaseSelector.d.ts +15 -0
- package/dist-types/client/src/components/TrainingEngine/ClassicView.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/DashboardHomePage.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/EnhancedStudentProfilePanel.d.ts +9 -0
- package/dist-types/client/src/components/TrainingEngine/EvaluationPanel.d.ts +8 -0
- package/dist-types/client/src/components/TrainingEngine/GlobalQAPanel.d.ts +34 -0
- package/dist-types/client/src/components/TrainingEngine/GuidanceHistoryDrawer.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/GuidancePanel.d.ts +3 -0
- package/dist-types/client/src/components/TrainingEngine/ImmersiveGameView.d.ts +7 -0
- package/dist-types/client/src/components/TrainingEngine/PluginRenderer.d.ts +15 -0
- package/dist-types/client/src/components/TrainingEngine/ProgressTracker.d.ts +3 -0
- package/dist-types/client/src/components/TrainingEngine/StageAssessingOverlay.d.ts +17 -0
- package/dist-types/client/src/components/TrainingEngine/StageAssessmentPanel.d.ts +10 -0
- package/dist-types/client/src/components/TrainingEngine/StepExecutor.d.ts +20 -0
- package/dist-types/client/src/components/TrainingEngine/StepNodeMap.d.ts +15 -0
- package/dist-types/client/src/components/TrainingEngine/StudentProfilePanel.d.ts +6 -0
- package/dist-types/client/src/components/TrainingEngine/ThemeContext.d.ts +8 -0
- package/dist-types/client/src/components/TrainingEngine/TrainingMaterialsSidebar.d.ts +21 -0
- package/dist-types/client/src/components/TrainingEngine/TrainingModelContainer.d.ts +42 -0
- package/dist-types/client/src/components/TrainingEngine/ViewProps.d.ts +37 -0
- package/dist-types/client/src/components/TrainingEngine/profileDataSelectors.d.ts +23 -0
- package/dist-types/client/src/components/TrainingEngine/stepInitData.d.ts +42 -0
- package/dist-types/client/src/components/TrainingEngine/targetAbilityUtils.d.ts +11 -0
- package/dist-types/client/src/components/VisualizationRenderer/ChartRenderer.d.ts +12 -0
- package/dist-types/client/src/components/VisualizationRenderer/types.d.ts +41 -0
- package/dist-types/client/src/config/appConfig.d.ts +15 -0
- package/dist-types/client/src/configs/agentConfig.d.ts +66 -0
- package/dist-types/client/src/configs/intentDiscoveryConfig.d.ts +22 -0
- package/dist-types/client/src/data/mockTrainingModel.d.ts +10 -0
- package/dist-types/client/src/hooks/useAIService.d.ts +17 -0
- package/dist-types/client/src/hooks/useDialogueLogic.d.ts +53 -0
- package/dist-types/client/src/hooks/useFormFillingLogic.d.ts +26 -0
- package/dist-types/client/src/hooks/useFormRealtimeGuidance.d.ts +45 -0
- package/dist-types/client/src/hooks/useRealtimeGuidance.d.ts +66 -0
- package/dist-types/client/src/hooks/useStageAssessment.d.ts +8 -0
- package/dist-types/client/src/hooks/useStepExecution.d.ts +14 -0
- package/dist-types/client/src/hooks/useTrainingModel.d.ts +30 -0
- package/dist-types/client/src/lib/creator.d.ts +1 -0
- package/dist-types/client/src/lib/index.d.ts +1 -0
- package/dist-types/client/src/lib/types.d.ts +113 -22
- package/dist-types/client/src/plugins/AssessmentPlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/CaseAnalysisPlugin.d.ts +9 -0
- package/dist-types/client/src/plugins/CaseAnalysisPluginView.d.ts +26 -0
- package/dist-types/client/src/plugins/DecisionSelectPlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/DialogueFormPlugin.d.ts +9 -0
- package/dist-types/client/src/plugins/DialogueFormPluginView.d.ts +37 -0
- package/dist-types/client/src/plugins/DialoguePlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/DialoguePluginView.d.ts +44 -0
- package/dist-types/client/src/plugins/DocumentReview/DocumentCard.d.ts +47 -0
- package/dist-types/client/src/plugins/DocumentReview/LayoutComponents.d.ts +47 -0
- package/dist-types/client/src/plugins/DocumentReview/MarkListPanel.d.ts +51 -0
- package/dist-types/client/src/plugins/DocumentReview/MarkModal.d.ts +37 -0
- package/dist-types/client/src/plugins/DocumentReview/ResultPanel.d.ts +32 -0
- package/dist-types/client/src/plugins/DocumentReview/Toolbar.d.ts +31 -0
- package/dist-types/client/src/plugins/DocumentReview/designTokens.d.ts +76 -0
- package/dist-types/client/src/plugins/DocumentReviewPlugin.d.ts +14 -0
- package/dist-types/client/src/plugins/ProcessOperationPlugin.d.ts +8 -0
- package/dist-types/client/src/plugins/QAPlugin.d.ts +9 -0
- package/dist-types/client/src/plugins/StrategyLabPlugin.d.ts +7 -0
- package/dist-types/client/src/plugins/decision-making/DecisionMakingPlugin.d.ts +4 -0
- package/dist-types/client/src/plugins/decision-making/DecisionWorkspace.d.ts +23 -0
- package/dist-types/client/src/plugins/decision-making/MaterialsPanel.d.ts +18 -0
- package/dist-types/client/src/plugins/decision-making/logic.d.ts +46 -0
- package/dist-types/client/src/plugins/decision-making/scoring.d.ts +79 -0
- package/dist-types/client/src/plugins/decision-making/styles.d.ts +743 -0
- package/dist-types/client/src/plugins/decision-making/types.d.ts +179 -0
- package/dist-types/client/src/plugins/form-filling/DocumentFormLayout.d.ts +22 -0
- package/dist-types/client/src/plugins/form-filling/FormAssistPanel.d.ts +20 -0
- package/dist-types/client/src/plugins/form-filling/FormFillingPlugin.d.ts +15 -0
- package/dist-types/client/src/plugins/form-filling/forms.d.ts +28 -0
- package/dist-types/client/src/plugins/form-filling/scoring.d.ts +86 -0
- package/dist-types/client/src/plugins/form-filling/useFormFilling.d.ts +42 -0
- package/dist-types/client/src/plugins/form-filling/validationRules.d.ts +26 -0
- package/dist-types/client/src/plugins/shared/DecisionShared.d.ts +54 -0
- package/dist-types/client/src/plugins/shared/FrameworkWidget.d.ts +19 -0
- package/dist-types/client/src/plugins/shared/PluginFooter.d.ts +4 -0
- package/dist-types/client/src/plugins/shared/PluginHeader.d.ts +4 -0
- package/dist-types/client/src/plugins/shared/analysisTools.d.ts +30 -0
- package/dist-types/client/src/plugins/shared/disturbanceUtils.d.ts +5 -0
- package/dist-types/client/src/plugins/shared/index.d.ts +5 -0
- package/dist-types/client/src/plugins/shared/jsonRepair.d.ts +39 -0
- package/dist-types/client/src/plugins/shared/judgement.d.ts +46 -0
- package/dist-types/client/src/plugins/shared/nodeChain.d.ts +15 -0
- package/dist-types/client/src/plugins/shared/renderFieldGrid.d.ts +16 -0
- package/dist-types/client/src/plugins/shared/reportBlocks.d.ts +33 -0
- package/dist-types/client/src/plugins/shared/reportEvaluation.d.ts +30 -0
- package/dist-types/client/src/plugins/shared/reportExport.d.ts +12 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/BlockPropertiesPanel.d.ts +9 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/BlockToolbox.d.ts +11 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/ReportWorkbench.d.ts +20 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/SortableBlock.d.ts +15 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/factory.d.ts +14 -0
- package/dist-types/client/src/plugins/shared/reportWorkbench/outlineDraft.d.ts +7 -0
- package/dist-types/client/src/plugins/shared/simulationEngine.d.ts +112 -0
- package/dist-types/client/src/plugins/shared/simulationModes.d.ts +21 -0
- package/dist-types/client/src/plugins/shared/themes.d.ts +5 -0
- package/dist-types/client/src/plugins/shared/types.d.ts +1247 -0
- package/dist-types/client/src/services/AICommandHandler.d.ts +68 -0
- package/dist-types/client/src/services/cozeApiClient.d.ts +44 -0
- package/dist-types/client/src/services/mockApi.d.ts +48 -0
- package/dist-types/client/src/services/storageService.d.ts +88 -0
- package/dist-types/client/src/stores/abilityStore.d.ts +33 -0
- package/dist-types/client/src/stores/dialogueStore.d.ts +30 -0
- package/dist-types/client/src/stores/formRegistryStore.d.ts +45 -0
- package/dist-types/client/src/stores/guidanceStore.d.ts +17 -0
- package/dist-types/client/src/stores/stepEvidenceStore.d.ts +14 -0
- package/dist-types/client/src/stores/strategyLabStore.d.ts +46 -0
- package/dist-types/client/src/stores/trainingStore.d.ts +84 -0
- package/dist-types/client/src/types/ai-commands.d.ts +144 -0
- package/dist-types/client/src/types.d.ts +17 -0
- package/dist-types/client/src/utils/abilityMapGenerator.d.ts +27 -0
- package/dist-types/client/src/utils/formUtils.d.ts +66 -0
- package/dist-types/client/src/utils/rule-engine.d.ts +36 -0
- package/dist-types/shared/types/index.d.ts +592 -0
- package/package.json +5 -3
- package/dist/CaseAnalysisPlugin-CQvF9_zr.js +0 -416
- package/dist/DialogueFormPlugin-C9ssnVMr.js +0 -959
- package/dist/DialoguePlugin-DU00QpmQ.js +0 -416
- package/dist/DocumentReviewPlugin-HNOZY1T4.js +0 -977
- package/dist/FormFillingPlugin-DURWsioi.js +0 -445
- package/dist/ModelEditor-BPJsPR0S.js +0 -8264
- package/dist/PluginHeader-B-GESJmT.js +0 -87
- package/dist/QAPlugin-Bh_UjK1N.js +0 -184
- package/dist/RadarChart-C5ZM0kWt.js +0 -24963
- package/dist/StrategyLabPlugin-DGeZsr_7.js +0 -14361
- package/dist/ThunderboltOutlined-nH_FO_4A.js +0 -44
- package/dist/ToolOutlined-DtuNJDB2.js +0 -28
- package/dist/TrainingModelContainer-DpW-uB8O.js +0 -11883
- package/dist/WarningOutlined-5g1d66hO.js +0 -164
- package/dist/judgement-D_9i7x9S.js +0 -20
- package/dist/useDialogueLogic-IHELcN3X.js +0 -368
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 决策判断插件(DecisionMakingPlugin)类型定义 —— 两栏沉浸式重写
|
|
3
|
+
*
|
|
4
|
+
* 交互形态:左栏材料常驻 + 右栏三步工作区
|
|
5
|
+
* ① 标注决策点 → ② 做出决策 → ③ 阐述理由
|
|
6
|
+
*
|
|
7
|
+
* 对应「运行时配置契约表 §6(重写版)」。旧 decisionCard / conclusionFields
|
|
8
|
+
* 模型整体废弃(项目未上线,无需向后兼容)。
|
|
9
|
+
*/
|
|
10
|
+
import type { EvidenceSummary } from '@shared/types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* 标注类别:定义学员可在材料上标注的决策点类型。
|
|
13
|
+
* 医疗领域如 症状体征 / 检查指标 / 风险因素 / 生活习惯;
|
|
14
|
+
* 通用领域由落地智能体按业务产出(如 财务风险 / 健康状况 / 家庭结构 / 法律风险)。
|
|
15
|
+
*/
|
|
16
|
+
export interface MarkerCategory {
|
|
17
|
+
/** 类别标识,如 'symptom' / 'risk' / 'finance' */
|
|
18
|
+
key: string;
|
|
19
|
+
/** 显示名,如 '症状体征' / '财务风险' */
|
|
20
|
+
label: string;
|
|
21
|
+
/** 主题色(hex),用于段内 inline-tag、标注列表圆点 */
|
|
22
|
+
color: string;
|
|
23
|
+
}
|
|
24
|
+
/** 富文本段落:可标注的材料块之一(对应原型可点击「+」的段落) */
|
|
25
|
+
export interface RichTextBlock {
|
|
26
|
+
kind: 'richText';
|
|
27
|
+
/** 段落唯一 id —— 标注锚点(对应原型 data-pid) */
|
|
28
|
+
id: string;
|
|
29
|
+
/** 可选小节标题,如「一、现病史」 */
|
|
30
|
+
title?: string;
|
|
31
|
+
/** 段落正文,支持 {路径} 变量引用 */
|
|
32
|
+
text: string;
|
|
33
|
+
/** 是否允许标注,默认 true */
|
|
34
|
+
markable?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** 数据表格:异常值可标色 */
|
|
37
|
+
export interface TableBlock {
|
|
38
|
+
kind: 'table';
|
|
39
|
+
id: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
headers: string[];
|
|
42
|
+
rows: {
|
|
43
|
+
cells: {
|
|
44
|
+
value: string;
|
|
45
|
+
status?: 'normal' | 'warning' | 'danger';
|
|
46
|
+
}[];
|
|
47
|
+
}[];
|
|
48
|
+
/** 是否允许标注,默认 true */
|
|
49
|
+
markable?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** 信息卡:键值对摘要(原型「患者信息卡」的通用化) */
|
|
52
|
+
export interface InfoCardBlock {
|
|
53
|
+
kind: 'infoCard';
|
|
54
|
+
id: string;
|
|
55
|
+
title: string;
|
|
56
|
+
/** 顶部风险/状态徽标 */
|
|
57
|
+
badge?: {
|
|
58
|
+
text: string;
|
|
59
|
+
level: 'high' | 'medium' | 'low';
|
|
60
|
+
};
|
|
61
|
+
items: {
|
|
62
|
+
label: string;
|
|
63
|
+
value: string;
|
|
64
|
+
}[];
|
|
65
|
+
/** 是否允许标注,默认 true */
|
|
66
|
+
markable?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** 时间线:按时间/关系排列的条目(原型「家族病史」的通用化) */
|
|
69
|
+
export interface TimelineBlock {
|
|
70
|
+
kind: 'timeline';
|
|
71
|
+
id: string;
|
|
72
|
+
title?: string;
|
|
73
|
+
items: {
|
|
74
|
+
label: string;
|
|
75
|
+
detail: string;
|
|
76
|
+
level?: 'high' | 'medium' | 'low';
|
|
77
|
+
}[];
|
|
78
|
+
/** 是否允许标注,默认 true */
|
|
79
|
+
markable?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export type MaterialBlock = RichTextBlock | TableBlock | InfoCardBlock | TimelineBlock;
|
|
82
|
+
/** 一个材料选项卡 */
|
|
83
|
+
export interface MaterialTab {
|
|
84
|
+
id: string;
|
|
85
|
+
/** 选项卡标签,如「病历摘要」「检验报告」 */
|
|
86
|
+
title: string;
|
|
87
|
+
blocks: MaterialBlock[];
|
|
88
|
+
}
|
|
89
|
+
/** 自由填写字段(freeform 题组内使用) */
|
|
90
|
+
export interface DecisionField {
|
|
91
|
+
name: string;
|
|
92
|
+
label: string;
|
|
93
|
+
type: 'text' | 'textarea' | 'number' | 'select';
|
|
94
|
+
/** 字段用途说明,指导学员填写并供评估参考 */
|
|
95
|
+
purpose: string;
|
|
96
|
+
required: boolean;
|
|
97
|
+
maxLength?: number;
|
|
98
|
+
/** type='select' 时必填 */
|
|
99
|
+
options?: string[];
|
|
100
|
+
placeholder?: string;
|
|
101
|
+
}
|
|
102
|
+
/** 选项(single / multi 题组内使用) */
|
|
103
|
+
export interface DecisionOption {
|
|
104
|
+
value: string;
|
|
105
|
+
label: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 决策题组:取代旧的 decisionCard + conclusionFields。
|
|
109
|
+
* - single:单选(如「初步诊断判断」)
|
|
110
|
+
* - multi:多选(如「治疗方案优先级」)
|
|
111
|
+
* - freeform:自由填写若干字段(如「综合健康管理方案」)
|
|
112
|
+
*/
|
|
113
|
+
export interface DecisionGroup {
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
kind: 'single' | 'multi' | 'freeform';
|
|
117
|
+
required?: boolean;
|
|
118
|
+
/** 额外说明(题型标签「单选 · 必答」由 kind+required 推导,此处仅补充说明) */
|
|
119
|
+
hint?: string;
|
|
120
|
+
/** kind='single' | 'multi' 时必填 */
|
|
121
|
+
options?: DecisionOption[];
|
|
122
|
+
/** kind='freeform' 时必填 */
|
|
123
|
+
fields?: DecisionField[];
|
|
124
|
+
}
|
|
125
|
+
export interface ReasonConfig {
|
|
126
|
+
placeholder?: string;
|
|
127
|
+
/** 编辑器下方的提示要点 */
|
|
128
|
+
hints?: string[];
|
|
129
|
+
/** 是否启用「按类别引用已标注点」工具栏,默认 true */
|
|
130
|
+
enableMarkerRefs?: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface DecisionMakingInitData {
|
|
133
|
+
/** 决策场景说明(顶部展示) */
|
|
134
|
+
decisionScenario: string;
|
|
135
|
+
/** 左栏材料,选项卡式展示 */
|
|
136
|
+
materials: MaterialTab[];
|
|
137
|
+
/** 标注类别 */
|
|
138
|
+
markerCategories: MarkerCategory[];
|
|
139
|
+
/** 决策题组(右栏 Step2) */
|
|
140
|
+
decisionGroups: DecisionGroup[];
|
|
141
|
+
/** 理由步骤配置(右栏 Step3) */
|
|
142
|
+
reasonConfig?: ReasonConfig;
|
|
143
|
+
/** 前序步骤产物,渲染为左栏「引用」轨 */
|
|
144
|
+
previousEvidence?: EvidenceSummary[];
|
|
145
|
+
}
|
|
146
|
+
export interface DecisionMakingRuntimeRules {
|
|
147
|
+
/** 最少标注数,未达不允许提交 */
|
|
148
|
+
minMarkers?: number;
|
|
149
|
+
/** 是否必须填写理由 */
|
|
150
|
+
requireReason?: boolean;
|
|
151
|
+
/** 理由最小字数(按去空白字符计) */
|
|
152
|
+
minReasonLength?: number;
|
|
153
|
+
}
|
|
154
|
+
/** 一条标注 */
|
|
155
|
+
export interface DecisionMarker {
|
|
156
|
+
id: string;
|
|
157
|
+
/** 所属材料 Tab id */
|
|
158
|
+
materialId: string;
|
|
159
|
+
/** 锚定的材料块 id */
|
|
160
|
+
blockId: string;
|
|
161
|
+
/** 标注类别 key */
|
|
162
|
+
categoryKey: string;
|
|
163
|
+
/** 学员填写的描述 */
|
|
164
|
+
desc: string;
|
|
165
|
+
}
|
|
166
|
+
export interface DecisionFormState {
|
|
167
|
+
currentStep: 1 | 2 | 3;
|
|
168
|
+
/** 左栏当前激活的 Tab id */
|
|
169
|
+
activeTab: string;
|
|
170
|
+
/** Step1:标注列表 */
|
|
171
|
+
markers: DecisionMarker[];
|
|
172
|
+
/** Step2:题组选择,groupId → 选中的 option value(single 长度恒为 1) */
|
|
173
|
+
groupSelections: Record<string, string[]>;
|
|
174
|
+
/** Step2:freeform 题组字段值,groupId → { fieldName: value } */
|
|
175
|
+
freeformFields: Record<string, Record<string, any>>;
|
|
176
|
+
/** Step3:理由正文 */
|
|
177
|
+
reason: string;
|
|
178
|
+
lastModified: number;
|
|
179
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormField, FormTemplateConfig } from '../shared/types';
|
|
3
|
+
import type { FieldValidationState } from './useFormFilling';
|
|
4
|
+
export interface DocumentFormLayoutProps {
|
|
5
|
+
forms: FormTemplateConfig[];
|
|
6
|
+
formData: Record<string, any>;
|
|
7
|
+
validationErrors: Record<string, string>;
|
|
8
|
+
fieldValidation: Record<string, FieldValidationState>;
|
|
9
|
+
columns: number;
|
|
10
|
+
activeFormName: string;
|
|
11
|
+
onActiveFormChange: (formName: string) => void;
|
|
12
|
+
onFieldChange: (name: string, value: any) => void;
|
|
13
|
+
onFieldFocus?: (field: FormField | null) => void;
|
|
14
|
+
/** 解析 {路径}/[表达式](用于 title/subtitle/docNo/hint/label) */
|
|
15
|
+
resolveText: (t?: string) => string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 高保真多单证布局:Tab 切单证 + 单证抬头(中英双语 + 编号)+ section 分区 + 可编辑字段网格。
|
|
19
|
+
* 结构与样式镜像 DocumentReview/DocumentCard,但字段为可编辑控件。
|
|
20
|
+
*/
|
|
21
|
+
declare const DocumentFormLayout: React.FC<DocumentFormLayoutProps>;
|
|
22
|
+
export default DocumentFormLayout;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FormField } from '../shared/types';
|
|
3
|
+
import type { FieldValidationState } from './useFormFilling';
|
|
4
|
+
export interface FormAssistPanelProps {
|
|
5
|
+
allFields: FormField[];
|
|
6
|
+
formData: Record<string, any>;
|
|
7
|
+
validationErrors: Record<string, string>;
|
|
8
|
+
fieldValidation: Record<string, FieldValidationState>;
|
|
9
|
+
/** 真正被实时校验覆盖的字段名(仅这些字段填好才显示"校验通过"绿标) */
|
|
10
|
+
validatedFieldNames: Set<string>;
|
|
11
|
+
focusedField: FormField | null;
|
|
12
|
+
resolveText: (t?: string) => string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 右栏 AI 实时辅助面板:
|
|
16
|
+
* - 当前字段引导:聚焦字段时展示该字段 hint(静态,非 AI;AI 定时指导走全局浮窗)
|
|
17
|
+
* - 实时校验动态:按 通过/错误/警告/提示 实时反馈各已填字段
|
|
18
|
+
*/
|
|
19
|
+
declare const FormAssistPanel: React.FC<FormAssistPanelProps>;
|
|
20
|
+
export default FormAssistPanel;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PluginProps } from '@shared/types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* 表单填写插件(重写版)
|
|
5
|
+
*
|
|
6
|
+
* 能力:
|
|
7
|
+
* - 一个插件内 Tab 切换填写多张单证(initData.forms[],兼容旧单 formTemplate)
|
|
8
|
+
* - 高保真保单文档布局(中英双语标签 / section 抬头 / 单证编号 / 只读预填)
|
|
9
|
+
* - 前端声明式实时校验(跨字段/跨表单一致、条件必填、比较、范围、正则)
|
|
10
|
+
* - 定时实时指导(阶段3接入,复用 COACH_AGENT + 全局浮窗)
|
|
11
|
+
*
|
|
12
|
+
* 不支持高代码自定义布局(customLayoutCode)与对话式表单(已隐藏)。
|
|
13
|
+
*/
|
|
14
|
+
declare const FormFillingPlugin: React.FC<PluginProps>;
|
|
15
|
+
export default FormFillingPlugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单填写——多表单归一与聚合工具
|
|
3
|
+
*
|
|
4
|
+
* 一个 form-filling 步骤可含多张单证(initData.forms[]),也兼容旧单表单(initData.formTemplate)。
|
|
5
|
+
* 本模块是"单/多表单"的唯一收口点:渲染、评估、答案键抽取、落地校验都先经 resolveForms() 归一,
|
|
6
|
+
* 单表单 = 长度 1 的退化,避免散落 if 判断。对齐 strategy-lab 的 resolveNodes、document-review 的 documents[]。
|
|
7
|
+
*
|
|
8
|
+
* 字段命名空间约定:同一步骤内所有表单的 field.name 全局唯一(评估/答案键/确定性评分均按 name 扁平索引)。
|
|
9
|
+
*/
|
|
10
|
+
import type { FormTemplateConfig, FormField } from '../shared/types';
|
|
11
|
+
/**
|
|
12
|
+
* 把 initData 归一为 FormTemplateConfig[]:
|
|
13
|
+
* - 有 forms[] → 直接用(过滤 formName 为空的项)
|
|
14
|
+
* - 无 forms[] 有 formTemplate → 包成长度 1 的数组,title=formName,
|
|
15
|
+
* groups 取 uiConfig.groups,customerData 取 initData.customerData,columns 取 uiConfig.columns
|
|
16
|
+
* - 都没有 → 返回空数组
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveForms(initData: any): FormTemplateConfig[];
|
|
19
|
+
/**
|
|
20
|
+
* 聚合所有表单的字段为一张扁平表(全局唯一 name 保证无键冲突)。
|
|
21
|
+
* 检测到重名时保留首个并 console.warn(防御性,正常数据不应发生)。
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectAllFields(forms: FormTemplateConfig[]): FormField[];
|
|
24
|
+
/**
|
|
25
|
+
* 派生 fieldName → formName 映射,用于把扁平 formData 的每次变更写回对应表单的 filledData。
|
|
26
|
+
* 重名时首个表单胜出(与 collectAllFields 一致)。
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildFieldFormMap(forms: FormTemplateConfig[]): Record<string, string>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单填写——确定性兜底评分
|
|
3
|
+
*
|
|
4
|
+
* 目的:评估智能体(LLM)对表单的打分天然偏宽松,"乱填 / 空填 / 格式错"也容易拿高分。
|
|
5
|
+
* 本模块只判机器能 100% 确定的事实(来自 FormField 的 required / validation / min/max / options),
|
|
6
|
+
* 产出「硬上限 + 强制扣分 + 问题清单」,由评估管线对 LLM 的 totalScore 做最终封顶与扣减,
|
|
7
|
+
* 并把问题清单注入评估 prompt,让 LLM 的叙述与维度判定与之对齐、避免重复扣分。
|
|
8
|
+
*
|
|
9
|
+
* 不做的事(避免误伤):
|
|
10
|
+
* - 不判 businessRules 文字规则(如"与系统留存一致"),那需要案例基准数据,机器没有,留给 LLM。
|
|
11
|
+
* - 不判"填的值对不对"(值正确性需案例标准答案),属于后续"注入参考答案"的范畴。
|
|
12
|
+
*/
|
|
13
|
+
import type { FormField, DeclarativeValidationRule } from '../shared/types';
|
|
14
|
+
import type { FieldReference } from '@shared/types/index.js';
|
|
15
|
+
/** 默认阈值(写死,日后如需可配置再外提) */
|
|
16
|
+
export declare const FORM_SCORING_THRESHOLDS: {
|
|
17
|
+
readonly fillRateGarbage: 0.3;
|
|
18
|
+
readonly capGarbage: 20;
|
|
19
|
+
readonly requiredMissingRateForCap: 0.5;
|
|
20
|
+
readonly capHalfRequiredMissing: 35;
|
|
21
|
+
readonly formatErrorRateForCap: 0.5;
|
|
22
|
+
readonly capManyFormatErrors: 40;
|
|
23
|
+
readonly deductPerRequiredMissing: 8;
|
|
24
|
+
readonly deductPerFormatError: 12;
|
|
25
|
+
readonly deductPerRangeViolation: 10;
|
|
26
|
+
readonly deductPerEnumViolation: 10;
|
|
27
|
+
readonly deductPerRuleViolation: 10;
|
|
28
|
+
};
|
|
29
|
+
export interface FormDeduction {
|
|
30
|
+
reason: string;
|
|
31
|
+
points: number;
|
|
32
|
+
}
|
|
33
|
+
export interface FormDeterministicScore {
|
|
34
|
+
/** 分数硬上限,100 表示未触发任何封顶 */
|
|
35
|
+
hardCap: number;
|
|
36
|
+
/** 逐项强制扣分 */
|
|
37
|
+
deductions: FormDeduction[];
|
|
38
|
+
/** 扣分总额 */
|
|
39
|
+
totalDeduction: number;
|
|
40
|
+
/** 给评估 prompt / improvements 用的可读问题清单 */
|
|
41
|
+
findings: string[];
|
|
42
|
+
/** 整体填充率 0..1 */
|
|
43
|
+
fillRate: number;
|
|
44
|
+
/** 未填写的必填项 label 列表 */
|
|
45
|
+
requiredMissing: string[];
|
|
46
|
+
/** 是否存在任何客观问题(决定是否介入分数) */
|
|
47
|
+
hasObjectiveIssues: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** 解析后的逐字段参考值(correctValue 中的 {路径} 已按案例数据展开) */
|
|
50
|
+
export interface ResolvedFieldReference {
|
|
51
|
+
fieldName: string;
|
|
52
|
+
label: string;
|
|
53
|
+
correctValue: string;
|
|
54
|
+
explanation?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 把 evaluationRules.fieldReferences 的 correctValue 中的 {路径} 引用按案例/前序表单数据解析为实际值,
|
|
58
|
+
* 供注入评估 prompt 做"值准确性"逐字段比对。无法解析或无引用的值原样保留(判断式口径)。
|
|
59
|
+
* @param fields 解析后的表单字段(用于补 label)
|
|
60
|
+
* @param fieldReferences evaluationRules.fieldReferences
|
|
61
|
+
* @param caseData 当前案例数据(currentCase)
|
|
62
|
+
* @param filledData FormRegistry 已填数据(支持 {表单名.字段} 跨表单引用)
|
|
63
|
+
*/
|
|
64
|
+
export declare function resolveFieldReferences(fields: FormField[], fieldReferences: FieldReference[] | undefined, caseData: any, filledData: Record<string, Record<string, any>>): ResolvedFieldReference[];
|
|
65
|
+
/**
|
|
66
|
+
* 解析步骤的表单字段:归一为多表单后聚合所有证字段(全局唯一 name),
|
|
67
|
+
* 每证字段为空或 edit 模式时按 formName 回退 FormRegistry(模板可能在前序步骤定义)。
|
|
68
|
+
* 单表单 = 长度 1 的退化,行为与旧版一致。
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveFormFields(step: any): FormField[];
|
|
71
|
+
/** scoreFormDeterministically 的可选项:注入声明式校验规则做确定性兜底(与前端实时校验同源) */
|
|
72
|
+
export interface ScoreOptions {
|
|
73
|
+
/** runtimeRules.validationRules */
|
|
74
|
+
rules?: DeclarativeValidationRule[];
|
|
75
|
+
/** FormRegistry 已填数据(解析 {表单名.字段} 跨表单引用) */
|
|
76
|
+
filledData?: Record<string, Record<string, any>>;
|
|
77
|
+
/** 当前案例数据(解析 {案例路径} 引用) */
|
|
78
|
+
caseData?: any;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 对表单填写结果做确定性评分。纯函数,无副作用,可单测。
|
|
82
|
+
* @param fields 解析后的表单字段定义
|
|
83
|
+
* @param formData 学员提交的字段值(key 为 field.name)
|
|
84
|
+
* @param options 可选:声明式校验规则(error 级违规并入扣分,与前端实时校验同源)
|
|
85
|
+
*/
|
|
86
|
+
export declare function scoreFormDeterministically(fields: FormField[], formData: Record<string, any>, options?: ScoreOptions): FormDeterministicScore;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { FormField, FormTemplateConfig, FieldValidationLevel } from '../shared/types';
|
|
2
|
+
export interface FieldValidationState {
|
|
3
|
+
level: FieldValidationLevel;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UseFormFillingOptions {
|
|
7
|
+
onRealtimeData?: (data: any) => void;
|
|
8
|
+
/** 字段变更通知(插件用于定时实时指导的积压收集) */
|
|
9
|
+
onFieldChanged?: (field: string, value: any) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface UseFormFillingResult {
|
|
12
|
+
forms: FormTemplateConfig[];
|
|
13
|
+
allFields: FormField[];
|
|
14
|
+
formData: Record<string, any>;
|
|
15
|
+
/** error 级校验(阻断提交),key=field.name → message */
|
|
16
|
+
validationErrors: Record<string, string>;
|
|
17
|
+
/** warning/info 级校验(不阻断),key=field.name */
|
|
18
|
+
fieldValidation: Record<string, FieldValidationState>;
|
|
19
|
+
caseData: any;
|
|
20
|
+
/**
|
|
21
|
+
* 真正进入实时校验覆盖的字段名集合(有格式校验 / 数值范围 / 被任一声明式规则以其为 field)。
|
|
22
|
+
* 仅这些字段的"校验通过"才有意义;无规则字段不应冒充"通过"。
|
|
23
|
+
* required 只是提交门禁、select 选项天然合法,均不计入。
|
|
24
|
+
*/
|
|
25
|
+
validatedFieldNames: Set<string>;
|
|
26
|
+
handleFieldChange: (fieldName: string, value: any) => void;
|
|
27
|
+
/** 提交门禁:必填齐全且无 error 级问题 */
|
|
28
|
+
checkSubmit: () => {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
reason?: string;
|
|
31
|
+
firstErrorFormName?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 表单填写逻辑 Hook(新插件专用,独立于旧 useFormFillingLogic)
|
|
36
|
+
*
|
|
37
|
+
* 支持单/多表单(统一经 resolveForms 归一,单表单=长度1退化)。
|
|
38
|
+
* - 维护一个扁平 formData(field.name 全局唯一),每次变更按 fieldName→formName 写回对应 FormRegistry.filledData[formName]
|
|
39
|
+
* - 校验分级:error 进 validationErrors(阻断提交 + 就地红字),warning/info 进 fieldValidation(橙/蓝提示)
|
|
40
|
+
* - 单字段格式/范围来自 FormField + rule-engine;跨字段/跨表单/条件必填来自 runtimeRules.validationRules(与提交端确定性评分共用执行器)
|
|
41
|
+
*/
|
|
42
|
+
export declare function useFormFilling(initData: any, runtimeRules: any, options?: UseFormFillingOptions): UseFormFillingResult;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单填写——声明式校验规则执行器(纯函数,无副作用,可单测)
|
|
3
|
+
*
|
|
4
|
+
* 只补 FormField 自身属性(required/validation/min/max/options)表达不了的校验:
|
|
5
|
+
* 跨字段/跨表单一致、条件必填、阈值比较、正则、范围。
|
|
6
|
+
*
|
|
7
|
+
* 关键约束:**实时校验(前端逐次输入)与提交时确定性评分共用本执行器**,
|
|
8
|
+
* 规则只有一份(runtimeRules.validationRules),杜绝两套规则漂移。
|
|
9
|
+
*
|
|
10
|
+
* 每条规则描述"何时触发一条提示/错误"(firing condition),命中即产生一条 RuleViolation。
|
|
11
|
+
*/
|
|
12
|
+
import type { DeclarativeValidationRule, FieldValidationLevel } from '../shared/types';
|
|
13
|
+
export interface RuleViolation {
|
|
14
|
+
ruleId: string;
|
|
15
|
+
field: string;
|
|
16
|
+
level: FieldValidationLevel;
|
|
17
|
+
message: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 执行声明式规则,返回所有命中的违规项。
|
|
21
|
+
* @param rules runtimeRules.validationRules
|
|
22
|
+
* @param formData 当前扁平表单数据(key=field.name,多表单聚合后全局唯一)
|
|
23
|
+
* @param filledData FormRegistry 已填数据(支持 {表单名.字段} 跨表单引用)
|
|
24
|
+
* @param caseData 当前案例数据({案例路径} 引用解析;可缺省)
|
|
25
|
+
*/
|
|
26
|
+
export declare function evaluateDeclarativeRules(rules: DeclarativeValidationRule[] | undefined, formData: Record<string, any>, filledData?: Record<string, Record<string, any>>, caseData?: any): RuleViolation[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EvidenceSummary } from '@shared/types/index.js';
|
|
3
|
+
import type { ThemeTokens } from '../shared';
|
|
4
|
+
export declare function alpha(hex: string, a: number): string;
|
|
5
|
+
export declare function buildDecisionTokens(theme?: string | ThemeTokens): {
|
|
6
|
+
primary: string;
|
|
7
|
+
primaryLight: string;
|
|
8
|
+
primaryBorder: string;
|
|
9
|
+
success: string;
|
|
10
|
+
successLight: string;
|
|
11
|
+
successBorder: string;
|
|
12
|
+
warning: string;
|
|
13
|
+
warningLight: string;
|
|
14
|
+
warningBorder: string;
|
|
15
|
+
danger: string;
|
|
16
|
+
dangerLight: string;
|
|
17
|
+
dangerBorder: string;
|
|
18
|
+
text: string;
|
|
19
|
+
textMuted: string;
|
|
20
|
+
textLight: string;
|
|
21
|
+
border: string;
|
|
22
|
+
bg: string;
|
|
23
|
+
white: string;
|
|
24
|
+
radius: {
|
|
25
|
+
sm: number;
|
|
26
|
+
md: number;
|
|
27
|
+
lg: number;
|
|
28
|
+
};
|
|
29
|
+
shadow: {
|
|
30
|
+
sm: string;
|
|
31
|
+
md: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare function getLevelColor(level: string, theme?: string | ThemeTokens): string;
|
|
35
|
+
export declare function getLevelStyle(level: string, theme?: string | ThemeTokens): {
|
|
36
|
+
color: string;
|
|
37
|
+
bg: string;
|
|
38
|
+
border: string;
|
|
39
|
+
ant: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const EvidencePanel: React.FC<{
|
|
42
|
+
previousEvidence: EvidenceSummary[];
|
|
43
|
+
title?: string;
|
|
44
|
+
theme?: string | ThemeTokens;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const ResultPreview: React.FC<{
|
|
47
|
+
items: Array<{
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
color?: string;
|
|
51
|
+
}>;
|
|
52
|
+
title?: string;
|
|
53
|
+
theme?: string | ThemeTokens;
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AnalysisTool } from './analysisTools';
|
|
3
|
+
/**
|
|
4
|
+
* 分析框架 widget(方案设计报告搭建器)。
|
|
5
|
+
* 复用 analysisTools 的 dimensions 作命名格子,按 tool.layout 渲染:
|
|
6
|
+
* quadrant=2×2 象限 | columns=N 列并排 | sections=纵向命名分区(默认)。
|
|
7
|
+
* 五力/鱼骨 v1 降级 sections。
|
|
8
|
+
*/
|
|
9
|
+
export interface FrameworkWidgetProps {
|
|
10
|
+
tool: AnalysisTool;
|
|
11
|
+
/** 各维度当前值,key = dimension.key */
|
|
12
|
+
values: Record<string, string>;
|
|
13
|
+
editable?: boolean;
|
|
14
|
+
onChange?: (key: string, value: string) => void;
|
|
15
|
+
/** 覆盖默认标题 */
|
|
16
|
+
title?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const FrameworkWidget: React.FC<FrameworkWidgetProps>;
|
|
19
|
+
export default FrameworkWidget;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 内置分析工具注册表
|
|
3
|
+
*/
|
|
4
|
+
export interface AnalysisToolDimension {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AnalysisTool {
|
|
11
|
+
key: string;
|
|
12
|
+
name: string;
|
|
13
|
+
category: '战略/商业分析' | '思维方法' | '问题分析' | '营销/销售' | '案例复盘';
|
|
14
|
+
description: string;
|
|
15
|
+
dimensions: AnalysisToolDimension[];
|
|
16
|
+
/**
|
|
17
|
+
* 框架 widget 渲染布局(方案设计报告搭建器用)。
|
|
18
|
+
* quadrant=2×2 象限 | columns=N 列并排 | sections=纵向命名分区(默认)。
|
|
19
|
+
* 五力/鱼骨 v1 降级 sections。省略按 sections 渲染。
|
|
20
|
+
*/
|
|
21
|
+
layout?: 'quadrant' | 'columns' | 'sections';
|
|
22
|
+
}
|
|
23
|
+
export declare const builtinAnalysisTools: AnalysisTool[];
|
|
24
|
+
/**
|
|
25
|
+
* 获取可用的分析工具列表
|
|
26
|
+
* - availableKeys 为空/undefined → 返回全部内置工具
|
|
27
|
+
* - availableKeys 有值 → 过滤内置工具
|
|
28
|
+
* - customTools 有值 → 追加到结果末尾
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAvailableTools(availableKeys?: string[], customTools?: AnalysisTool[]): AnalysisTool[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommunicationResistanceConfig } from '@shared/types/index.js';
|
|
2
|
+
export declare function buildDisturbanceBlock(disturbanceEvent?: string): string;
|
|
3
|
+
export declare function buildResistanceBlock(resistance?: CommunicationResistanceConfig): string;
|
|
4
|
+
export declare function buildFadeBlock(resistanceFaded?: boolean): string;
|
|
5
|
+
export declare function buildBranchBlock(branchDirective?: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as PluginHeader } from './PluginHeader';
|
|
2
|
+
export { default as PluginFooter } from './PluginFooter';
|
|
3
|
+
export { resolveTheme } from './themes';
|
|
4
|
+
export { resolveFieldsByGroups, renderFieldGrid } from './renderFieldGrid';
|
|
5
|
+
export type { BaseUIConfig, UIConfig, DialogueUIConfig, CaseAnalysisUIConfig, ModelUIConfig, FormField, FormLayoutProps, ThemeTokens, FieldGroup, PluginHeaderProps, PluginFooterProps, } from './types';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM 生成 JSON 的容错修复与提取
|
|
3
|
+
*
|
|
4
|
+
* AI 返回的 JSON 偶发格式错误(实际线上案例:字符串值缺少开头引号),
|
|
5
|
+
* JSON.parse 直接失败会导致运行时降级为展示原始文本。本模块在 parse
|
|
6
|
+
* 失败后重写文本,修复常见病种:
|
|
7
|
+
* - 字符串值/键缺少开头或结尾引号、键值对之间缺逗号/冒号
|
|
8
|
+
* - 字符串内部未转义的双引号、裸换行、非法转义
|
|
9
|
+
* - 中文全角引号/冒号被用作 JSON 结构符号、零宽字符/全角空格混入
|
|
10
|
+
* - 单引号字符串、尾逗号、输出截断导致的未闭合括号
|
|
11
|
+
*
|
|
12
|
+
* 修复是 best-effort 且偏保守:宁可让产物 parse 失败走降级,也不返回
|
|
13
|
+
* 语义损坏的数据——extractLLMJson 对修复产物做键健诊与占比护栏,
|
|
14
|
+
* 修复失败时返回 null,由调用方决定降级方式。
|
|
15
|
+
*
|
|
16
|
+
* 已知限制:字符串内容若恰好包含「"}」「",」等 ASCII 引号紧跟 ASCII
|
|
17
|
+
* 结构符的组合,无法与真实闭引号区分,可能提前闭合(中文语料中极罕见)。
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* 修复 LLM 生成 JSON 的常见格式错误。修复过程抛错时原样返回输入。
|
|
21
|
+
*/
|
|
22
|
+
export declare function repairLLMJson(input: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* 从 AI 响应文本中提取并解析 JSON 对象/数组。
|
|
25
|
+
*
|
|
26
|
+
* 候选分两组:完整组(整体文本、各代码块内容)与片段组(首{到尾}、
|
|
27
|
+
* 各顶层平衡 {} 组、顶层 [] 组)。解析顺序:完整组原文 parse → 完整组
|
|
28
|
+
* 修复重 parse → 片段组原文 parse → 片段组修复重 parse。
|
|
29
|
+
* 修复轮防护:产物键健诊;消费比例过低(只修出开头一小段前缀垃圾,
|
|
30
|
+
* 如 "[1] 说明文字…")拒绝;过短片段(纯文本里的 {x:1} 示意)不修复。
|
|
31
|
+
* 彻底失败返回 null,任何内部异常也归于 null(决不向调用方抛错)。
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractLLMJson(text: string): any | null;
|
|
34
|
+
/**
|
|
35
|
+
* 判断一段响应文本"看起来是想返回 JSON"——用于解析彻底失败时
|
|
36
|
+
* 决定降级展示方式(坏 JSON 不该原文展示给学员,纯文本回复则应保留)。
|
|
37
|
+
* 兜底分支要求引号键模式出现在 { 之后,避免把含引号术语的普通文本误判。
|
|
38
|
+
*/
|
|
39
|
+
export declare function looksLikeJsonResponse(text: string): boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { EvidenceSummary } from '@shared/types/index.js';
|
|
2
|
+
import type { DecisionMode, JudgementItem, ReferenceDiscrepancy, ScoringConfig } from './types';
|
|
3
|
+
export declare const normalizeDecisionMode: (mode?: string, initData?: any) => DecisionMode;
|
|
4
|
+
export interface StudentMark {
|
|
5
|
+
fieldName: string;
|
|
6
|
+
typeId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DocumentReviewScoreResult {
|
|
9
|
+
score: number;
|
|
10
|
+
found: number;
|
|
11
|
+
missed: number;
|
|
12
|
+
wrong: number;
|
|
13
|
+
perAnswer: Array<{
|
|
14
|
+
fieldName: string;
|
|
15
|
+
hit: boolean;
|
|
16
|
+
typeCorrect: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
falseMarks: string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 单据审核"找茬式"判分纯函数
|
|
22
|
+
* - 命中且类型对:该点满分
|
|
23
|
+
* - 命中但类型错:该点满分 × baseRatio(默认 0.6)
|
|
24
|
+
* - 遗漏:不得分
|
|
25
|
+
* - 误标(标了非参考答案的字段):每个温和扣分(默认单点平均分的一半)
|
|
26
|
+
* - 总分 clamp 到 [0, 100]
|
|
27
|
+
*/
|
|
28
|
+
export declare function computeDocumentReviewScore(answers: ReferenceDiscrepancy[], marks: StudentMark[], scoring?: ScoringConfig): DocumentReviewScoreResult;
|
|
29
|
+
export declare const buildEvidenceSummary: (params: {
|
|
30
|
+
sourceStepId: string;
|
|
31
|
+
sourceStepName?: string;
|
|
32
|
+
sourceType: string;
|
|
33
|
+
title: string;
|
|
34
|
+
summary: string;
|
|
35
|
+
keyFacts: Array<{
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}>;
|
|
39
|
+
riskFlags?: string[];
|
|
40
|
+
conclusion?: string;
|
|
41
|
+
}) => EvidenceSummary;
|
|
42
|
+
/**
|
|
43
|
+
* 按 sourceType 查找前序证据(通用)
|
|
44
|
+
*/
|
|
45
|
+
export declare const findEvidenceByType: (previousEvidence: EvidenceSummary[] | undefined, sourceType: string) => EvidenceSummary | undefined;
|
|
46
|
+
export declare const buildEvidenceSourceItems: (previousEvidence?: EvidenceSummary[]) => JudgementItem[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 推演节点链工具
|
|
3
|
+
*
|
|
4
|
+
* 单一数据源:所有「场景配置」只活在 initData.nodes[]。本工具把节点数组归一化(补全 order /
|
|
5
|
+
* decisionStyle / nodeId 等缺省),运行时一律操作返回的数组——「单场景」就是 nodes.length === 1
|
|
6
|
+
* 的退化,避免单节点/多节点两套分支。
|
|
7
|
+
*/
|
|
8
|
+
import type { StrategyLabInitData, SimulationNode } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* 归一化为节点数组:补全 order(缺省按下标)、decisionStyle(缺省 iterate)、nodeId(缺省 node-{i})。
|
|
11
|
+
* nodes 为必填字段;若异常缺失/为空,返回一个最小占位单节点以保证运行时不崩。
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveNodes(initData: StrategyLabInitData): SimulationNode[];
|
|
14
|
+
/** 是否为真正的多节点链(>1 个节点)。 */
|
|
15
|
+
export declare function isMultiNode(initData: StrategyLabInitData): boolean;
|