@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,16 @@
|
|
|
1
|
+
import type { CaseSchema, Case } from "@shared/types/index.js";
|
|
2
|
+
import type { TrainingBlueprint, StageContract, StepTaskPackage, CaseVariantPackage, ValidationReport, AssemblyDryRunResult } from "../types/creatorArtifacts";
|
|
3
|
+
interface Params {
|
|
4
|
+
trainingBlueprint?: TrainingBlueprint;
|
|
5
|
+
stageContracts?: StageContract[];
|
|
6
|
+
stepTaskPackages?: StepTaskPackage[];
|
|
7
|
+
caseSchema?: CaseSchema | null;
|
|
8
|
+
caseVariantPackages?: CaseVariantPackage[];
|
|
9
|
+
assemblyDryRunResult?: AssemblyDryRunResult;
|
|
10
|
+
generatedCases?: Case[];
|
|
11
|
+
}
|
|
12
|
+
export declare function useStep5Validation(params: Params): {
|
|
13
|
+
validationReport: ValidationReport;
|
|
14
|
+
releaseDecision: "pass" | "block";
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 环节二 · 落地产物结构完整性校验(单一数据源)
|
|
3
|
+
*
|
|
4
|
+
* 设计目标(P2):把原先分散在 services.ts 的三处校验逻辑
|
|
5
|
+
* ① PLUGIN_REQUIRED_FIELDS 手抄必填清单
|
|
6
|
+
* ② dialogue-form 嵌套路径硬编码 if
|
|
7
|
+
* ③ document-review 的 evaluationRules 跳过特判
|
|
8
|
+
* 统一收敛到下面这张声明式规格表 PLUGIN_VALIDATION_SPECS,并由一个通用解释器消费。
|
|
9
|
+
* 改运行时契约时只需改这一处,规格与「docs/2026年5月17日/运行时配置契约表.md」1:1 对齐。
|
|
10
|
+
*
|
|
11
|
+
* 校验能力:
|
|
12
|
+
* - required 必填字段(支持 a.b 嵌套路径)
|
|
13
|
+
* - conditional 条件必填(当某字段取某值时,另一字段必填)
|
|
14
|
+
* - listItems 数组项条件必填(数组内每项按其 kind 校验子字段)
|
|
15
|
+
* - referential 引用完整性(A 集合的引用键必须落在 B 集合的标识集内)
|
|
16
|
+
* - evaluationRules 评估规则策略 + dimensions 权重和校验
|
|
17
|
+
*
|
|
18
|
+
* 注意:本校验只「记录 issues」(passed-with-issues),不强制重试,沿用既有语义。
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* 落地产物是否应产出 evaluationRules 容器。
|
|
22
|
+
* 单一数据源:读 PLUGIN_VALIDATION_SPECS[pluginType].evaluationRules 策略。
|
|
23
|
+
* 'none'(如 document-review,插件内规则自带判分)→ 不产,落地前置结构校验不得强求该容器。
|
|
24
|
+
* 供 services.ts 落地前置校验复用,避免在 services 侧重复硬编码插件名单(违反单一数据源)。
|
|
25
|
+
*/
|
|
26
|
+
export declare const landingProducesEvaluationRules: (pluginType: string) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 环节二 · 结构完整性校验:检查落地产物是否满足插件运行时契约(必填/条件/引用完整性)。
|
|
29
|
+
*/
|
|
30
|
+
export declare const validateLandingCoverage: (pluginType: string, runtimeConfig: {
|
|
31
|
+
initData: any;
|
|
32
|
+
runtimeRules: any;
|
|
33
|
+
evaluationRules?: any;
|
|
34
|
+
stepBriefing?: any;
|
|
35
|
+
fieldSuggestions?: any[];
|
|
36
|
+
}) => {
|
|
37
|
+
passed: boolean;
|
|
38
|
+
coverageIssues: string[];
|
|
39
|
+
coverageWarnings: string[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 逐案例 × 逐判分步骤校验答案键完整性(四类判分插件)。
|
|
43
|
+
*
|
|
44
|
+
* 答案来源 = Case.stepAnswers[stepId].<键>(优先)或 Step 基线:
|
|
45
|
+
* - decision-making → Step.evaluationRules.decisionReferences
|
|
46
|
+
* - form-filling → Step.evaluationRules.fieldReferences(按需,可省)
|
|
47
|
+
* - case-analysis → Step.evaluationRules.referenceAnswer(按需,可省)
|
|
48
|
+
* - document-review → Step.runtimeRules.referenceAnswers(自带判分,必需)
|
|
49
|
+
* 强制项(decision/document)缺来源报缺;按需项(form/case-analysis)仅在存在时做结构校验。
|
|
50
|
+
*
|
|
51
|
+
* 沿用 validateLandingCoverage 的「passed-with-issues」语义:只记录 issues,不强制阻断。
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* 「被消费字段非空」校验:各步 stepBriefing.caseFacts 引用的案例字段,在每个案例数据里必须有非空值。
|
|
55
|
+
*
|
|
56
|
+
* 背景:案例实例由 AI 生成,array/列表类字段在缺素材、缺约束时极易产出空数组 [](形式合法但无内容)。
|
|
57
|
+
* 而 caseFacts 引用的字段会在运行时实训资料区按 path 取值展示给学员,取到空就是空白面板。
|
|
58
|
+
* 此处把「消费侧引用了、供给侧却为空」这一确定有害的情况收口为非阻断告警(与 validateCaseAnswerKeys 同语义)。
|
|
59
|
+
*
|
|
60
|
+
* 注意:只遍历结构化的 caseFacts[].path(含顶层单段路径,如 "历史记录")。
|
|
61
|
+
* 不复用 services.ts 的 extractFieldReferences——它用 includes('.') 过滤掉单段路径、且反向 import 会致循环依赖。
|
|
62
|
+
*/
|
|
63
|
+
export declare const validateCaseFieldCoverage: (model: {
|
|
64
|
+
stages?: any[];
|
|
65
|
+
} | null | undefined, cases: any[] | null | undefined) => {
|
|
66
|
+
passed: boolean;
|
|
67
|
+
coverageIssues: string[];
|
|
68
|
+
};
|
|
69
|
+
export declare const validateCaseAnswerKeys: (model: {
|
|
70
|
+
stages?: any[];
|
|
71
|
+
} | null | undefined, cases: any[] | null | undefined) => {
|
|
72
|
+
passed: boolean;
|
|
73
|
+
coverageIssues: string[];
|
|
74
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CaseSchema 字段树展开工具(单一数据源)
|
|
3
|
+
*
|
|
4
|
+
* 背景:CaseSchema 字段在嵌套形态下,每个 field.path 只存「相对父级的一段」,
|
|
5
|
+
* 完整路径需递归 children 拼接。此前「遍历字段树」散落多处各写一份,口径不一:
|
|
6
|
+
* - 生成端喂落地/详情智能体的字段清单(services.ts)只 map 顶层、不展开 children
|
|
7
|
+
* → bot 看不到深层叶子路径,只能脑补 → caseFacts/scenario 引用漂移、落地校验失败重试;
|
|
8
|
+
* - 校验端(landingValidation.ts)却用「完整叶子路径」比对 → 生成端看到的 ≠ 校验端要求的。
|
|
9
|
+
* 本模块把「遍历 CaseSchema 树」收敛为单一核心,供生成端渲染、校验端展平共用,口径根上一致。
|
|
10
|
+
*
|
|
11
|
+
* 放在中立模块:landingValidation.ts 不能 import services.ts(services 依赖它,会形成循环),
|
|
12
|
+
* 故二者共用的展开逻辑下沉到此,两边都可安全 import。
|
|
13
|
+
*/
|
|
14
|
+
/** 可展开字段(CaseSchemaField 的结构子集;用宽松类型以兼容校验端传入的精简对象) */
|
|
15
|
+
export interface SchemaFieldLike {
|
|
16
|
+
path?: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
maxLength?: number;
|
|
20
|
+
children?: SchemaFieldLike[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 展平为完整路径字符串集合(含容器与叶子,去重)。
|
|
24
|
+
* 校验端的「可引用集」、生成端的覆盖判断共用此口径。
|
|
25
|
+
*/
|
|
26
|
+
export declare const flattenSchemaFieldPaths: (fields: SchemaFieldLike[] | undefined, parentPath?: string) => string[];
|
|
27
|
+
/** UI 下拉候选项:完整路径 + label + type。供编辑器字段路径选择器复用(单一数据源,免 UI 重写递归)。 */
|
|
28
|
+
export interface SchemaFieldOption {
|
|
29
|
+
path: string;
|
|
30
|
+
label: string;
|
|
31
|
+
type?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 展平为「可在 caseFacts/scenario 中按 path 精确取值」的候选字段项(含容器与叶子,去重)。
|
|
35
|
+
* - 复用 walk:完整路径、label、type 一次到位;
|
|
36
|
+
* - 过滤含 [] 的数组元素路径:运行时 getValueByPath / {} 引用都不认 [],选了必取空
|
|
37
|
+
* (与 renderFieldsAsFullPaths 同口径;校验端 flatten 保留 [] 认下标,两端有意不同);
|
|
38
|
+
* - 保留 object/array 容器路径:caseFacts 可整体引用容器,前端 FactNode 递归渲染;
|
|
39
|
+
* - label 缺省回退为 path,保证下拉项始终有可读主体。
|
|
40
|
+
*/
|
|
41
|
+
export declare const flattenSchemaFieldOptions: (fields: SchemaFieldLike[] | undefined) => SchemaFieldOption[];
|
|
42
|
+
/**
|
|
43
|
+
* 渲染为「完整路径平铺清单」,供喂给生成/落地智能体。
|
|
44
|
+
* 每行:`- 完整路径 (type[, maxLength:N]) — label`。
|
|
45
|
+
* 关键:展开到完整叶子路径,bot 直接复制即可,不必从缩进/相对段自行拼接(拼接易漏中间层)。
|
|
46
|
+
*/
|
|
47
|
+
export declare const renderFieldsAsFullPaths: (fields: SchemaFieldLike[] | undefined) => string;
|
|
48
|
+
/**
|
|
49
|
+
* CaseSchema 保留字(信封键):落地智能体输出 JSON 的顶层键,绝非案例字段路径前缀。
|
|
50
|
+
* 任何 path 以这些词作为「第一段」的字段,都是落地 bot 把信封键误当字段前缀产出的污染,
|
|
51
|
+
* 不得进入最终 CaseSchema。业务字段第一段为中文领域键(客户信息/业务数据/角色池…),不冲突。
|
|
52
|
+
*/
|
|
53
|
+
export declare const RESERVED_SCHEMA_ROOT_KEYS: readonly ["fieldSuggestions", "initData", "runtimeRules", "evaluationRules", "stepBriefing"];
|
|
54
|
+
/** 该 path 是否以保留字(信封键)为第一段——应被兜底剔除的污染路径。 */
|
|
55
|
+
export declare const isReservedRootPath: (path: string | undefined | null) => boolean;
|
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 管理后台服务层
|
|
3
|
+
* AI 模型生成相关服务 - 简化版(AI 自动判断是否追问)
|
|
4
|
+
* 以及分步创建器所需的选项生成服务
|
|
5
|
+
*/
|
|
6
|
+
import type { TrainingModel, CaseSchema, CaseSchemaField, CaseSchemaConstraint, Stage, EvaluationRules, AbilityMap, FieldUsage } from "@shared/types/index.js";
|
|
7
|
+
import type { CreatorContext } from "../lib/types";
|
|
8
|
+
export type { CreatorContext } from "../lib/types";
|
|
9
|
+
import type { StepTaskPackage, StageContract } from './types/creatorArtifacts';
|
|
10
|
+
/**
|
|
11
|
+
* 选项类型(不包含 caseScenario,案例场景使用独立的 generateCaseVariantPackages 函数)
|
|
12
|
+
*/
|
|
13
|
+
export type OptionType = "businessType" | "targetPosition" | "learningObjectives" | "trainingType" | "ideologicalElements";
|
|
14
|
+
/**
|
|
15
|
+
* 选项生成上下文(用于基础信息推荐)
|
|
16
|
+
*/
|
|
17
|
+
export interface OptionContext {
|
|
18
|
+
domain?: string;
|
|
19
|
+
businessType?: string;
|
|
20
|
+
targetPosition?: string;
|
|
21
|
+
trainingType?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* AI 推荐选项
|
|
25
|
+
*/
|
|
26
|
+
export interface AIOption {
|
|
27
|
+
value: string;
|
|
28
|
+
label: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
difficulty?: "easy" | "medium" | "hard";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 场景维度
|
|
34
|
+
*/
|
|
35
|
+
export interface ScenarioDimension {
|
|
36
|
+
key: string;
|
|
37
|
+
dimensionLabel: string;
|
|
38
|
+
value: string;
|
|
39
|
+
fieldHint?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 带维度的场景选项(旧格式兼容)
|
|
43
|
+
*/
|
|
44
|
+
export interface AIScenarioOption extends AIOption {
|
|
45
|
+
dimensions?: ScenarioDimension[];
|
|
46
|
+
}
|
|
47
|
+
export interface CaseVariantPackageOption {
|
|
48
|
+
variantId: string;
|
|
49
|
+
label: string;
|
|
50
|
+
difficulty: "easy" | "medium" | "hard";
|
|
51
|
+
objectProfile: Record<string, any>;
|
|
52
|
+
keyFacts: string[];
|
|
53
|
+
constraints: string[];
|
|
54
|
+
hiddenRisks: string[];
|
|
55
|
+
disturbanceEvents: string[];
|
|
56
|
+
communicationResistance: string[];
|
|
57
|
+
standardPath: string[];
|
|
58
|
+
commonErrors: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 生成选项结果(基础信息推荐)
|
|
62
|
+
*/
|
|
63
|
+
export interface GenerateOptionsResult {
|
|
64
|
+
options: AIOption[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 用户需求(用户实际填写的内容)
|
|
68
|
+
*/
|
|
69
|
+
export interface UserRequirements {
|
|
70
|
+
domain: string;
|
|
71
|
+
businessType: string;
|
|
72
|
+
targetPosition: string;
|
|
73
|
+
learningObjectives?: string;
|
|
74
|
+
trainingLevel?: 'undergraduate' | 'vocational' | 'technical';
|
|
75
|
+
trainingType?: string;
|
|
76
|
+
ideologicalElements?: string;
|
|
77
|
+
ideologicalRatio?: number;
|
|
78
|
+
cases?: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* 模板定义
|
|
83
|
+
*/
|
|
84
|
+
export interface ModelTemplate {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
domain: string;
|
|
89
|
+
businessType: string;
|
|
90
|
+
targetPosition: string;
|
|
91
|
+
difficulty: "easy" | "medium" | "hard";
|
|
92
|
+
stageCount: number;
|
|
93
|
+
caseCount: number;
|
|
94
|
+
}
|
|
95
|
+
export declare const modelTemplates: ModelTemplate[];
|
|
96
|
+
/** 流程大纲 - 步骤骨架 */
|
|
97
|
+
export interface OutlineStep {
|
|
98
|
+
stepId: string;
|
|
99
|
+
stepName: string;
|
|
100
|
+
purpose: string;
|
|
101
|
+
pluginType?: string;
|
|
102
|
+
}
|
|
103
|
+
/** 流程大纲 - 阶段骨架 */
|
|
104
|
+
export interface OutlineStage {
|
|
105
|
+
stageId: string;
|
|
106
|
+
stageName: string;
|
|
107
|
+
stageGoal: string;
|
|
108
|
+
entryCriteria: string[];
|
|
109
|
+
deliverables: string[];
|
|
110
|
+
keyDecisions: string[];
|
|
111
|
+
completionCriteria: string[];
|
|
112
|
+
commonMistakes: string[];
|
|
113
|
+
steps: OutlineStep[];
|
|
114
|
+
}
|
|
115
|
+
/** 流程大纲 */
|
|
116
|
+
export interface ProcessOutline {
|
|
117
|
+
summary: string;
|
|
118
|
+
stages: OutlineStage[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 从 AI 响应中提取并解析 JSON(多重容错)
|
|
122
|
+
*/
|
|
123
|
+
export declare const parseAIResponse: (response: string) => any;
|
|
124
|
+
export declare const getDefaultEvaluationRules: () => EvaluationRules;
|
|
125
|
+
export declare const normalizeEvaluationRules: (input: any, fallback?: EvaluationRules) => EvaluationRules;
|
|
126
|
+
export declare const resolveStepEvaluationRules: (stepRules: any, stageRules: any) => EvaluationRules;
|
|
127
|
+
/**
|
|
128
|
+
* 从模板转换为需求
|
|
129
|
+
*/
|
|
130
|
+
export declare const templateToRequirements: (template: ModelTemplate) => UserRequirements;
|
|
131
|
+
export declare const saveCreatorContext: (context: CreatorContext) => void;
|
|
132
|
+
export declare const loadCreatorContext: () => CreatorContext | null;
|
|
133
|
+
export declare const clearCreatorContext: () => void;
|
|
134
|
+
/**
|
|
135
|
+
* 生成流程大纲(Stage 2 → 3)
|
|
136
|
+
* 基于 basicInfo + caseScenario 调用 AI 生成流程大纲
|
|
137
|
+
*/
|
|
138
|
+
export declare const generateProcessOutline: (context: {
|
|
139
|
+
domain: string;
|
|
140
|
+
businessType: string;
|
|
141
|
+
targetPosition: string;
|
|
142
|
+
trainingGoal?: string;
|
|
143
|
+
jobTasks?: string[];
|
|
144
|
+
competencyGoals?: string[];
|
|
145
|
+
objectTypes?: string[];
|
|
146
|
+
riskScenarios?: string[];
|
|
147
|
+
acceptanceCriteria?: string[];
|
|
148
|
+
trainingLevel?: "undergraduate" | "vocational" | "technical";
|
|
149
|
+
cases?: string;
|
|
150
|
+
scenarioSeeds?: AIScenarioOption[];
|
|
151
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
152
|
+
outline: ProcessOutline;
|
|
153
|
+
message?: string;
|
|
154
|
+
conversationId?: string;
|
|
155
|
+
abilityMap?: AbilityMap;
|
|
156
|
+
}>;
|
|
157
|
+
/**
|
|
158
|
+
* 修改流程大纲(Stage 3 内对话式修改)
|
|
159
|
+
* 复用 Stage 3 的会话
|
|
160
|
+
*/
|
|
161
|
+
export declare const refineProcessOutline: (userMessage: string, cozeToken: string, conversationId: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
162
|
+
outline: ProcessOutline;
|
|
163
|
+
message?: string;
|
|
164
|
+
conversationId?: string;
|
|
165
|
+
abilityMap?: AbilityMap;
|
|
166
|
+
}>;
|
|
167
|
+
/**
|
|
168
|
+
* 基于确认的大纲生成完整模型 JSON(Stage 4b) */
|
|
169
|
+
export declare const generateStepDetails: (context: {
|
|
170
|
+
conversationId?: string;
|
|
171
|
+
outline: ProcessOutline;
|
|
172
|
+
outlineText?: string;
|
|
173
|
+
abilityMapText?: string;
|
|
174
|
+
retryFeedback?: string;
|
|
175
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
176
|
+
model: TrainingModel;
|
|
177
|
+
declaredFields: CaseSchemaField[];
|
|
178
|
+
declaredConstraints: CaseSchemaConstraint[];
|
|
179
|
+
conversationId: string;
|
|
180
|
+
}>;
|
|
181
|
+
/**
|
|
182
|
+
* 按阶段生成步骤细节(当 totalSteps >= 6 时使用)
|
|
183
|
+
* 复用共享会话,逐阶段调用 AI 生成
|
|
184
|
+
*/
|
|
185
|
+
export declare const generateStageDetails: (context: {
|
|
186
|
+
conversationId?: string;
|
|
187
|
+
stageIndex: number;
|
|
188
|
+
totalStages: number;
|
|
189
|
+
stageName: string;
|
|
190
|
+
stageGoal: string;
|
|
191
|
+
steps: Array<{
|
|
192
|
+
stepId: string;
|
|
193
|
+
stepName: string;
|
|
194
|
+
purpose: string;
|
|
195
|
+
pluginType?: string;
|
|
196
|
+
}>;
|
|
197
|
+
trainingBlueprint?: Record<string, any>;
|
|
198
|
+
accumulatedFields: CaseSchemaField[];
|
|
199
|
+
abilityMapText?: string;
|
|
200
|
+
retryFeedback?: string;
|
|
201
|
+
outlineText?: string;
|
|
202
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
203
|
+
stageContract: any;
|
|
204
|
+
stepTaskPackages: any[];
|
|
205
|
+
stageAssessment: any;
|
|
206
|
+
declaredFields: CaseSchemaField[];
|
|
207
|
+
declaredConstraints: CaseSchemaConstraint[];
|
|
208
|
+
conversationId: string;
|
|
209
|
+
}>;
|
|
210
|
+
/**
|
|
211
|
+
* 步骤级 revision service
|
|
212
|
+
*/
|
|
213
|
+
export declare const reviseStepDetailsByPrompt: (context: {
|
|
214
|
+
conversationId?: string;
|
|
215
|
+
outline: any;
|
|
216
|
+
model: TrainingModel;
|
|
217
|
+
declaredFields: CaseSchemaField[];
|
|
218
|
+
declaredConstraints?: CaseSchemaConstraint[];
|
|
219
|
+
stageIndex: number;
|
|
220
|
+
stepIndex: number;
|
|
221
|
+
step: Stage["steps"][number];
|
|
222
|
+
userInstruction: string;
|
|
223
|
+
abilityMapText?: string;
|
|
224
|
+
retryFeedback?: string;
|
|
225
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
226
|
+
step: Stage["steps"][number];
|
|
227
|
+
declaredFields: CaseSchemaField[];
|
|
228
|
+
declaredConstraints: CaseSchemaConstraint[];
|
|
229
|
+
conversationId?: string;
|
|
230
|
+
}>;
|
|
231
|
+
/**
|
|
232
|
+
* 阶段级 revision service
|
|
233
|
+
*/
|
|
234
|
+
export declare const reviseStageDetailsByPrompt: (context: {
|
|
235
|
+
conversationId?: string;
|
|
236
|
+
outline: any;
|
|
237
|
+
model: TrainingModel;
|
|
238
|
+
declaredFields: CaseSchemaField[];
|
|
239
|
+
declaredConstraints?: CaseSchemaConstraint[];
|
|
240
|
+
stageIndex: number;
|
|
241
|
+
stage: Stage;
|
|
242
|
+
userInstruction: string;
|
|
243
|
+
abilityMapText?: string;
|
|
244
|
+
retryFeedback?: string;
|
|
245
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
246
|
+
stage: Stage;
|
|
247
|
+
declaredFields: CaseSchemaField[];
|
|
248
|
+
declaredConstraints: CaseSchemaConstraint[];
|
|
249
|
+
conversationId?: string;
|
|
250
|
+
}>;
|
|
251
|
+
export declare const landStepRuntimeConfig: (context: {
|
|
252
|
+
stepId: string;
|
|
253
|
+
stepName: string;
|
|
254
|
+
pluginType: string;
|
|
255
|
+
pluginConfigDraft: any;
|
|
256
|
+
common: any;
|
|
257
|
+
declaredFields: CaseSchemaField[];
|
|
258
|
+
stageContract: any;
|
|
259
|
+
/** 上次落地校验未通过的问题(结构缺失/非法表达式),重试时回传给智能体定向修正 */
|
|
260
|
+
retryFeedback?: string;
|
|
261
|
+
}, cozeToken: string) => Promise<{
|
|
262
|
+
initData: Record<string, any>;
|
|
263
|
+
runtimeRules: Record<string, any>;
|
|
264
|
+
evaluationRules: {
|
|
265
|
+
dimensions: any[];
|
|
266
|
+
businessRules: string[];
|
|
267
|
+
fieldReferences?: any[];
|
|
268
|
+
};
|
|
269
|
+
stepBriefing?: any;
|
|
270
|
+
fieldSuggestions: CaseSchemaField[];
|
|
271
|
+
}>;
|
|
272
|
+
/**
|
|
273
|
+
* 环节二 · 结构完整性校验
|
|
274
|
+
* 校验规格(单一数据源)与实现已迁出至 ./landingValidation,
|
|
275
|
+
* 此处再导出以保持既有引用路径(useStep3Details 等从 "../services" 引入)。
|
|
276
|
+
*/
|
|
277
|
+
export { validateLandingCoverage, validateCaseAnswerKeys, validateCaseFieldCoverage } from './landingValidation';
|
|
278
|
+
/**
|
|
279
|
+
* 独立生成案例数据(Case[])
|
|
280
|
+
* @deprecated Step4 已拆分,逐案例改用 generateCaseInstance(独立会话 + 产答案键)。保留以兼容旧合约测试。
|
|
281
|
+
*/
|
|
282
|
+
export declare const generateCases: (context: {
|
|
283
|
+
conversationId?: string;
|
|
284
|
+
caseVariantPackages?: CaseVariantPackageOption[];
|
|
285
|
+
caseSchema?: CaseSchema;
|
|
286
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
287
|
+
cases: any[];
|
|
288
|
+
conversationId: string;
|
|
289
|
+
}>;
|
|
290
|
+
/**
|
|
291
|
+
* 判分步骤题面(供 4b 按本案例数据产出答案键)。覆盖四类判分插件,按 pluginType 取对应字段:
|
|
292
|
+
* - decision-making → groups(题组/选项),答案键 = decisionReferences
|
|
293
|
+
* - form-filling → formFields(表单字段),答案键 = fieldReferences
|
|
294
|
+
* - case-analysis → scenario + requiredPointsHint,答案键 = referenceAnswer + requiredPoints
|
|
295
|
+
* - document-review → documentFields + errorTypes,答案键 = documentReferenceAnswers
|
|
296
|
+
*/
|
|
297
|
+
export interface AnswerKeyStepQuestion {
|
|
298
|
+
stepId: string;
|
|
299
|
+
stepName: string;
|
|
300
|
+
pluginType: 'decision-making' | 'form-filling' | 'case-analysis' | 'document-review';
|
|
301
|
+
decisionScenario?: string;
|
|
302
|
+
groups?: Array<{
|
|
303
|
+
id: string;
|
|
304
|
+
title: string;
|
|
305
|
+
kind: 'single' | 'multi' | 'freeform';
|
|
306
|
+
options?: {
|
|
307
|
+
value: string;
|
|
308
|
+
label: string;
|
|
309
|
+
}[];
|
|
310
|
+
fields?: {
|
|
311
|
+
name: string;
|
|
312
|
+
label: string;
|
|
313
|
+
}[];
|
|
314
|
+
}>;
|
|
315
|
+
formFields?: Array<{
|
|
316
|
+
name: string;
|
|
317
|
+
label: string;
|
|
318
|
+
required?: boolean;
|
|
319
|
+
type?: string;
|
|
320
|
+
formName?: string;
|
|
321
|
+
formTitle?: string;
|
|
322
|
+
}>;
|
|
323
|
+
scenario?: string;
|
|
324
|
+
requiredPointsHint?: string[];
|
|
325
|
+
documentFields?: Array<{
|
|
326
|
+
name: string;
|
|
327
|
+
label?: string;
|
|
328
|
+
docName?: string;
|
|
329
|
+
}>;
|
|
330
|
+
errorTypes?: Array<{
|
|
331
|
+
id: string;
|
|
332
|
+
label?: string;
|
|
333
|
+
}>;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* 从已生成模型中抽取各判分步骤的题面(案例无关的"考卷"),供 step4b 逐案例产出答案键。
|
|
337
|
+
* 答案键由 4b 按各案例数据填(评估专用、学员不可见)。
|
|
338
|
+
*/
|
|
339
|
+
export declare const buildAnswerKeyQuestions: (model: {
|
|
340
|
+
stages?: any[];
|
|
341
|
+
} | null | undefined) => AnswerKeyStepQuestion[];
|
|
342
|
+
/**
|
|
343
|
+
* 生成单个案例实例 + 答案键(Step 4b)。
|
|
344
|
+
* 每次调用都新建会话(不传 conversationId),逐案例隔离、互不串味。
|
|
345
|
+
* answerKeySteps 提供各判分步骤题面(decision/form/case-analysis/document-review),
|
|
346
|
+
* 4b 据此为"本案例"产出 stepAnswers(评估专用、学员不可见)。
|
|
347
|
+
*/
|
|
348
|
+
export declare const generateCaseInstance: (context: {
|
|
349
|
+
caseVariantPackage: CaseVariantPackageOption;
|
|
350
|
+
caseSchema: CaseSchema;
|
|
351
|
+
answerKeySteps?: AnswerKeyStepQuestion[];
|
|
352
|
+
domainContext?: {
|
|
353
|
+
domain?: string;
|
|
354
|
+
businessType?: string;
|
|
355
|
+
targetPosition?: string;
|
|
356
|
+
trainingGoal?: string;
|
|
357
|
+
trainingLevel?: string;
|
|
358
|
+
};
|
|
359
|
+
}, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void) => Promise<{
|
|
360
|
+
case: any;
|
|
361
|
+
conversationId: string;
|
|
362
|
+
}>;
|
|
363
|
+
/**
|
|
364
|
+
* 生成自定义布局代码(调用 Coze 智能体)
|
|
365
|
+
*
|
|
366
|
+
* @param fields 字段列表(文本描述,供 AI 参考)
|
|
367
|
+
* @param layoutDescription 管理员对布局的自然语言描述
|
|
368
|
+
* @param cozeToken Coze API Token
|
|
369
|
+
* @param botId Bot ID
|
|
370
|
+
* @param onStreamUpdate 流式更新回调
|
|
371
|
+
*/
|
|
372
|
+
export declare const generateCustomLayoutCode: (fields: Array<{
|
|
373
|
+
name: string;
|
|
374
|
+
label: string;
|
|
375
|
+
type: string;
|
|
376
|
+
required?: boolean;
|
|
377
|
+
validation?: string;
|
|
378
|
+
options?: string[];
|
|
379
|
+
}>, layoutDescription: string, cozeToken: string, onStreamUpdate?: (content: string, isComplete: boolean) => void, conversationId?: string) => Promise<{
|
|
380
|
+
code: string;
|
|
381
|
+
conversationId: string;
|
|
382
|
+
}>;
|
|
383
|
+
/**
|
|
384
|
+
* 验证模型 JSON 是否有效
|
|
385
|
+
*/
|
|
386
|
+
export declare const validateTrainingModel: (data: any) => {
|
|
387
|
+
valid: boolean;
|
|
388
|
+
errors: string[];
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* 保存模型到 localStorage
|
|
392
|
+
*/
|
|
393
|
+
export declare const saveModelToStorage: (model: TrainingModel) => void;
|
|
394
|
+
/**
|
|
395
|
+
* 从 localStorage 加载模型列表
|
|
396
|
+
*/
|
|
397
|
+
export declare const loadModelsFromStorage: () => TrainingModel[];
|
|
398
|
+
/**
|
|
399
|
+
* 从 localStorage 删除模型
|
|
400
|
+
*/
|
|
401
|
+
export declare const deleteModelFromStorage: (modelId: string) => void;
|
|
402
|
+
/**
|
|
403
|
+
* 导出模型为 JSON 文件
|
|
404
|
+
*/
|
|
405
|
+
export declare const exportModelToJson: (model: TrainingModel) => void;
|
|
406
|
+
/**
|
|
407
|
+
* 从 JSON 文件导入模型
|
|
408
|
+
*/
|
|
409
|
+
export declare const importModelFromJson: (file: File) => Promise<TrainingModel>;
|
|
410
|
+
export declare function inferFieldUsages(stepTaskPackages: StepTaskPackage[], stageContracts?: StageContract[]): Map<string, FieldUsage[]>;
|
|
411
|
+
export declare function flattenDeclaredFieldPaths(fields: CaseSchemaField[], parentPath?: string): string[];
|
|
412
|
+
/**
|
|
413
|
+
* CaseSchema 字段归一化(落地前规范化 + 去重)。
|
|
414
|
+
*
|
|
415
|
+
* 生成端会从三处写入 declaredFields(环节一/三的 AI、环节二 fieldSuggestions、autoRepair 回填),
|
|
416
|
+
* 且提示词历史上允许「平铺叶子」与「object+children」两种等价写法、数组又被拍成 .0./.1. 下标,
|
|
417
|
+
* 导致存储态自相矛盾(同路径重复声明、混用约定)。本函数把所有形态统一规整为唯一的「嵌套树」:
|
|
418
|
+
* - object 用 children,子字段 path 只写叶子段;
|
|
419
|
+
* - array 用 children 描述「元素结构」(不枚举下标,元素边界 [] 由完整路径表达);
|
|
420
|
+
* - 同一逻辑路径只保留一条,元数据(label/purpose/maxLength/enumValues/usage/rule)合并。
|
|
421
|
+
*/
|
|
422
|
+
export declare function canonicalizeSchemaFields(fields: CaseSchemaField[]): CaseSchemaField[];
|
|
423
|
+
export declare function formatMissingFieldReferencesMessage(missingRefs: string[]): string;
|
|
424
|
+
export declare function formatUnsupportedTemplateExpressionsMessage(expressions: string[]): string;
|
|
425
|
+
export declare function validateFieldReferencesAgainstSchema(stages: Stage[], declaredFields: CaseSchemaField[]): {
|
|
426
|
+
missingRefs: string[];
|
|
427
|
+
unsupportedExpressions: string[];
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* 自动修复缺失的字段声明:扫描 initData 中的 {字段路径} 引用,
|
|
431
|
+
* 将未在 declaredFields 中声明的叶子路径自动补齐为扁平条目。
|
|
432
|
+
* 避免因 AI 遗漏声明或 children 路径格式错误而触发不必要的重试。
|
|
433
|
+
*/
|
|
434
|
+
export declare function autoRepairMissingFieldDeclarations(stages: Stage[], declaredFields: CaseSchemaField[]): {
|
|
435
|
+
repairedFields: CaseSchemaField[];
|
|
436
|
+
autoAdded: string[];
|
|
437
|
+
};
|
|
438
|
+
export interface GenerateCaseVariantPackagesParams {
|
|
439
|
+
domain: string;
|
|
440
|
+
businessType: string;
|
|
441
|
+
targetPosition: string;
|
|
442
|
+
stages: Stage[];
|
|
443
|
+
caseSchema: CaseSchema;
|
|
444
|
+
learningObjectives?: string;
|
|
445
|
+
trainingLevel?: string;
|
|
446
|
+
conversationId?: string;
|
|
447
|
+
cozeToken: string;
|
|
448
|
+
}
|
|
449
|
+
export declare const generateCaseVariantPackages: (params: GenerateCaseVariantPackagesParams) => Promise<{
|
|
450
|
+
caseVariantPackages: CaseVariantPackageOption[];
|
|
451
|
+
conversationId?: string;
|
|
452
|
+
}>;
|
|
453
|
+
/**
|
|
454
|
+
* 生成 AI 推荐选项
|
|
455
|
+
* 用于分步创建器的基础信息推荐(业务类型/目标岗位/学习目标/实训类型/思政元素)
|
|
456
|
+
*
|
|
457
|
+
* @param type - 选项类型
|
|
458
|
+
* @param context - 上下文数据
|
|
459
|
+
* @param cozeToken - Coze API Token
|
|
460
|
+
* @param onStreamUpdate - 流式更新回调
|
|
461
|
+
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 共享子组件:StringListEditor、KeyValueEditor
|
|
3
|
+
* 从 InitDataEditors.tsx 提取,供多个编辑器复用
|
|
4
|
+
*/
|
|
5
|
+
import React from "react";
|
|
6
|
+
import type { CaseSchema } from "@shared/types/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* 字符串列表编辑器(Select mode="tags")
|
|
9
|
+
*/
|
|
10
|
+
export declare const StringListEditor: React.FC<{
|
|
11
|
+
value: string[];
|
|
12
|
+
onChange: (val: string[]) => void;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* 键值对编辑器
|
|
17
|
+
*/
|
|
18
|
+
export declare const KeyValueEditor: React.FC<{
|
|
19
|
+
value: Record<string, any>;
|
|
20
|
+
onChange: (val: Record<string, any>) => void;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* 案例字段结构编辑器
|
|
24
|
+
*/
|
|
25
|
+
interface CaseSchemaEditorProps {
|
|
26
|
+
value: CaseSchema;
|
|
27
|
+
onChange: (value: CaseSchema) => void;
|
|
28
|
+
showConstraints?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const CaseSchemaEditor: React.FC<CaseSchemaEditorProps>;
|
|
31
|
+
export {};
|