helixlife-expert-cli 0.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 +159 -0
- package/cli/bin/helixlife-expert.js +3 -0
- package/cli/dist/core/api/client.d.ts +31 -0
- package/cli/dist/core/api/client.d.ts.map +1 -0
- package/cli/dist/core/api/client.js +183 -0
- package/cli/dist/core/api/client.js.map +1 -0
- package/cli/dist/core/api/http.d.ts +3 -0
- package/cli/dist/core/api/http.d.ts.map +1 -0
- package/cli/dist/core/api/http.js +22 -0
- package/cli/dist/core/api/http.js.map +1 -0
- package/cli/dist/core/api/response.d.ts +48 -0
- package/cli/dist/core/api/response.d.ts.map +1 -0
- package/cli/dist/core/api/response.js +84 -0
- package/cli/dist/core/api/response.js.map +1 -0
- package/cli/dist/core/api/sse.d.ts +6 -0
- package/cli/dist/core/api/sse.d.ts.map +1 -0
- package/cli/dist/core/api/sse.js +60 -0
- package/cli/dist/core/api/sse.js.map +1 -0
- package/cli/dist/core/auth/index.d.ts +35 -0
- package/cli/dist/core/auth/index.d.ts.map +1 -0
- package/cli/dist/core/auth/index.js +150 -0
- package/cli/dist/core/auth/index.js.map +1 -0
- package/cli/dist/core/env-config.d.ts +16 -0
- package/cli/dist/core/env-config.d.ts.map +1 -0
- package/cli/dist/core/env-config.js +80 -0
- package/cli/dist/core/env-config.js.map +1 -0
- package/cli/dist/core/errors.d.ts +20 -0
- package/cli/dist/core/errors.d.ts.map +1 -0
- package/cli/dist/core/errors.js +28 -0
- package/cli/dist/core/errors.js.map +1 -0
- package/cli/dist/core/index.d.ts +16 -0
- package/cli/dist/core/index.d.ts.map +1 -0
- package/cli/dist/core/index.js +16 -0
- package/cli/dist/core/index.js.map +1 -0
- package/cli/dist/core/interactive.d.ts +18 -0
- package/cli/dist/core/interactive.d.ts.map +1 -0
- package/cli/dist/core/interactive.js +74 -0
- package/cli/dist/core/interactive.js.map +1 -0
- package/cli/dist/core/output/index.d.ts +29 -0
- package/cli/dist/core/output/index.d.ts.map +1 -0
- package/cli/dist/core/output/index.js +153 -0
- package/cli/dist/core/output/index.js.map +1 -0
- package/cli/dist/core/parse.d.ts +9 -0
- package/cli/dist/core/parse.d.ts.map +1 -0
- package/cli/dist/core/parse.js +31 -0
- package/cli/dist/core/parse.js.map +1 -0
- package/cli/dist/core/paths.d.ts +21 -0
- package/cli/dist/core/paths.d.ts.map +1 -0
- package/cli/dist/core/paths.js +65 -0
- package/cli/dist/core/paths.js.map +1 -0
- package/cli/dist/core/sse-utils.d.ts +49 -0
- package/cli/dist/core/sse-utils.d.ts.map +1 -0
- package/cli/dist/core/sse-utils.js +181 -0
- package/cli/dist/core/sse-utils.js.map +1 -0
- package/cli/dist/core/terminal.d.ts +2 -0
- package/cli/dist/core/terminal.d.ts.map +1 -0
- package/cli/dist/core/terminal.js +6 -0
- package/cli/dist/core/terminal.js.map +1 -0
- package/cli/dist/core/token/index.d.ts +5 -0
- package/cli/dist/core/token/index.d.ts.map +1 -0
- package/cli/dist/core/token/index.js +26 -0
- package/cli/dist/core/token/index.js.map +1 -0
- package/cli/dist/core/types/config.d.ts +8 -0
- package/cli/dist/core/types/config.d.ts.map +1 -0
- package/cli/dist/core/types/config.js +30 -0
- package/cli/dist/core/types/config.js.map +1 -0
- package/cli/dist/core/version.d.ts +2 -0
- package/cli/dist/core/version.d.ts.map +1 -0
- package/cli/dist/core/version.js +10 -0
- package/cli/dist/core/version.js.map +1 -0
- package/cli/dist/index.d.ts +2 -0
- package/cli/dist/index.d.ts.map +1 -0
- package/cli/dist/index.js +23 -0
- package/cli/dist/index.js.map +1 -0
- package/cli/dist/modules/analysis/constants.d.ts +3 -0
- package/cli/dist/modules/analysis/constants.d.ts.map +1 -0
- package/cli/dist/modules/analysis/constants.js +3 -0
- package/cli/dist/modules/analysis/constants.js.map +1 -0
- package/cli/dist/modules/analysis/index.d.ts +3 -0
- package/cli/dist/modules/analysis/index.d.ts.map +1 -0
- package/cli/dist/modules/analysis/index.js +23 -0
- package/cli/dist/modules/analysis/index.js.map +1 -0
- package/cli/dist/modules/auth/index.d.ts +3 -0
- package/cli/dist/modules/auth/index.d.ts.map +1 -0
- package/cli/dist/modules/auth/index.js +76 -0
- package/cli/dist/modules/auth/index.js.map +1 -0
- package/cli/dist/modules/expert-scaffold.d.ts +27 -0
- package/cli/dist/modules/expert-scaffold.d.ts.map +1 -0
- package/cli/dist/modules/expert-scaffold.js +25 -0
- package/cli/dist/modules/expert-scaffold.js.map +1 -0
- package/cli/dist/modules/fund/clinical/apps.d.ts +19 -0
- package/cli/dist/modules/fund/clinical/apps.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/apps.js +14 -0
- package/cli/dist/modules/fund/clinical/apps.js.map +1 -0
- package/cli/dist/modules/fund/clinical/command-utils.d.ts +4 -0
- package/cli/dist/modules/fund/clinical/command-utils.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/command-utils.js +40 -0
- package/cli/dist/modules/fund/clinical/command-utils.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/article-create.d.ts +9 -0
- package/cli/dist/modules/fund/clinical/commands/article-create.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/article-create.js +99 -0
- package/cli/dist/modules/fund/clinical/commands/article-create.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/article-download.d.ts +30 -0
- package/cli/dist/modules/fund/clinical/commands/article-download.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/article-download.js +153 -0
- package/cli/dist/modules/fund/clinical/commands/article-download.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-create.d.ts +7 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-create.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-create.js +81 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-create.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-precheck.d.ts +7 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-precheck.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-precheck.js +76 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-precheck.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-update.d.ts +16 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-update.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-update.js +108 -0
- package/cli/dist/modules/fund/clinical/commands/four-elements-update.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/sample-size.d.ts +14 -0
- package/cli/dist/modules/fund/clinical/commands/sample-size.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/sample-size.js +164 -0
- package/cli/dist/modules/fund/clinical/commands/sample-size.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-create.d.ts +25 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-create.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-create.js +228 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-create.js.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-parameters.d.ts +45 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-parameters.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-parameters.js +211 -0
- package/cli/dist/modules/fund/clinical/commands/topic-evaluation-parameters.js.map +1 -0
- package/cli/dist/modules/fund/clinical/constants.d.ts +85 -0
- package/cli/dist/modules/fund/clinical/constants.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/constants.js +161 -0
- package/cli/dist/modules/fund/clinical/constants.js.map +1 -0
- package/cli/dist/modules/fund/clinical/form-rules.d.ts +56 -0
- package/cli/dist/modules/fund/clinical/form-rules.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/form-rules.js +542 -0
- package/cli/dist/modules/fund/clinical/form-rules.js.map +1 -0
- package/cli/dist/modules/fund/clinical/four-elements.d.ts +46 -0
- package/cli/dist/modules/fund/clinical/four-elements.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/four-elements.js +190 -0
- package/cli/dist/modules/fund/clinical/four-elements.js.map +1 -0
- package/cli/dist/modules/fund/clinical/index.d.ts +3 -0
- package/cli/dist/modules/fund/clinical/index.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/index.js +176 -0
- package/cli/dist/modules/fund/clinical/index.js.map +1 -0
- package/cli/dist/modules/fund/clinical/parameters.d.ts +51 -0
- package/cli/dist/modules/fund/clinical/parameters.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/parameters.js +145 -0
- package/cli/dist/modules/fund/clinical/parameters.js.map +1 -0
- package/cli/dist/modules/fund/clinical/sample-size.d.ts +130 -0
- package/cli/dist/modules/fund/clinical/sample-size.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/sample-size.js +356 -0
- package/cli/dist/modules/fund/clinical/sample-size.js.map +1 -0
- package/cli/dist/modules/fund/clinical/session-cache.d.ts +25 -0
- package/cli/dist/modules/fund/clinical/session-cache.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/session-cache.js +100 -0
- package/cli/dist/modules/fund/clinical/session-cache.js.map +1 -0
- package/cli/dist/modules/fund/clinical/sse-utils.d.ts +22 -0
- package/cli/dist/modules/fund/clinical/sse-utils.d.ts.map +1 -0
- package/cli/dist/modules/fund/clinical/sse-utils.js +80 -0
- package/cli/dist/modules/fund/clinical/sse-utils.js.map +1 -0
- package/cli/dist/modules/fund/constants.d.ts +3 -0
- package/cli/dist/modules/fund/constants.d.ts.map +1 -0
- package/cli/dist/modules/fund/constants.js +3 -0
- package/cli/dist/modules/fund/constants.js.map +1 -0
- package/cli/dist/modules/fund/index.d.ts +3 -0
- package/cli/dist/modules/fund/index.d.ts.map +1 -0
- package/cli/dist/modules/fund/index.js +28 -0
- package/cli/dist/modules/fund/index.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/apps.d.ts +54 -0
- package/cli/dist/modules/fund/nsfc/apps.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/apps.js +76 -0
- package/cli/dist/modules/fund/nsfc/apps.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/article-cache.d.ts +14 -0
- package/cli/dist/modules/fund/nsfc/article-cache.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/article-cache.js +79 -0
- package/cli/dist/modules/fund/nsfc/article-cache.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/article-create.d.ts +8 -0
- package/cli/dist/modules/fund/nsfc/commands/article-create.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/article-create.js +108 -0
- package/cli/dist/modules/fund/nsfc/commands/article-create.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/article-download.d.ts +42 -0
- package/cli/dist/modules/fund/nsfc/commands/article-download.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/article-download.js +189 -0
- package/cli/dist/modules/fund/nsfc/commands/article-download.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/format-convert.d.ts +9 -0
- package/cli/dist/modules/fund/nsfc/commands/format-convert.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/format-convert.js +98 -0
- package/cli/dist/modules/fund/nsfc/commands/format-convert.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-analyze.d.ts +12 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-analyze.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-analyze.js +351 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-analyze.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-create.d.ts +21 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-create.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-create.js +197 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-create.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-figure.d.ts +9 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-figure.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-figure.js +120 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-figure.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-genes-select.d.ts +11 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-genes-select.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-genes-select.js +125 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-genes-select.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-pick.d.ts +11 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-pick.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-pick.js +109 -0
- package/cli/dist/modules/fund/nsfc/commands/hypothesis-pick.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-confirm.d.ts +9 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-confirm.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-confirm.js +64 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-confirm.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-create.d.ts +8 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-create.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-create.js +103 -0
- package/cli/dist/modules/fund/nsfc/commands/outline-create.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/research-path-confirm.d.ts +9 -0
- package/cli/dist/modules/fund/nsfc/commands/research-path-confirm.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/research-path-confirm.js +176 -0
- package/cli/dist/modules/fund/nsfc/commands/research-path-confirm.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/tech-roadmap.d.ts +9 -0
- package/cli/dist/modules/fund/nsfc/commands/tech-roadmap.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/commands/tech-roadmap.js +190 -0
- package/cli/dist/modules/fund/nsfc/commands/tech-roadmap.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/constants.d.ts +96 -0
- package/cli/dist/modules/fund/nsfc/constants.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/constants.js +156 -0
- package/cli/dist/modules/fund/nsfc/constants.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/graph-render.d.ts +25 -0
- package/cli/dist/modules/fund/nsfc/graph-render.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/graph-render.js +212 -0
- package/cli/dist/modules/fund/nsfc/graph-render.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/index.d.ts +4 -0
- package/cli/dist/modules/fund/nsfc/index.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/index.js +238 -0
- package/cli/dist/modules/fund/nsfc/index.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/mermaid-render.d.ts +18 -0
- package/cli/dist/modules/fund/nsfc/mermaid-render.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/mermaid-render.js +47 -0
- package/cli/dist/modules/fund/nsfc/mermaid-render.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/parse-hypothesis.d.ts +76 -0
- package/cli/dist/modules/fund/nsfc/parse-hypothesis.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/parse-hypothesis.js +278 -0
- package/cli/dist/modules/fund/nsfc/parse-hypothesis.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/parse-outline.d.ts +23 -0
- package/cli/dist/modules/fund/nsfc/parse-outline.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/parse-outline.js +91 -0
- package/cli/dist/modules/fund/nsfc/parse-outline.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/png-watermark.d.ts +24 -0
- package/cli/dist/modules/fund/nsfc/png-watermark.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/png-watermark.js +78 -0
- package/cli/dist/modules/fund/nsfc/png-watermark.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/prompt-hypothesis.d.ts +20 -0
- package/cli/dist/modules/fund/nsfc/prompt-hypothesis.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/prompt-hypothesis.js +107 -0
- package/cli/dist/modules/fund/nsfc/prompt-hypothesis.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/prompt-step2.d.ts +18 -0
- package/cli/dist/modules/fund/nsfc/prompt-step2.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/prompt-step2.js +107 -0
- package/cli/dist/modules/fund/nsfc/prompt-step2.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/request-body.d.ts +47 -0
- package/cli/dist/modules/fund/nsfc/request-body.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/request-body.js +38 -0
- package/cli/dist/modules/fund/nsfc/request-body.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/session-cache.d.ts +48 -0
- package/cli/dist/modules/fund/nsfc/session-cache.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/session-cache.js +90 -0
- package/cli/dist/modules/fund/nsfc/session-cache.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/sse-utils.d.ts +22 -0
- package/cli/dist/modules/fund/nsfc/sse-utils.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/sse-utils.js +81 -0
- package/cli/dist/modules/fund/nsfc/sse-utils.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/upload.d.ts +3 -0
- package/cli/dist/modules/fund/nsfc/upload.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/upload.js +59 -0
- package/cli/dist/modules/fund/nsfc/upload.js.map +1 -0
- package/cli/dist/modules/fund/nsfc/validate.d.ts +30 -0
- package/cli/dist/modules/fund/nsfc/validate.d.ts.map +1 -0
- package/cli/dist/modules/fund/nsfc/validate.js +91 -0
- package/cli/dist/modules/fund/nsfc/validate.js.map +1 -0
- package/cli/dist/modules/literature/commands/workflow-list.d.ts +5 -0
- package/cli/dist/modules/literature/commands/workflow-list.d.ts.map +1 -0
- package/cli/dist/modules/literature/commands/workflow-list.js +9 -0
- package/cli/dist/modules/literature/commands/workflow-list.js.map +1 -0
- package/cli/dist/modules/literature/commands/workflow-params.d.ts +6 -0
- package/cli/dist/modules/literature/commands/workflow-params.d.ts.map +1 -0
- package/cli/dist/modules/literature/commands/workflow-params.js +9 -0
- package/cli/dist/modules/literature/commands/workflow-params.js.map +1 -0
- package/cli/dist/modules/literature/commands/workflow-run.d.ts +7 -0
- package/cli/dist/modules/literature/commands/workflow-run.d.ts.map +1 -0
- package/cli/dist/modules/literature/commands/workflow-run.js +10 -0
- package/cli/dist/modules/literature/commands/workflow-run.js.map +1 -0
- package/cli/dist/modules/literature/constants.d.ts +20 -0
- package/cli/dist/modules/literature/constants.d.ts.map +1 -0
- package/cli/dist/modules/literature/constants.js +56 -0
- package/cli/dist/modules/literature/constants.js.map +1 -0
- package/cli/dist/modules/literature/index.d.ts +3 -0
- package/cli/dist/modules/literature/index.d.ts.map +1 -0
- package/cli/dist/modules/literature/index.js +63 -0
- package/cli/dist/modules/literature/index.js.map +1 -0
- package/cli/dist/modules/meta/analysis.d.ts +127 -0
- package/cli/dist/modules/meta/analysis.d.ts.map +1 -0
- package/cli/dist/modules/meta/analysis.js +1165 -0
- package/cli/dist/modules/meta/analysis.js.map +1 -0
- package/cli/dist/modules/meta/api.d.ts +11 -0
- package/cli/dist/modules/meta/api.d.ts.map +1 -0
- package/cli/dist/modules/meta/api.js +40 -0
- package/cli/dist/modules/meta/api.js.map +1 -0
- package/cli/dist/modules/meta/commands.d.ts +3 -0
- package/cli/dist/modules/meta/commands.d.ts.map +1 -0
- package/cli/dist/modules/meta/commands.js +1185 -0
- package/cli/dist/modules/meta/commands.js.map +1 -0
- package/cli/dist/modules/meta/constants.d.ts +8 -0
- package/cli/dist/modules/meta/constants.d.ts.map +1 -0
- package/cli/dist/modules/meta/constants.js +9 -0
- package/cli/dist/modules/meta/constants.js.map +1 -0
- package/cli/dist/modules/meta/extraction.d.ts +206 -0
- package/cli/dist/modules/meta/extraction.d.ts.map +1 -0
- package/cli/dist/modules/meta/extraction.js +1248 -0
- package/cli/dist/modules/meta/extraction.js.map +1 -0
- package/cli/dist/modules/meta/index.d.ts +3 -0
- package/cli/dist/modules/meta/index.d.ts.map +1 -0
- package/cli/dist/modules/meta/index.js +19 -0
- package/cli/dist/modules/meta/index.js.map +1 -0
- package/cli/dist/modules/meta/node.d.ts +70 -0
- package/cli/dist/modules/meta/node.d.ts.map +1 -0
- package/cli/dist/modules/meta/node.js +167 -0
- package/cli/dist/modules/meta/node.js.map +1 -0
- package/cli/dist/modules/meta/plot-params.d.ts +82 -0
- package/cli/dist/modules/meta/plot-params.d.ts.map +1 -0
- package/cli/dist/modules/meta/plot-params.js +1179 -0
- package/cli/dist/modules/meta/plot-params.js.map +1 -0
- package/cli/dist/modules/meta/prisma-flow-docx.d.ts +23 -0
- package/cli/dist/modules/meta/prisma-flow-docx.d.ts.map +1 -0
- package/cli/dist/modules/meta/prisma-flow-docx.js +302 -0
- package/cli/dist/modules/meta/prisma-flow-docx.js.map +1 -0
- package/cli/dist/modules/meta/retrieve.d.ts +113 -0
- package/cli/dist/modules/meta/retrieve.d.ts.map +1 -0
- package/cli/dist/modules/meta/retrieve.js +913 -0
- package/cli/dist/modules/meta/retrieve.js.map +1 -0
- package/cli/dist/modules/meta/screening.d.ts +179 -0
- package/cli/dist/modules/meta/screening.d.ts.map +1 -0
- package/cli/dist/modules/meta/screening.js +1255 -0
- package/cli/dist/modules/meta/screening.js.map +1 -0
- package/cli/dist/modules/meta/topic.d.ts +110 -0
- package/cli/dist/modules/meta/topic.d.ts.map +1 -0
- package/cli/dist/modules/meta/topic.js +865 -0
- package/cli/dist/modules/meta/topic.js.map +1 -0
- package/cli/dist/modules/meta/types.d.ts +49 -0
- package/cli/dist/modules/meta/types.d.ts.map +1 -0
- package/cli/dist/modules/meta/types.js +2 -0
- package/cli/dist/modules/meta/types.js.map +1 -0
- package/cli/dist/modules/meta/workflow.d.ts +154 -0
- package/cli/dist/modules/meta/workflow.d.ts.map +1 -0
- package/cli/dist/modules/meta/workflow.js +956 -0
- package/cli/dist/modules/meta/workflow.js.map +1 -0
- package/cli/dist/modules/meta/writing.d.ts +83 -0
- package/cli/dist/modules/meta/writing.d.ts.map +1 -0
- package/cli/dist/modules/meta/writing.js +1077 -0
- package/cli/dist/modules/meta/writing.js.map +1 -0
- package/cli/dist/modules/proposal/artifacts.d.ts +18 -0
- package/cli/dist/modules/proposal/artifacts.d.ts.map +1 -0
- package/cli/dist/modules/proposal/artifacts.js +43 -0
- package/cli/dist/modules/proposal/artifacts.js.map +1 -0
- package/cli/dist/modules/proposal/commands/basic-create.d.ts +22 -0
- package/cli/dist/modules/proposal/commands/basic-create.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/basic-create.js +81 -0
- package/cli/dist/modules/proposal/commands/basic-create.js.map +1 -0
- package/cli/dist/modules/proposal/commands/basic-result.d.ts +24 -0
- package/cli/dist/modules/proposal/commands/basic-result.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/basic-result.js +96 -0
- package/cli/dist/modules/proposal/commands/basic-result.js.map +1 -0
- package/cli/dist/modules/proposal/commands/bioinfo-params.d.ts +5 -0
- package/cli/dist/modules/proposal/commands/bioinfo-params.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/bioinfo-params.js +9 -0
- package/cli/dist/modules/proposal/commands/bioinfo-params.js.map +1 -0
- package/cli/dist/modules/proposal/commands/bioinfo-run.d.ts +6 -0
- package/cli/dist/modules/proposal/commands/bioinfo-run.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/bioinfo-run.js +10 -0
- package/cli/dist/modules/proposal/commands/bioinfo-run.js.map +1 -0
- package/cli/dist/modules/proposal/commands/clinical-list.d.ts +5 -0
- package/cli/dist/modules/proposal/commands/clinical-list.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/clinical-list.js +9 -0
- package/cli/dist/modules/proposal/commands/clinical-list.js.map +1 -0
- package/cli/dist/modules/proposal/commands/clinical-params.d.ts +6 -0
- package/cli/dist/modules/proposal/commands/clinical-params.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/clinical-params.js +9 -0
- package/cli/dist/modules/proposal/commands/clinical-params.js.map +1 -0
- package/cli/dist/modules/proposal/commands/clinical-run.d.ts +7 -0
- package/cli/dist/modules/proposal/commands/clinical-run.d.ts.map +1 -0
- package/cli/dist/modules/proposal/commands/clinical-run.js +10 -0
- package/cli/dist/modules/proposal/commands/clinical-run.js.map +1 -0
- package/cli/dist/modules/proposal/constants.d.ts +34 -0
- package/cli/dist/modules/proposal/constants.d.ts.map +1 -0
- package/cli/dist/modules/proposal/constants.js +75 -0
- package/cli/dist/modules/proposal/constants.js.map +1 -0
- package/cli/dist/modules/proposal/index.d.ts +3 -0
- package/cli/dist/modules/proposal/index.d.ts.map +1 -0
- package/cli/dist/modules/proposal/index.js +95 -0
- package/cli/dist/modules/proposal/index.js.map +1 -0
- package/cli/dist/modules/proposal/newidea-env.d.ts +28 -0
- package/cli/dist/modules/proposal/newidea-env.d.ts.map +1 -0
- package/cli/dist/modules/proposal/newidea-env.js +69 -0
- package/cli/dist/modules/proposal/newidea-env.js.map +1 -0
- package/cli/dist/modules/proposal/newidea-runner.d.ts +25 -0
- package/cli/dist/modules/proposal/newidea-runner.d.ts.map +1 -0
- package/cli/dist/modules/proposal/newidea-runner.js +158 -0
- package/cli/dist/modules/proposal/newidea-runner.js.map +1 -0
- package/cli/dist/modules/proposal/parse.d.ts +25 -0
- package/cli/dist/modules/proposal/parse.d.ts.map +1 -0
- package/cli/dist/modules/proposal/parse.js +173 -0
- package/cli/dist/modules/proposal/parse.js.map +1 -0
- package/cli/dist/modules/sci/apps.d.ts +48 -0
- package/cli/dist/modules/sci/apps.d.ts.map +1 -0
- package/cli/dist/modules/sci/apps.js +43 -0
- package/cli/dist/modules/sci/apps.js.map +1 -0
- package/cli/dist/modules/sci/article-cache.d.ts +32 -0
- package/cli/dist/modules/sci/article-cache.d.ts.map +1 -0
- package/cli/dist/modules/sci/article-cache.js +163 -0
- package/cli/dist/modules/sci/article-cache.js.map +1 -0
- package/cli/dist/modules/sci/article-validate.d.ts +11 -0
- package/cli/dist/modules/sci/article-validate.d.ts.map +1 -0
- package/cli/dist/modules/sci/article-validate.js +43 -0
- package/cli/dist/modules/sci/article-validate.js.map +1 -0
- package/cli/dist/modules/sci/commands/article-create.d.ts +46 -0
- package/cli/dist/modules/sci/commands/article-create.d.ts.map +1 -0
- package/cli/dist/modules/sci/commands/article-create.js +315 -0
- package/cli/dist/modules/sci/commands/article-create.js.map +1 -0
- package/cli/dist/modules/sci/commands/article-download.d.ts +50 -0
- package/cli/dist/modules/sci/commands/article-download.d.ts.map +1 -0
- package/cli/dist/modules/sci/commands/article-download.js +281 -0
- package/cli/dist/modules/sci/commands/article-download.js.map +1 -0
- package/cli/dist/modules/sci/commands/outline.d.ts +36 -0
- package/cli/dist/modules/sci/commands/outline.d.ts.map +1 -0
- package/cli/dist/modules/sci/commands/outline.js +491 -0
- package/cli/dist/modules/sci/commands/outline.js.map +1 -0
- package/cli/dist/modules/sci/commands/template.d.ts +9 -0
- package/cli/dist/modules/sci/commands/template.d.ts.map +1 -0
- package/cli/dist/modules/sci/commands/template.js +12 -0
- package/cli/dist/modules/sci/commands/template.js.map +1 -0
- package/cli/dist/modules/sci/commands.d.ts +3 -0
- package/cli/dist/modules/sci/commands.d.ts.map +1 -0
- package/cli/dist/modules/sci/commands.js +108 -0
- package/cli/dist/modules/sci/commands.js.map +1 -0
- package/cli/dist/modules/sci/constants.d.ts +117 -0
- package/cli/dist/modules/sci/constants.d.ts.map +1 -0
- package/cli/dist/modules/sci/constants.js +152 -0
- package/cli/dist/modules/sci/constants.js.map +1 -0
- package/cli/dist/modules/sci/content-source.d.ts +18 -0
- package/cli/dist/modules/sci/content-source.d.ts.map +1 -0
- package/cli/dist/modules/sci/content-source.js +54 -0
- package/cli/dist/modules/sci/content-source.js.map +1 -0
- package/cli/dist/modules/sci/index.d.ts +3 -0
- package/cli/dist/modules/sci/index.d.ts.map +1 -0
- package/cli/dist/modules/sci/index.js +19 -0
- package/cli/dist/modules/sci/index.js.map +1 -0
- package/cli/dist/modules/sci/outline-transform.d.ts +16 -0
- package/cli/dist/modules/sci/outline-transform.d.ts.map +1 -0
- package/cli/dist/modules/sci/outline-transform.js +67 -0
- package/cli/dist/modules/sci/outline-transform.js.map +1 -0
- package/cli/dist/modules/sci/precheck-cache.d.ts +23 -0
- package/cli/dist/modules/sci/precheck-cache.d.ts.map +1 -0
- package/cli/dist/modules/sci/precheck-cache.js +141 -0
- package/cli/dist/modules/sci/precheck-cache.js.map +1 -0
- package/cli/dist/modules/sci/prompt-article.d.ts +12 -0
- package/cli/dist/modules/sci/prompt-article.d.ts.map +1 -0
- package/cli/dist/modules/sci/prompt-article.js +37 -0
- package/cli/dist/modules/sci/prompt-article.js.map +1 -0
- package/cli/dist/modules/sci/prompt-precheck.d.ts +16 -0
- package/cli/dist/modules/sci/prompt-precheck.d.ts.map +1 -0
- package/cli/dist/modules/sci/prompt-precheck.js +61 -0
- package/cli/dist/modules/sci/prompt-precheck.js.map +1 -0
- package/cli/dist/modules/sci/sse-utils.d.ts +50 -0
- package/cli/dist/modules/sci/sse-utils.d.ts.map +1 -0
- package/cli/dist/modules/sci/sse-utils.js +207 -0
- package/cli/dist/modules/sci/sse-utils.js.map +1 -0
- package/cli/dist/modules/shared/result-wrapper.d.ts +71 -0
- package/cli/dist/modules/shared/result-wrapper.d.ts.map +1 -0
- package/cli/dist/modules/shared/result-wrapper.js +95 -0
- package/cli/dist/modules/shared/result-wrapper.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/api.d.ts +6 -0
- package/cli/dist/modules/shared/workflow-app/api.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/api.js +31 -0
- package/cli/dist/modules/shared/workflow-app/api.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/command.d.ts +30 -0
- package/cli/dist/modules/shared/workflow-app/command.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/command.js +183 -0
- package/cli/dist/modules/shared/workflow-app/command.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/constants.d.ts +12 -0
- package/cli/dist/modules/shared/workflow-app/constants.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/constants.js +21 -0
- package/cli/dist/modules/shared/workflow-app/constants.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/form.d.ts +21 -0
- package/cli/dist/modules/shared/workflow-app/form.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/form.js +123 -0
- package/cli/dist/modules/shared/workflow-app/form.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/index.d.ts +8 -0
- package/cli/dist/modules/shared/workflow-app/index.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/index.js +7 -0
- package/cli/dist/modules/shared/workflow-app/index.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/run.d.ts +15 -0
- package/cli/dist/modules/shared/workflow-app/run.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/run.js +71 -0
- package/cli/dist/modules/shared/workflow-app/run.js.map +1 -0
- package/cli/dist/modules/shared/workflow-app/types.d.ts +74 -0
- package/cli/dist/modules/shared/workflow-app/types.d.ts.map +1 -0
- package/cli/dist/modules/shared/workflow-app/types.js +3 -0
- package/cli/dist/modules/shared/workflow-app/types.js.map +1 -0
- package/cli/dist/modules/site-configs.d.ts +4 -0
- package/cli/dist/modules/site-configs.d.ts.map +1 -0
- package/cli/dist/modules/site-configs.js +21 -0
- package/cli/dist/modules/site-configs.js.map +1 -0
- package/cli/dist/modules/upgrade/index.d.ts +6 -0
- package/cli/dist/modules/upgrade/index.d.ts.map +1 -0
- package/cli/dist/modules/upgrade/index.js +105 -0
- package/cli/dist/modules/upgrade/index.js.map +1 -0
- package/cli/dist/program.d.ts +3 -0
- package/cli/dist/program.d.ts.map +1 -0
- package/cli/dist/program.js +69 -0
- package/cli/dist/program.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { createFormatLogger, helixlifeError, helixlifeErrorCode, printOutput, } from "../../../../core/index.js";
|
|
2
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
3
|
+
import { CLINICAL_EXECUTE_API_PATH, CLINICAL_SAMPLE_CALCULATION_APP_ID, CLINICAL_WORKFLOW_APP_TYPE, } from "../constants.js";
|
|
4
|
+
import { buildSampleParameterTable, buildSampleSizeWorkflowInputs, calculationParametersToItems, fetchCalculationParametersTree, getNextCategoryOptions, initialSampleParameterValues, resolveCalculationCategoryPath, validateSampleParameters, } from "../sample-size.js";
|
|
5
|
+
import { readClinicalStringMap } from "../command-utils.js";
|
|
6
|
+
import { buildClinicalWorkflowBody } from "../apps.js";
|
|
7
|
+
import { streamClinicalWorkflow } from "../sse-utils.js";
|
|
8
|
+
import { canEditFourElementsDesign } from "../four-elements.js";
|
|
9
|
+
import { invalidateClinicalPrecheck, requireClinicalSession, updateClinicalSession, } from "../session-cache.js";
|
|
10
|
+
const SAMPLE_OPTION_DISPLAY = {
|
|
11
|
+
preserveOrder: true,
|
|
12
|
+
forbidRecommendLabel: true,
|
|
13
|
+
useLabelAsIs: true,
|
|
14
|
+
};
|
|
15
|
+
export async function runSampleSizeParameters(options) {
|
|
16
|
+
const format = options.format ?? "markdown";
|
|
17
|
+
const path = options.path?.map((value) => value.trim()).filter(Boolean) ?? [];
|
|
18
|
+
const roots = await fetchCalculationParametersTree();
|
|
19
|
+
const resolved = resolveCalculationCategoryPath(roots, path);
|
|
20
|
+
if (resolved.nodes.length !== path.length) {
|
|
21
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "样本量分类路径无效,请按 parameters 返回的 id 逐级选择");
|
|
22
|
+
}
|
|
23
|
+
const nextOptions = getNextCategoryOptions(roots, path);
|
|
24
|
+
const items = resolved.leaf
|
|
25
|
+
? calculationParametersToItems(resolved.leaf.cr_calculation_parameters ?? [])
|
|
26
|
+
: [];
|
|
27
|
+
const defaults = initialSampleParameterValues(items);
|
|
28
|
+
const parameterTable = resolved.leaf
|
|
29
|
+
? buildSampleParameterTable(items, defaults)
|
|
30
|
+
: undefined;
|
|
31
|
+
const result = {
|
|
32
|
+
status: "sample_parameters_ready",
|
|
33
|
+
nextAction: resolved.leaf
|
|
34
|
+
? "fill_sample_parameters"
|
|
35
|
+
: "select_sample_category",
|
|
36
|
+
selectedPath: resolved.nodes.map((node) => ({
|
|
37
|
+
id: node.id,
|
|
38
|
+
label: node.name,
|
|
39
|
+
})),
|
|
40
|
+
level: path.length + (resolved.leaf ? 0 : 1),
|
|
41
|
+
options: nextOptions,
|
|
42
|
+
optionDisplay: SAMPLE_OPTION_DISPLAY,
|
|
43
|
+
parameters: items,
|
|
44
|
+
defaults,
|
|
45
|
+
...(parameterTable ? { parameterTable } : {}),
|
|
46
|
+
};
|
|
47
|
+
if (format === "json") {
|
|
48
|
+
printOutput(wrapWorkbenchResult(result, {
|
|
49
|
+
step: "sample-size",
|
|
50
|
+
subType: "clinical",
|
|
51
|
+
}), "json");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const log = createFormatLogger(format);
|
|
55
|
+
if (resolved.leaf && parameterTable) {
|
|
56
|
+
log(`\n样本量场景:${resolved.nodes.map((node) => node.name).join(" → ")}\n`);
|
|
57
|
+
log("| 计算参数 | 参数解释 | 参数设定值 |");
|
|
58
|
+
log("| --- | --- | --- |");
|
|
59
|
+
for (const row of parameterTable.rows) {
|
|
60
|
+
log(`| ${row.计算参数} | ${row.参数解释 || "-"} | ${row.参数设定值 || "-"} |`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
log(`\n请选择第 ${path.length + 1} 级分类(按接口顺序原样展示,禁止加推荐):\n`);
|
|
65
|
+
for (const option of nextOptions) {
|
|
66
|
+
log(`- ${option.label} (${option.id})${option.description ? `:${option.description}` : ""}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export async function runCalculateSampleSize(options) {
|
|
71
|
+
const format = options.format ?? "markdown";
|
|
72
|
+
const path = options.path?.map((value) => value.trim()).filter(Boolean) ?? [];
|
|
73
|
+
if (!path.length || !options.paramsFile) {
|
|
74
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请提供完整 --path 和 --params-file");
|
|
75
|
+
}
|
|
76
|
+
const session = await requireClinicalSession(options.sessionId);
|
|
77
|
+
const roots = await fetchCalculationParametersTree();
|
|
78
|
+
const resolved = resolveCalculationCategoryPath(roots, path);
|
|
79
|
+
if (resolved.nodes.length !== path.length || !resolved.leaf) {
|
|
80
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "样本量分类路径必须指向含计算参数的叶子分类");
|
|
81
|
+
}
|
|
82
|
+
const items = calculationParametersToItems(resolved.leaf.cr_calculation_parameters ?? []);
|
|
83
|
+
const values = await readClinicalStringMap(options.paramsFile, "样本量参数文件");
|
|
84
|
+
const errors = validateSampleParameters(items, values);
|
|
85
|
+
if (Object.keys(errors).length > 0) {
|
|
86
|
+
const result = {
|
|
87
|
+
status: "validation_failed",
|
|
88
|
+
nextAction: "fix_inputs",
|
|
89
|
+
errors,
|
|
90
|
+
firstErrorMessage: Object.entries(errors)[0]
|
|
91
|
+
? `${Object.entries(errors)[0][0]}:${Object.entries(errors)[0][1]}`
|
|
92
|
+
: "",
|
|
93
|
+
};
|
|
94
|
+
if (format === "json") {
|
|
95
|
+
printOutput(wrapWorkbenchResult(result, {
|
|
96
|
+
step: "sample-size",
|
|
97
|
+
subType: "clinical",
|
|
98
|
+
}, { sessionId: session.sessionId }), "json");
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const log = createFormatLogger(format);
|
|
102
|
+
log("\n样本量参数校验失败:");
|
|
103
|
+
for (const [key, message] of Object.entries(errors)) {
|
|
104
|
+
log(`- ${key}:${message}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const labels = resolved.nodes.map((node) => node.name);
|
|
110
|
+
const inputs = buildSampleSizeWorkflowInputs(items, values, labels);
|
|
111
|
+
const body = buildClinicalWorkflowBody({
|
|
112
|
+
appId: CLINICAL_SAMPLE_CALCULATION_APP_ID,
|
|
113
|
+
appName: "样本量计算",
|
|
114
|
+
appType: CLINICAL_WORKFLOW_APP_TYPE,
|
|
115
|
+
inputs,
|
|
116
|
+
});
|
|
117
|
+
const stream = await streamClinicalWorkflow({
|
|
118
|
+
path: CLINICAL_EXECUTE_API_PATH,
|
|
119
|
+
body,
|
|
120
|
+
format,
|
|
121
|
+
startLabel: "正在计算样本量...",
|
|
122
|
+
progressLabel: "样本量计算中",
|
|
123
|
+
finishLabel: "样本量计算完成",
|
|
124
|
+
failureMessage: "样本量计算失败,请稍后重试",
|
|
125
|
+
emptyMessage: "样本量计算结果为空",
|
|
126
|
+
allowEmptyText: true,
|
|
127
|
+
});
|
|
128
|
+
const outputs = stream.outputs ?? {};
|
|
129
|
+
const resultText = String(outputs.result ?? "").trim();
|
|
130
|
+
const paramText = String(outputs.param_text ?? "").trim();
|
|
131
|
+
const reference = String(outputs.reference ?? "").trim();
|
|
132
|
+
const rSource = String(outputs.R_source ?? "").trim();
|
|
133
|
+
if (!resultText) {
|
|
134
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, "样本量工作流未返回 result");
|
|
135
|
+
}
|
|
136
|
+
const sampleParam = `${resultText}\n${rSource}\n${paramText}`.trim();
|
|
137
|
+
const draft = {
|
|
138
|
+
...session.draft,
|
|
139
|
+
sample: resultText,
|
|
140
|
+
sampleParam,
|
|
141
|
+
};
|
|
142
|
+
await updateClinicalSession(session, invalidateClinicalPrecheck(session, draft));
|
|
143
|
+
const result = {
|
|
144
|
+
status: "sample_calculated",
|
|
145
|
+
nextAction: "review_or_precheck",
|
|
146
|
+
categoryPath: labels,
|
|
147
|
+
sample: resultText,
|
|
148
|
+
sampleParam,
|
|
149
|
+
reference,
|
|
150
|
+
rSource,
|
|
151
|
+
designEditableFields: draft.designEditableFields,
|
|
152
|
+
canEditDesign: canEditFourElementsDesign(draft),
|
|
153
|
+
};
|
|
154
|
+
if (format === "json") {
|
|
155
|
+
printOutput(wrapWorkbenchResult(result, { step: "sample-size", subType: "clinical" }, {
|
|
156
|
+
sessionId: session.sessionId,
|
|
157
|
+
workflowRunId: stream.workflowRunId,
|
|
158
|
+
cacheReady: true,
|
|
159
|
+
}), "json");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
createFormatLogger(format)(`\n## 样本量计算\n\n${resultText}\n`);
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=sample-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample-size.js","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/sample-size.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,WAAW,GAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,sBAAsB,EACtB,4BAA4B,EAC5B,8BAA8B,EAC9B,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,yBAAyB,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MAAM,IAAI,cAAc,CACtB,kBAAkB,CAAC,gBAAgB,EACnC,kBAAkB,CACnB,CAAC;IACJ,CAAC;IACD,MAAM,WAAW,GAAG,GAAG,UAAU,KAAK,OAAO,KAAK,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC;IACrE,MAAM,KAAK,GAAG;QACZ,GAAG,OAAO,CAAC,KAAK;QAChB,MAAM,EAAE,UAAU;QAClB,WAAW;KACZ,CAAC;IACF,MAAM,qBAAqB,CACzB,OAAO,EACP,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAC3C,CAAC;IACF,MAAM,MAAM,GAAG;QACb,MAAM,EAAE,mBAAmB;QAC3B,UAAU,EAAE,oBAAoB;QAChC,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,UAAU;QAClB,WAAW;QACX,SAAS;QACT,OAAO;QACP,oBAAoB,EAAE,KAAK,CAAC,oBAAoB;QAChD,aAAa,EAAE,yBAAyB,CAAC,KAAK,CAAC;KAChD,CAAC;IACF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,WAAW,CACT,mBAAmB,CACjB,MAAM,EACN,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,EAC5C;YACA,SAAS,EAAE,OAAO,CAAC,SAAS;YAC1B,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,UAAU,EAAE,IAAI;SACjB,CACF,EACD,MAAM,CACP,CAAC;QACF,OAAO;IACT,CAAC;IACD,kBAAkB,CAAC,MAAM,CAAC,CAAC,iBAAiB,UAAU,IAAI,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
import { type ClinicalStep1NextAction, type ClinicalStep1Status } from "../constants.js";
|
|
3
|
+
export interface CreateTopicEvaluationOptions {
|
|
4
|
+
inputsFile?: string;
|
|
5
|
+
inputs?: string;
|
|
6
|
+
researchObjective?: string;
|
|
7
|
+
yes?: boolean;
|
|
8
|
+
format?: OutputFormat;
|
|
9
|
+
}
|
|
10
|
+
export interface TopicEvaluationCreateResult {
|
|
11
|
+
status: ClinicalStep1Status;
|
|
12
|
+
nextAction: ClinicalStep1NextAction;
|
|
13
|
+
researchObjective: string;
|
|
14
|
+
inputs: Record<string, string>;
|
|
15
|
+
outcome?: "success" | "failed";
|
|
16
|
+
content?: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
errors?: Record<string, string>;
|
|
19
|
+
firstErrorMessage?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 临床选题评估完整流程(Step1)
|
|
23
|
+
*/
|
|
24
|
+
export declare function runCreateTopicEvaluation(options?: CreateTopicEvaluationOptions): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=topic-evaluation-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-evaluation-create.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/topic-evaluation-create.ts"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EASL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAEzB,MAAM,iBAAiB,CAAC;AAsBzB,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,EAAE,uBAAuB,CAAC;IACpC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAyID;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,IAAI,CAAC,CA6If"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// Step1 选题评估:采集表单 → 校验 → 调预检工作流(topic_evaluation)→ 返回预检结果
|
|
2
|
+
// 对齐源码 helix-workbench-platform/src/pages/ClinicalTopicEvaluation.tsx
|
|
3
|
+
import { helixlifeError, helixlifeErrorCode, isInteractiveTerminal, printOutput, createInteractiveInterface, askOptionWithRl, createFormatLogger, } from "../../../../core/index.js";
|
|
4
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
5
|
+
import { CLINICAL_TOPIC_EVALUATION_APP_ID, CLINICAL_TOPIC_EVALUATION_APP_TYPE, CLINICAL_EXECUTE_API_PATH, RESEARCH_OBJECTIVE_KEY, YES_NO_SEGMENTED_FIELD_KEYS, normalizeYesNoFieldValue, parseClinicalResearchObjective, } from "../constants.js";
|
|
6
|
+
import { fetchClinicalTopicEvaluationFieldsWithFallback, } from "../parameters.js";
|
|
7
|
+
import { applyTopicEvaluationDisplayOrder, buildTopicEvaluationTitle, getEffectiveFieldRequired, getEffectiveSelectOptions, getFieldDisplayName, getTopicEvaluationFieldPlaceholder, normalizeSingleEffectiveSelectValues, pickNonEmptyTopicEvaluationFieldValues, shouldShowField, validateTopicEvaluationForm, parseTopicEvaluationOutputs, } from "../form-rules.js";
|
|
8
|
+
import { buildClinicalWorkflowBody } from "../apps.js";
|
|
9
|
+
import { streamClinicalWorkflow } from "../sse-utils.js";
|
|
10
|
+
import { readClinicalStringMap } from "../command-utils.js";
|
|
11
|
+
function printStep1Json(data, handoff) {
|
|
12
|
+
printOutput(wrapWorkbenchResult(data, { step: "topic-evaluation", subType: "clinical" }, handoff), "json");
|
|
13
|
+
}
|
|
14
|
+
/** 读取 inputs JSON 文件 */
|
|
15
|
+
async function readInputsFile(path) {
|
|
16
|
+
return readClinicalStringMap(path, " inputs 文件");
|
|
17
|
+
}
|
|
18
|
+
/** 解析内联 inputs JSON */
|
|
19
|
+
function parseInlineInputs(raw) {
|
|
20
|
+
let parsed;
|
|
21
|
+
try {
|
|
22
|
+
parsed = JSON.parse(raw);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "--inputs 不是合法 JSON");
|
|
26
|
+
}
|
|
27
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
28
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "--inputs 须为 JSON 对象");
|
|
29
|
+
}
|
|
30
|
+
const result = {};
|
|
31
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
32
|
+
result[key] = value == null ? "" : String(value);
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
/** 交互式逐字段采集 */
|
|
37
|
+
async function promptFields(fields, initialInputs) {
|
|
38
|
+
const inputs = { ...initialInputs };
|
|
39
|
+
const researchObjective = inputs[RESEARCH_OBJECTIVE_KEY];
|
|
40
|
+
const assessPrognosis = inputs["Assess_prognosis"];
|
|
41
|
+
const ordered = applyTopicEvaluationDisplayOrder(fields, researchObjective);
|
|
42
|
+
const visible = ordered.filter((field) => shouldShowField(field.key, inputs, researchObjective, assessPrognosis));
|
|
43
|
+
const rl = createInteractiveInterface();
|
|
44
|
+
try {
|
|
45
|
+
for (const field of visible) {
|
|
46
|
+
const effectiveOptions = getEffectiveSelectOptions(field.key, field, inputs);
|
|
47
|
+
const displayName = getFieldDisplayName(field, researchObjective);
|
|
48
|
+
const isYesNo = YES_NO_SEGMENTED_FIELD_KEYS.has(field.key);
|
|
49
|
+
if (field.type === "select" || isYesNo) {
|
|
50
|
+
const options = isYesNo ? ["是", "否"] : effectiveOptions;
|
|
51
|
+
if (options.length === 0) {
|
|
52
|
+
// 无可选选项,跳过
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (options.length === 1) {
|
|
56
|
+
inputs[field.key] = options[0];
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const currentValue = isYesNo && inputs[field.key]
|
|
60
|
+
? normalizeYesNoFieldValue(inputs[field.key])
|
|
61
|
+
: inputs[field.key] || options[0] || "";
|
|
62
|
+
const selected = await askOptionWithRl(rl, displayName, options, currentValue, (_value, index) => `${index + 1}) ${options[index]}`);
|
|
63
|
+
inputs[field.key] = selected;
|
|
64
|
+
// 选中 Research_Objective 后,重新计算后续显隐与排序
|
|
65
|
+
if (field.key === RESEARCH_OBJECTIVE_KEY) {
|
|
66
|
+
return promptFields(fields, inputs);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
// paragraph / string / number:自由输入
|
|
71
|
+
const placeholder = getTopicEvaluationFieldPlaceholder(field.key, researchObjective);
|
|
72
|
+
const required = getEffectiveFieldRequired(field, inputs, true);
|
|
73
|
+
const prompt = `${displayName}${required ? "(必填)" : "(非必填)"}${placeholder ? ` [${placeholder}]` : ""}\n> `;
|
|
74
|
+
const answer = (await rl.question(prompt)).trim();
|
|
75
|
+
inputs[field.key] = answer;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
rl.close();
|
|
81
|
+
}
|
|
82
|
+
return inputs;
|
|
83
|
+
}
|
|
84
|
+
/** 运行预检工作流(topic_evaluation app) */
|
|
85
|
+
async function runPrecheckWorkflow(inputs, format) {
|
|
86
|
+
const body = buildClinicalWorkflowBody({
|
|
87
|
+
query: "",
|
|
88
|
+
inputs: pickNonEmptyTopicEvaluationFieldValues(inputs),
|
|
89
|
+
appId: CLINICAL_TOPIC_EVALUATION_APP_ID,
|
|
90
|
+
appName: "选题评估",
|
|
91
|
+
appType: CLINICAL_TOPIC_EVALUATION_APP_TYPE,
|
|
92
|
+
});
|
|
93
|
+
const stream = await streamClinicalWorkflow({
|
|
94
|
+
path: CLINICAL_EXECUTE_API_PATH,
|
|
95
|
+
body,
|
|
96
|
+
format,
|
|
97
|
+
startLabel: "正在进行选题评估预检,请稍候...",
|
|
98
|
+
progressLabel: "预检评估中...",
|
|
99
|
+
finishLabel: "预检完成",
|
|
100
|
+
failureMessage: "预检失败,请稍后重试",
|
|
101
|
+
emptyMessage: "预检未返回有效结果,请稍后重试",
|
|
102
|
+
allowEmptyText: true,
|
|
103
|
+
});
|
|
104
|
+
const parsed = parseTopicEvaluationOutputs(stream.outputs ?? {});
|
|
105
|
+
return {
|
|
106
|
+
outcome: parsed.outcome,
|
|
107
|
+
content: parsed.content,
|
|
108
|
+
workflowRunId: stream.workflowRunId,
|
|
109
|
+
elapsedTime: stream.elapsedTime,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 临床选题评估完整流程(Step1)
|
|
114
|
+
*/
|
|
115
|
+
export async function runCreateTopicEvaluation(options = {}) {
|
|
116
|
+
const format = options.format ?? "markdown";
|
|
117
|
+
const interactive = isInteractiveTerminal() && !options.yes;
|
|
118
|
+
const log = createFormatLogger(format);
|
|
119
|
+
// 1. 拉取字段定义
|
|
120
|
+
const { fields, fallback } = await fetchClinicalTopicEvaluationFieldsWithFallback();
|
|
121
|
+
if (fallback) {
|
|
122
|
+
log("\n⚠️ 未能从后端拉取选题评估参数,已使用内置字段定义兜底。\n");
|
|
123
|
+
}
|
|
124
|
+
// 2. 解析 inputs
|
|
125
|
+
let inputs = {};
|
|
126
|
+
if (options.inputsFile && options.inputs) {
|
|
127
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "不能同时使用 --inputs-file 与 --inputs,请二选一");
|
|
128
|
+
}
|
|
129
|
+
if (options.inputsFile) {
|
|
130
|
+
inputs = await readInputsFile(options.inputsFile);
|
|
131
|
+
}
|
|
132
|
+
else if (options.inputs) {
|
|
133
|
+
inputs = parseInlineInputs(options.inputs);
|
|
134
|
+
}
|
|
135
|
+
if (options.researchObjective) {
|
|
136
|
+
inputs[RESEARCH_OBJECTIVE_KEY] = parseClinicalResearchObjective(options.researchObjective);
|
|
137
|
+
}
|
|
138
|
+
// 3. 交互式补齐 / 非交互校验
|
|
139
|
+
if (interactive) {
|
|
140
|
+
log("\n=== Step 1: 选题评估 ===\n");
|
|
141
|
+
inputs = await promptFields(fields, inputs);
|
|
142
|
+
}
|
|
143
|
+
// 对齐页面联动:裁剪后只剩一个选项时自动回落到该值。
|
|
144
|
+
inputs = normalizeSingleEffectiveSelectValues(fields, inputs).values;
|
|
145
|
+
const researchObjective = inputs[RESEARCH_OBJECTIVE_KEY];
|
|
146
|
+
if (!researchObjective) {
|
|
147
|
+
if (interactive) {
|
|
148
|
+
// 交互模式理论上已采集,兜底
|
|
149
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "缺少研究类别(Research_Objective),请重新填写");
|
|
150
|
+
}
|
|
151
|
+
// 非交互:输出校验失败
|
|
152
|
+
printStep1Json({
|
|
153
|
+
status: "validation_failed",
|
|
154
|
+
nextAction: "fix_inputs",
|
|
155
|
+
researchObjective: "",
|
|
156
|
+
inputs,
|
|
157
|
+
errors: { [RESEARCH_OBJECTIVE_KEY]: "缺少必填字段:研究类别(Research_Objective)" },
|
|
158
|
+
firstErrorMessage: "缺少必填字段:研究类别(Research_Objective)",
|
|
159
|
+
});
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
// 4. 计算可见字段并校验
|
|
163
|
+
const ordered = applyTopicEvaluationDisplayOrder(fields, researchObjective);
|
|
164
|
+
const assessPrognosis = inputs["Assess_prognosis"];
|
|
165
|
+
const visibleFields = ordered.filter((field) => shouldShowField(field.key, inputs, researchObjective, assessPrognosis));
|
|
166
|
+
const validationResult = validateTopicEvaluationForm(visibleFields, inputs);
|
|
167
|
+
if (!validationResult.ok) {
|
|
168
|
+
if (format === "json") {
|
|
169
|
+
printStep1Json({
|
|
170
|
+
status: "validation_failed",
|
|
171
|
+
nextAction: "fix_inputs",
|
|
172
|
+
researchObjective,
|
|
173
|
+
inputs,
|
|
174
|
+
errors: validationResult.errors,
|
|
175
|
+
firstErrorMessage: validationResult.firstMessage,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
log("\n❌ 校验未通过,无法调用预检工作流:\n");
|
|
180
|
+
for (const [, msg] of Object.entries(validationResult.errors)) {
|
|
181
|
+
log(`- ${msg}`);
|
|
182
|
+
}
|
|
183
|
+
log("\n请补全上述必填项后重新执行。\n");
|
|
184
|
+
}
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const validInputs = validationResult.values;
|
|
188
|
+
const title = buildTopicEvaluationTitle(validInputs);
|
|
189
|
+
// 5. 直接调用预检工作流;网页临床流程不创建订单
|
|
190
|
+
log("\n接口正在处理中,请耐心等待...");
|
|
191
|
+
const precheck = await runPrecheckWorkflow(validInputs, format);
|
|
192
|
+
// 6. 输出结果
|
|
193
|
+
const status = precheck.outcome === "success" ? "precheck_success" : "precheck_failed";
|
|
194
|
+
const nextAction = precheck.outcome === "success" ? "proceed_to_four_elements" : "revise_inputs";
|
|
195
|
+
const result = {
|
|
196
|
+
status,
|
|
197
|
+
nextAction,
|
|
198
|
+
researchObjective,
|
|
199
|
+
inputs: validInputs,
|
|
200
|
+
outcome: precheck.outcome,
|
|
201
|
+
content: precheck.content,
|
|
202
|
+
title,
|
|
203
|
+
};
|
|
204
|
+
if (format === "json") {
|
|
205
|
+
printStep1Json(result, {
|
|
206
|
+
workflowRunId: precheck.workflowRunId,
|
|
207
|
+
});
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (precheck.outcome === "success") {
|
|
211
|
+
log("\n✅ 预检成功:无缺失信息,格式与内容审核通过。\n");
|
|
212
|
+
if (title) {
|
|
213
|
+
log(`\n${title}\n`);
|
|
214
|
+
}
|
|
215
|
+
if (precheck.content?.trim()) {
|
|
216
|
+
log(`\n${precheck.content}\n`);
|
|
217
|
+
}
|
|
218
|
+
log("\n第 1 步(选题评估)已完成,可进入第 2 步:确认四要素。\n");
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
log("\n❌ 预检失败:根据预检分析,当前内容不符合提交规范,请修改后重新预检。\n");
|
|
222
|
+
if (precheck.content?.trim()) {
|
|
223
|
+
log(`\n${precheck.content}\n`);
|
|
224
|
+
}
|
|
225
|
+
log("\n请调整输入内容后重新执行 topic-evaluation create。\n");
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=topic-evaluation-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-evaluation-create.js","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/topic-evaluation-create.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,sEAAsE;AACtE,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,0BAA0B,EAC1B,eAAe,EACf,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,gCAAgC,EAChC,kCAAkC,EAClC,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,8BAA8B,GAK/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,8CAA8C,GAC/C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gCAAgC,EAChC,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,kCAAkC,EAElC,oCAAoC,EACpC,sCAAsC,EACtC,eAAe,EACf,2BAA2B,EAC3B,2BAA2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,GAAG,CAAC,yCAAyC,CAAC,CAAC;QAC/C,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;YAC7B,GAAG,CAAC,KAAK,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,GAAG,CAAC,2CAA2C,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
import { fieldToParameterItem } from "../parameters.js";
|
|
3
|
+
import { type TopicEvaluationField } from "../constants.js";
|
|
4
|
+
export interface RunTopicEvaluationParametersOptions {
|
|
5
|
+
format?: OutputFormat;
|
|
6
|
+
}
|
|
7
|
+
export interface TopicEvaluationEffectiveScenario {
|
|
8
|
+
autoSelected: Record<string, string>;
|
|
9
|
+
fields: ReturnType<typeof fieldToParameterItem>[];
|
|
10
|
+
}
|
|
11
|
+
export interface TopicEvaluationLinkageDelta {
|
|
12
|
+
autoSelected: Record<string, string>;
|
|
13
|
+
optionOverrides: Record<string, string[]>;
|
|
14
|
+
requiredOverrides: Record<string, boolean>;
|
|
15
|
+
/** 相对父节点变化的输入框 placeholder(对齐网页) */
|
|
16
|
+
placeholderOverrides: Record<string, string>;
|
|
17
|
+
/** 相对父节点变化的展示名(如诊断下 I → 待评价的诊断实验) */
|
|
18
|
+
nameOverrides: Record<string, string>;
|
|
19
|
+
/** 相对父节点变化的完整自由文本提问句 */
|
|
20
|
+
promptOverrides: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export interface TopicEvaluationVisibilityVariant extends TopicEvaluationLinkageDelta {
|
|
23
|
+
value: string;
|
|
24
|
+
hiddenFieldKeys: string[];
|
|
25
|
+
shownFieldKeys: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface TopicEvaluationStudyDesignLinkage extends TopicEvaluationLinkageDelta {
|
|
28
|
+
value: string;
|
|
29
|
+
assessPrognosisVariants: TopicEvaluationVisibilityVariant[];
|
|
30
|
+
}
|
|
31
|
+
export interface TopicEvaluationObjectiveLinkage extends TopicEvaluationLinkageDelta {
|
|
32
|
+
value: string;
|
|
33
|
+
fieldKeys: string[];
|
|
34
|
+
studyDesigns: TopicEvaluationStudyDesignLinkage[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 一次性预计算网页中的全部固定联动分支,并只输出相对父节点的差量。
|
|
38
|
+
* Agent 首次拉取后只需在该树中按用户选择向下匹配,不再调用 parameters。
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildTopicEvaluationLinkage(fields: TopicEvaluationField[]): {
|
|
41
|
+
researchObjectiveOptions: string[];
|
|
42
|
+
objectives: TopicEvaluationObjectiveLinkage[];
|
|
43
|
+
};
|
|
44
|
+
export declare function runTopicEvaluationParameters(options?: RunTopicEvaluationParametersOptions): Promise<void>;
|
|
45
|
+
//# sourceMappingURL=topic-evaluation-parameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topic-evaluation-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/topic-evaluation-parameters.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,iBAAiB,CAAC;AASzB,MAAM,WAAW,mCAAmC;IAClD,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,gCAAgC;IAC/C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,eAAe,EAAE,MAAM,CAAC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