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,153 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, extname, join } from "node:path";
|
|
3
|
+
import { ApiClient, getDefaultNewideaBaseUrl, getUserDownloadsDir, helixlifeError, helixlifeErrorCode, printOutput, resolveUserPath, sanitizeFilename, } from "../../../../core/index.js";
|
|
4
|
+
import { CLINICAL_CONTENT_PRODUCER, CLINICAL_DOCX_CONVERT_API_PATH, } from "../constants.js";
|
|
5
|
+
import { loadClinicalSession, popClinicalSession, } from "../session-cache.js";
|
|
6
|
+
const DEFAULT_TITLE = "未命名";
|
|
7
|
+
function cleanMarkdownInline(value) {
|
|
8
|
+
return value
|
|
9
|
+
.replace(/^\*{1,2}|\*{1,2}$/g, "")
|
|
10
|
+
.replace(/^项目名称\s*[::]\s*/, "")
|
|
11
|
+
.trim();
|
|
12
|
+
}
|
|
13
|
+
/** 对齐网页标题语义:项目名称/标题/Title 优先,否则首个有效 H1。 */
|
|
14
|
+
export function extractClinicalArticleTitle(markdown) {
|
|
15
|
+
const lines = markdown.split(/\r?\n/);
|
|
16
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
17
|
+
const line = lines[index].trim();
|
|
18
|
+
if (!line)
|
|
19
|
+
continue;
|
|
20
|
+
const labeled = line.match(/^(?:#{1,6}\s*)?(?:项目名称|标题|Title)\s*[::]\s*(.+)$/i);
|
|
21
|
+
if (labeled?.[1])
|
|
22
|
+
return cleanMarkdownInline(labeled[1]);
|
|
23
|
+
const heading = line.match(/^#(?!#)\s+(.+)$/);
|
|
24
|
+
if (!heading)
|
|
25
|
+
continue;
|
|
26
|
+
const text = cleanMarkdownInline(heading[1]);
|
|
27
|
+
if (!/^(?:项目名称|标题|Title)$/i.test(text))
|
|
28
|
+
return text;
|
|
29
|
+
for (let next = index + 1; next < lines.length; next += 1) {
|
|
30
|
+
const candidate = lines[next].trim();
|
|
31
|
+
if (!candidate)
|
|
32
|
+
continue;
|
|
33
|
+
if (/^#{1,6}\s+/.test(candidate))
|
|
34
|
+
break;
|
|
35
|
+
return cleanMarkdownInline(candidate);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return DEFAULT_TITLE;
|
|
39
|
+
}
|
|
40
|
+
export function appendClinicalReferences(article, references) {
|
|
41
|
+
const filtered = references.map((item) => item.trim()).filter(Boolean);
|
|
42
|
+
if (!filtered.length)
|
|
43
|
+
return `${article.trim()}\n`;
|
|
44
|
+
return `${article.trim()}\n\n## 参考文献\n\n${filtered.join("\n")}\n`;
|
|
45
|
+
}
|
|
46
|
+
function toSafeBasename(title) {
|
|
47
|
+
const safe = sanitizeFilename(title || DEFAULT_TITLE, { maxLength: 80 });
|
|
48
|
+
return safe.replace(/\.[A-Za-z0-9]{1,8}$/, "") || DEFAULT_TITLE;
|
|
49
|
+
}
|
|
50
|
+
export function resolveClinicalDownloadPaths(output, title) {
|
|
51
|
+
const filename = `${toSafeBasename(title)}.docx`;
|
|
52
|
+
let docxPath;
|
|
53
|
+
if (output) {
|
|
54
|
+
const resolved = resolveUserPath(output);
|
|
55
|
+
docxPath = extname(resolved) ? resolved : join(resolved, filename);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
docxPath = join(getUserDownloadsDir(), filename);
|
|
59
|
+
}
|
|
60
|
+
const extension = extname(docxPath);
|
|
61
|
+
const mdPath = extension
|
|
62
|
+
? `${docxPath.slice(0, -extension.length)}.md`
|
|
63
|
+
: `${docxPath}.md`;
|
|
64
|
+
return { docxPath, mdPath };
|
|
65
|
+
}
|
|
66
|
+
async function readReferencesFile(path) {
|
|
67
|
+
if (!path)
|
|
68
|
+
return [];
|
|
69
|
+
try {
|
|
70
|
+
const parsed = JSON.parse(await readFile(resolveUserPath(path), "utf8"));
|
|
71
|
+
if (!Array.isArray(parsed))
|
|
72
|
+
throw new Error("顶层必须是 JSON 数组");
|
|
73
|
+
return parsed
|
|
74
|
+
.filter((item) => typeof item === "string")
|
|
75
|
+
.map((item) => item.trim())
|
|
76
|
+
.filter(Boolean);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `无法读取参考文献文件: ${error.message}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export async function downloadClinicalArticleDocx(markdown, produceId) {
|
|
83
|
+
const form = new FormData();
|
|
84
|
+
form.append("data", new Blob([markdown], { type: "text/plain" }), "blob");
|
|
85
|
+
form.append("is_aigc", "true");
|
|
86
|
+
form.append("content_producer", CLINICAL_CONTENT_PRODUCER);
|
|
87
|
+
form.append("produce_id", produceId);
|
|
88
|
+
form.append("csl_key", "");
|
|
89
|
+
const client = new ApiClient();
|
|
90
|
+
return client.requestBinary(CLINICAL_DOCX_CONVERT_API_PATH, {
|
|
91
|
+
method: "POST",
|
|
92
|
+
baseUrl: getDefaultNewideaBaseUrl(),
|
|
93
|
+
body: form,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export async function runDownloadClinicalArticle(options) {
|
|
97
|
+
if (options.sessionId && options.file) {
|
|
98
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "--session-id 与 --file 互斥,请二选一");
|
|
99
|
+
}
|
|
100
|
+
let article = "";
|
|
101
|
+
let references = [];
|
|
102
|
+
let produceId = options.produceId?.trim() ?? "";
|
|
103
|
+
let consumeSessionId;
|
|
104
|
+
if (options.sessionId) {
|
|
105
|
+
const session = await loadClinicalSession(options.sessionId);
|
|
106
|
+
if (!session?.article?.article) {
|
|
107
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "全文缓存缺失或已清理,请重新生成全文,或通过 --file 提供 Markdown");
|
|
108
|
+
}
|
|
109
|
+
article = session.article.article;
|
|
110
|
+
references = session.article.references;
|
|
111
|
+
produceId ||= session.article.workflowRunId ?? "";
|
|
112
|
+
consumeSessionId = session.sessionId;
|
|
113
|
+
}
|
|
114
|
+
else if (options.file) {
|
|
115
|
+
try {
|
|
116
|
+
article = await readFile(resolveUserPath(options.file), "utf8");
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `无法读取全文文件: ${error.message}`);
|
|
120
|
+
}
|
|
121
|
+
references = await readReferencesFile(options.referencesFile);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请通过 --session-id 命中全文缓存,或通过 --file 提供 Markdown");
|
|
125
|
+
}
|
|
126
|
+
const markdown = appendClinicalReferences(article, references);
|
|
127
|
+
const title = extractClinicalArticleTitle(markdown);
|
|
128
|
+
const paths = resolveClinicalDownloadPaths(options.output, title);
|
|
129
|
+
const { buffer, contentType } = await downloadClinicalArticleDocx(markdown, produceId);
|
|
130
|
+
await mkdir(dirname(paths.docxPath), { recursive: true });
|
|
131
|
+
await writeFile(paths.docxPath, buffer);
|
|
132
|
+
const mdBuffer = Buffer.from(markdown, "utf8");
|
|
133
|
+
await writeFile(paths.mdPath, mdBuffer);
|
|
134
|
+
if (consumeSessionId)
|
|
135
|
+
await popClinicalSession(consumeSessionId);
|
|
136
|
+
const result = {
|
|
137
|
+
mdPath: paths.mdPath,
|
|
138
|
+
mdSize: mdBuffer.byteLength,
|
|
139
|
+
docxPath: paths.docxPath,
|
|
140
|
+
docxSize: buffer.byteLength,
|
|
141
|
+
contentType,
|
|
142
|
+
filename: `${toSafeBasename(title)}.docx`,
|
|
143
|
+
};
|
|
144
|
+
if (options.format === "json") {
|
|
145
|
+
printOutput(result, "json");
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
console.log(`全文 Markdown 已保存: ${result.mdPath} (${result.mdSize} 字节)`);
|
|
149
|
+
console.log(`全文 Word 已保存: ${result.docxPath} (${result.docxSize} 字节)`);
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=article-download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-download.js","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/article-download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,SAAS,EACT,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAoB7B,MAAM,aAAa,GAAG,KAAK,CAAC;AAE5B,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK;SACT,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;SACjC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;SAC9B,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,2BAA2B,CAAC,QAAgB;IAC1D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAE,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,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CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,MAAM,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface CreateFourElementsOptions {
|
|
3
|
+
inputsFile?: string;
|
|
4
|
+
format?: OutputFormat;
|
|
5
|
+
}
|
|
6
|
+
export declare function runCreateFourElements(options: CreateFourElementsOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=four-elements-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"four-elements-create.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/four-elements-create.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAmBnC,MAAM,WAAW,yBAAyB;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CA0Ff"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { createFormatLogger, helixlifeError, helixlifeErrorCode, printOutput, } from "../../../../core/index.js";
|
|
3
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
4
|
+
import { CLINICAL_EXECUTE_API_PATH, CLINICAL_FOUR_ELEMENTS_APP_IDS, CLINICAL_WORKFLOW_APP_TYPE, parseClinicalResearchObjective, } from "../constants.js";
|
|
5
|
+
import { buildClinicalWorkflowBody } from "../apps.js";
|
|
6
|
+
import { streamClinicalWorkflow } from "../sse-utils.js";
|
|
7
|
+
import { EMPTY_CLINICAL_FOUR_ELEMENTS_DRAFT, canEditFourElementsDesign, mergeClinicalFourElementsDraft, validateFourElementsDraft, } from "../four-elements.js";
|
|
8
|
+
import { readClinicalStringMap } from "../command-utils.js";
|
|
9
|
+
import { saveClinicalSession } from "../session-cache.js";
|
|
10
|
+
export async function runCreateFourElements(options) {
|
|
11
|
+
const format = options.format ?? "markdown";
|
|
12
|
+
const log = createFormatLogger(format);
|
|
13
|
+
if (!options.inputsFile) {
|
|
14
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请提供包含 Step1 data.inputs 的 --inputs-file");
|
|
15
|
+
}
|
|
16
|
+
const topicInputs = await readClinicalStringMap(options.inputsFile, "Step1 inputs 文件");
|
|
17
|
+
const researchObjective = parseClinicalResearchObjective(topicInputs.Research_Objective ?? "");
|
|
18
|
+
const appId = CLINICAL_FOUR_ELEMENTS_APP_IDS[researchObjective];
|
|
19
|
+
const body = buildClinicalWorkflowBody({
|
|
20
|
+
appId,
|
|
21
|
+
appName: `${researchObjective}-四要素校验`,
|
|
22
|
+
appType: CLINICAL_WORKFLOW_APP_TYPE,
|
|
23
|
+
inputs: topicInputs,
|
|
24
|
+
});
|
|
25
|
+
const stream = await streamClinicalWorkflow({
|
|
26
|
+
path: CLINICAL_EXECUTE_API_PATH,
|
|
27
|
+
body,
|
|
28
|
+
format,
|
|
29
|
+
startLabel: "正在生成四要素...",
|
|
30
|
+
progressLabel: "四要素生成中",
|
|
31
|
+
finishLabel: "四要素生成完成",
|
|
32
|
+
failureMessage: "四要素生成失败,请稍后重试",
|
|
33
|
+
emptyMessage: "四要素生成结果为空",
|
|
34
|
+
allowEmptyText: true,
|
|
35
|
+
});
|
|
36
|
+
const draft = mergeClinicalFourElementsDraft(EMPTY_CLINICAL_FOUR_ELEMENTS_DRAFT, stream.outputs ?? {});
|
|
37
|
+
const missing = validateFourElementsDraft(draft);
|
|
38
|
+
if (Object.keys(missing).length > 0) {
|
|
39
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, `四要素工作流返回不完整:${Object.values(missing).join(";")}`);
|
|
40
|
+
}
|
|
41
|
+
const sessionId = randomUUID();
|
|
42
|
+
const cacheReady = await saveClinicalSession({
|
|
43
|
+
sessionId,
|
|
44
|
+
topicInputs,
|
|
45
|
+
researchObjective,
|
|
46
|
+
draft,
|
|
47
|
+
proofread: null,
|
|
48
|
+
precheckInputs: null,
|
|
49
|
+
});
|
|
50
|
+
if (!cacheReady) {
|
|
51
|
+
throw new helixlifeError(helixlifeErrorCode.REQUEST_FAILED, "四要素已生成,但流程状态保存失败,请重试");
|
|
52
|
+
}
|
|
53
|
+
const result = {
|
|
54
|
+
status: "four_elements_ready",
|
|
55
|
+
nextAction: "review_four_elements",
|
|
56
|
+
researchObjective,
|
|
57
|
+
design: draft.design,
|
|
58
|
+
purpose: draft.purpose,
|
|
59
|
+
outcome: draft.outcome,
|
|
60
|
+
sample: draft.sample,
|
|
61
|
+
designEditableFields: draft.designEditableFields,
|
|
62
|
+
canEditDesign: canEditFourElementsDesign(draft),
|
|
63
|
+
};
|
|
64
|
+
if (format === "json") {
|
|
65
|
+
printOutput(wrapWorkbenchResult(result, {
|
|
66
|
+
step: "four-elements",
|
|
67
|
+
subType: "clinical",
|
|
68
|
+
}, {
|
|
69
|
+
sessionId,
|
|
70
|
+
workflowRunId: stream.workflowRunId,
|
|
71
|
+
cacheReady,
|
|
72
|
+
}), "json");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
log(`\n## 研究设计\n\n${draft.design}`);
|
|
76
|
+
log(`\n## 研究目的\n\n${draft.purpose}`);
|
|
77
|
+
log(`\n## 结局指标\n\n${draft.outcome}`);
|
|
78
|
+
log(`\n## 样本量计算\n\n${draft.sample}`);
|
|
79
|
+
log("\n四要素已生成,请确认或修改后进行预检。\n");
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=four-elements-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"four-elements-create.js","sourceRoot":"","sources":["../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O,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,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,CAAC,MAAM,EAAE;YAC1B,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,UAAU;SACpB,EAAE;YACD,SAAS;YACT,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,UAAU;SACX,CAAC,EACF,MAAM,CACP,CAAC;QACF,OAAO;IACT,CAAC;IACD,GAAG,CAAC,gBAAgB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACpC,GAAG,CAAC,gBAAgB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrC,GAAG,CAAC,gBAAgB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrC,GAAG,CAAC,iBAAiB,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface PrecheckFourElementsOptions {
|
|
3
|
+
sessionId?: string;
|
|
4
|
+
format?: OutputFormat;
|
|
5
|
+
}
|
|
6
|
+
export declare function runPrecheckFourElements(options: PrecheckFourElementsOptions): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=four-elements-precheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"four-elements-precheck.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/four-elements-precheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAmBnC,MAAM,WAAW,2BAA2B;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CAgFf"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createFormatLogger, printOutput, } from "../../../../core/index.js";
|
|
2
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
3
|
+
import { CLINICAL_EXECUTE_API_PATH, CLINICAL_FOUR_ELEMENTS_PROOFREAD_APP_ID, CLINICAL_WORKFLOW_APP_TYPE, } from "../constants.js";
|
|
4
|
+
import { fourElementsDraftToWorkflowInputs, parseFourElementsProofreadOutputs, validateFourElementsDraft, } from "../four-elements.js";
|
|
5
|
+
import { buildClinicalWorkflowBody } from "../apps.js";
|
|
6
|
+
import { streamClinicalWorkflow } from "../sse-utils.js";
|
|
7
|
+
import { requireClinicalSession, updateClinicalSession, } from "../session-cache.js";
|
|
8
|
+
export async function runPrecheckFourElements(options) {
|
|
9
|
+
const format = options.format ?? "markdown";
|
|
10
|
+
const session = await requireClinicalSession(options.sessionId);
|
|
11
|
+
const errors = validateFourElementsDraft(session.draft);
|
|
12
|
+
if (Object.keys(errors).length > 0) {
|
|
13
|
+
const result = {
|
|
14
|
+
status: "validation_failed",
|
|
15
|
+
nextAction: "fix_inputs",
|
|
16
|
+
errors,
|
|
17
|
+
firstErrorMessage: Object.values(errors)[0] ?? "",
|
|
18
|
+
};
|
|
19
|
+
if (format === "json") {
|
|
20
|
+
printOutput(wrapWorkbenchResult(result, { step: "four-elements-precheck", subType: "clinical" }, { sessionId: session.sessionId }), "json");
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const log = createFormatLogger(format);
|
|
24
|
+
log("\n四要素校验未通过:");
|
|
25
|
+
for (const message of Object.values(errors))
|
|
26
|
+
log(`- ${message}`);
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const inputs = fourElementsDraftToWorkflowInputs(session.draft);
|
|
31
|
+
const body = buildClinicalWorkflowBody({
|
|
32
|
+
appId: CLINICAL_FOUR_ELEMENTS_PROOFREAD_APP_ID,
|
|
33
|
+
appName: "四要素校对",
|
|
34
|
+
appType: CLINICAL_WORKFLOW_APP_TYPE,
|
|
35
|
+
inputs,
|
|
36
|
+
});
|
|
37
|
+
const stream = await streamClinicalWorkflow({
|
|
38
|
+
path: CLINICAL_EXECUTE_API_PATH,
|
|
39
|
+
body,
|
|
40
|
+
format,
|
|
41
|
+
startLabel: "正在预检四要素...",
|
|
42
|
+
progressLabel: "四要素预检中",
|
|
43
|
+
finishLabel: "四要素预检完成",
|
|
44
|
+
failureMessage: "四要素预检请求失败,请稍后重试",
|
|
45
|
+
emptyMessage: "四要素预检结果为空",
|
|
46
|
+
allowEmptyText: true,
|
|
47
|
+
});
|
|
48
|
+
const proofread = parseFourElementsProofreadOutputs(stream.outputs ?? {});
|
|
49
|
+
await updateClinicalSession(session, {
|
|
50
|
+
proofread,
|
|
51
|
+
precheckInputs: inputs,
|
|
52
|
+
article: undefined,
|
|
53
|
+
});
|
|
54
|
+
const success = proofread.outcome === "success";
|
|
55
|
+
const result = {
|
|
56
|
+
status: success ? "precheck_success" : "precheck_failed",
|
|
57
|
+
nextAction: success ? "generate_article" : "revise_four_elements",
|
|
58
|
+
outcome: proofread.outcome,
|
|
59
|
+
content: proofread.content,
|
|
60
|
+
};
|
|
61
|
+
if (format === "json") {
|
|
62
|
+
printOutput(wrapWorkbenchResult(result, { step: "four-elements-precheck", subType: "clinical" }, {
|
|
63
|
+
sessionId: session.sessionId,
|
|
64
|
+
workflowRunId: stream.workflowRunId,
|
|
65
|
+
cacheReady: true,
|
|
66
|
+
}), "json");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const log = createFormatLogger(format);
|
|
70
|
+
log(success
|
|
71
|
+
? "\n四要素预检成功,可以生成全文。\n"
|
|
72
|
+
: "\n四要素预检失败,请根据以下建议调整后重新预检。\n");
|
|
73
|
+
if (proofread.content)
|
|
74
|
+
log(`\n${proofread.content}\n`);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=four-elements-precheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"four-elements-precheck.js","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/four-elements-precheck.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,WAAW,GAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,yBAAyB,EACzB,uCAAuC,EACvC,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAO7B,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAoC;IAEpC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC;IAC5C,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxD,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,mBAAmB;YAC3B,UAAU,EAAE,YAAY;YACxB,MAAM;YACN,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,C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KAAK,SAAS,CAAC;IAChD,MAAM,MAAM,GAAG;QACb,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB;QACxD,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,sBAAsB;QACjE,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;KAC3B,CAAC;IACF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,WAAW,CACT,mBAAmB,CACjB,MAAM,EACN,EAAE,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,UAAU,EAAE,EACvD;YACE,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,UAAU,EAAE,IAAI;SACjB,CACF,EACD,MAAM,CACP,CAAC;QACF,OAAO;IACT,CAAC;IACD,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACvC,GAAG,CACD,OAAO;QACL,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,6BAA6B,CAClC,CAAC;IACF,IAAI,SAAS,CAAC,OAAO;QAAE,GAAG,CAAC,KAAK,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
interface BaseUpdateOptions {
|
|
3
|
+
sessionId?: string;
|
|
4
|
+
format?: OutputFormat;
|
|
5
|
+
}
|
|
6
|
+
export interface UpdateDesignOptions extends BaseUpdateOptions {
|
|
7
|
+
selectionsFile?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UpdateTextOptions extends BaseUpdateOptions {
|
|
10
|
+
file?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function runUpdateFourElementsDesign(options: UpdateDesignOptions): Promise<void>;
|
|
13
|
+
export declare function runUpdateFourElementsPurpose(options: UpdateTextOptions): Promise<void>;
|
|
14
|
+
export declare function runUpdateFourElementsOutcome(options: UpdateTextOptions): Promise<void>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=four-elements-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"four-elements-update.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/four-elements-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AA0BnC,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAoBD,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAgEf;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
|
@@ -0,0 +1,108 @@
|
|
|
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_PURPOSE_REGENERATE_APP_IDS, CLINICAL_WORKFLOW_APP_TYPE, } from "../constants.js";
|
|
4
|
+
import { readClinicalStringMap, readClinicalTextFile, } from "../command-utils.js";
|
|
5
|
+
import { applyDesignEditableFieldSelections, buildPurposeSyncInputs, canEditFourElementsDesign, patchOutcomeSampleFromOutputs, validateFourElementsText, } from "../four-elements.js";
|
|
6
|
+
import { buildClinicalWorkflowBody } from "../apps.js";
|
|
7
|
+
import { streamClinicalWorkflow } from "../sse-utils.js";
|
|
8
|
+
import { invalidateClinicalPrecheck, requireClinicalSession, updateClinicalSession, } from "../session-cache.js";
|
|
9
|
+
function printUpdated(result, sessionId, format, workflowRunId) {
|
|
10
|
+
if (format === "json") {
|
|
11
|
+
printOutput(wrapWorkbenchResult(result, { step: "four-elements", subType: "clinical" }, { sessionId, workflowRunId, cacheReady: true }), "json");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export async function runUpdateFourElementsDesign(options) {
|
|
15
|
+
const format = options.format ?? "markdown";
|
|
16
|
+
if (!options.selectionsFile) {
|
|
17
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请通过 --selections-file 提供研究设计字段选择 JSON");
|
|
18
|
+
}
|
|
19
|
+
const session = await requireClinicalSession(options.sessionId);
|
|
20
|
+
const selections = await readClinicalStringMap(options.selectionsFile, "研究设计选择文件");
|
|
21
|
+
const draft = applyDesignEditableFieldSelections(session.draft, selections);
|
|
22
|
+
await updateClinicalSession(session, invalidateClinicalPrecheck(session, draft));
|
|
23
|
+
const result = {
|
|
24
|
+
status: "four_elements_updated",
|
|
25
|
+
nextAction: "review_or_precheck",
|
|
26
|
+
section: "design",
|
|
27
|
+
design: draft.design,
|
|
28
|
+
designEditableFields: draft.designEditableFields,
|
|
29
|
+
canEditDesign: canEditFourElementsDesign(draft),
|
|
30
|
+
};
|
|
31
|
+
printUpdated(result, session.sessionId, format);
|
|
32
|
+
if (format !== "json") {
|
|
33
|
+
createFormatLogger(format)(`\n## 研究设计\n\n${draft.design}\n`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export async function runUpdateFourElementsPurpose(options) {
|
|
37
|
+
const format = options.format ?? "markdown";
|
|
38
|
+
if (!options.file) {
|
|
39
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请通过 --file 提供研究目的 UTF-8 文件");
|
|
40
|
+
}
|
|
41
|
+
const session = await requireClinicalSession(options.sessionId);
|
|
42
|
+
const purpose = validateFourElementsText(await readClinicalTextFile(options.file, "研究目的文件"), "研究目的");
|
|
43
|
+
const editedDraft = { ...session.draft, purpose };
|
|
44
|
+
const appId = CLINICAL_PURPOSE_REGENERATE_APP_IDS[session.researchObjective];
|
|
45
|
+
const body = buildClinicalWorkflowBody({
|
|
46
|
+
appId,
|
|
47
|
+
appName: `${session.researchObjective}-重新生成结局指标及样本量计算`,
|
|
48
|
+
appType: CLINICAL_WORKFLOW_APP_TYPE,
|
|
49
|
+
inputs: buildPurposeSyncInputs(session.topicInputs, editedDraft),
|
|
50
|
+
});
|
|
51
|
+
const stream = await streamClinicalWorkflow({
|
|
52
|
+
path: CLINICAL_EXECUTE_API_PATH,
|
|
53
|
+
body,
|
|
54
|
+
format,
|
|
55
|
+
startLabel: "正在同步结局指标与样本量...",
|
|
56
|
+
progressLabel: "同步生成中",
|
|
57
|
+
finishLabel: "同步生成完成",
|
|
58
|
+
failureMessage: "结局指标与样本量同步失败,请稍后重试",
|
|
59
|
+
emptyMessage: "结局指标与样本量同步结果为空",
|
|
60
|
+
allowEmptyText: true,
|
|
61
|
+
});
|
|
62
|
+
const draft = patchOutcomeSampleFromOutputs(editedDraft, stream.outputs ?? {});
|
|
63
|
+
if (!draft.outcome.trim() || !draft.sample.trim()) {
|
|
64
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, "研究目的已读取,但工作流未返回完整的结局指标和样本量");
|
|
65
|
+
}
|
|
66
|
+
await updateClinicalSession(session, invalidateClinicalPrecheck(session, draft));
|
|
67
|
+
const result = {
|
|
68
|
+
status: "four_elements_updated",
|
|
69
|
+
nextAction: "review_or_precheck",
|
|
70
|
+
section: "purpose",
|
|
71
|
+
purpose: draft.purpose,
|
|
72
|
+
outcome: draft.outcome,
|
|
73
|
+
sample: draft.sample,
|
|
74
|
+
designEditableFields: draft.designEditableFields,
|
|
75
|
+
canEditDesign: canEditFourElementsDesign(draft),
|
|
76
|
+
};
|
|
77
|
+
printUpdated(result, session.sessionId, format, stream.workflowRunId);
|
|
78
|
+
if (format !== "json") {
|
|
79
|
+
const log = createFormatLogger(format);
|
|
80
|
+
log(`\n## 研究目的\n\n${draft.purpose}`);
|
|
81
|
+
log(`\n## 结局指标\n\n${draft.outcome}`);
|
|
82
|
+
log(`\n## 样本量计算\n\n${draft.sample}\n`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export async function runUpdateFourElementsOutcome(options) {
|
|
86
|
+
const format = options.format ?? "markdown";
|
|
87
|
+
if (!options.file) {
|
|
88
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请通过 --file 提供结局指标 UTF-8 文件");
|
|
89
|
+
}
|
|
90
|
+
const session = await requireClinicalSession(options.sessionId);
|
|
91
|
+
const outcome = validateFourElementsText(await readClinicalTextFile(options.file, "结局指标文件"), "结局指标");
|
|
92
|
+
const draft = { ...session.draft, outcome };
|
|
93
|
+
await updateClinicalSession(session, invalidateClinicalPrecheck(session, draft));
|
|
94
|
+
const result = {
|
|
95
|
+
status: "four_elements_updated",
|
|
96
|
+
nextAction: "review_or_precheck",
|
|
97
|
+
section: "outcome",
|
|
98
|
+
outcome,
|
|
99
|
+
designEditableFields: draft.designEditableFields,
|
|
100
|
+
canEditDesign: canEditFourElementsDesign(draft),
|
|
101
|
+
warning: "修改结局指标后,请勿忘记同步检查研究目的",
|
|
102
|
+
};
|
|
103
|
+
printUpdated(result, session.sessionId, format);
|
|
104
|
+
if (format !== "json") {
|
|
105
|
+
createFormatLogger(format)(`\n## 结局指标\n\n${outcome}\n\n注意:请同步检查研究目的。\n`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=four-elements-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"four-elements-update.js","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/four-elements-update.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,mCAAmC,EACnC,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kCAAkC,EAClC,sBAAsB,EACtB,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAe7B,SAAS,YAAY,CACnB,MAA+B,EAC/B,SAAiB,EACjB,MAAoB,EACpB,aAAsB;IAEtB,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,WAAW,CACT,mBAAmB,CACjB,MAAM,EACN,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,EAAE,EAC9C,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,CAC/C,EACD,MAAM,CACP,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,OAA4B;IAE5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC;IAC5C,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5B,MAAM,IAAI,cAAc,CACtB,kBAAkB,CAAC,gBAAgB,EACnC,uCAAuC,CACxC,CAAC;IACJ,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oB,EAAE,KAAK,CAAC,oBAAoB;QAChD,aAAa,EAAE,yBAAyB,CAAC,KAAK,CAAC;QAC/C,OAAO,EAAE,sBAAsB;KAChC,CAAC;IACF,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAChD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,kBAAkB,CAAC,MAAM,CAAC,CACxB,gBAAgB,OAAO,qBAAqB,CAC7C,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface SampleSizeParametersOptions {
|
|
3
|
+
path?: string[];
|
|
4
|
+
format?: OutputFormat;
|
|
5
|
+
}
|
|
6
|
+
export interface CalculateSampleSizeOptions {
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
path?: string[];
|
|
9
|
+
paramsFile?: string;
|
|
10
|
+
format?: OutputFormat;
|
|
11
|
+
}
|
|
12
|
+
export declare function runSampleSizeParameters(options: SampleSizeParametersOptions): Promise<void>;
|
|
13
|
+
export declare function runCalculateSampleSize(options: CalculateSampleSizeOptions): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=sample-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample-size.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/clinical/commands/sample-size.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AA2BnC,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAQD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAuHf"}
|