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,351 @@
|
|
|
1
|
+
// Step2①:按 nextSubStep 跑首个分析工作流
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { helixlifeError, helixlifeErrorCode, printOutput, createFormatLogger, resolveUserPath, } from "../../../../core/index.js";
|
|
4
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
5
|
+
import { buildNsfcExecuteBody, createNsfcOrder, extractNsfcOrderId, } from "../apps.js";
|
|
6
|
+
import { NSFC_APP_NAMES, NSFC_EXECUTE_API_PATH, NSFC_HYPOTHESIS_APP_IDS, NSFC_PROVINCE_PROGRAM, parseNsfcHasHypothesis, parseNsfcNextSubStep, resolveOutlineAppSuffix, resolvePickNoPriorAppId, resolveResearchPathAppId, } from "../constants.js";
|
|
7
|
+
import { articleContentToJsonArrayString, buildGeneSelectionOptions, buildHypothesisSelectionOptions, buildMissingInfoBlockSelectionOptions, buildNsfcV2GenePreResultsText, getResearchPathReportText, parseMissingInfoFromAnalysisResult, parseNsfcV2ArticleWorkflowResult, tryParseHypothesisList, } from "../parse-hypothesis.js";
|
|
8
|
+
import { saveNsfcSessionCache } from "../session-cache.js";
|
|
9
|
+
import { formatElapsedHint, streamNsfcWorkflow } from "../sse-utils.js";
|
|
10
|
+
function extractFileContent(inputs, key) {
|
|
11
|
+
const arr = inputs[key];
|
|
12
|
+
if (!Array.isArray(arr) || !arr[0])
|
|
13
|
+
return "";
|
|
14
|
+
const first = arr[0];
|
|
15
|
+
return String(first.content ?? "");
|
|
16
|
+
}
|
|
17
|
+
async function readJsonFile(path) {
|
|
18
|
+
const filePath = resolveUserPath(path);
|
|
19
|
+
try {
|
|
20
|
+
const raw = await readFile(filePath, "utf8");
|
|
21
|
+
const parsed = JSON.parse(raw);
|
|
22
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
23
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `--inputs-file 须为 JSON 对象: ${path}`);
|
|
24
|
+
}
|
|
25
|
+
return parsed;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error instanceof helixlifeError)
|
|
29
|
+
throw error;
|
|
30
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `无法读取 --inputs-file: ${path}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function resolveQuery(options) {
|
|
34
|
+
if (options.query?.trim() && options.queryFile?.trim()) {
|
|
35
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "--query 与 --query-file 互斥");
|
|
36
|
+
}
|
|
37
|
+
if (options.queryFile?.trim()) {
|
|
38
|
+
const p = resolveUserPath(options.queryFile);
|
|
39
|
+
try {
|
|
40
|
+
return (await readFile(p, "utf8")).trim();
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `无法读取 --query-file: ${options.queryFile}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return options.query?.trim() ?? "";
|
|
47
|
+
}
|
|
48
|
+
async function runWorkflow(params) {
|
|
49
|
+
const body = buildNsfcExecuteBody({
|
|
50
|
+
query: params.query,
|
|
51
|
+
inputs: params.inputs,
|
|
52
|
+
appId: params.appId,
|
|
53
|
+
appName: params.appName,
|
|
54
|
+
orderId: params.orderId,
|
|
55
|
+
end: false,
|
|
56
|
+
});
|
|
57
|
+
return streamNsfcWorkflow({
|
|
58
|
+
path: NSFC_EXECUTE_API_PATH,
|
|
59
|
+
body,
|
|
60
|
+
format: params.format,
|
|
61
|
+
startLabel: params.labels.start,
|
|
62
|
+
progressLabel: params.labels.progress,
|
|
63
|
+
finishLabel: params.labels.finish,
|
|
64
|
+
failureMessage: params.labels.fail,
|
|
65
|
+
emptyMessage: params.labels.empty,
|
|
66
|
+
allowEmptyText: params.allowEmptyText,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export async function runAnalyzeNsfcHypothesis(options) {
|
|
70
|
+
const format = options.format ?? "markdown";
|
|
71
|
+
const log = createFormatLogger(format);
|
|
72
|
+
if (!options.hasHypothesis || !options.nextSubStep) {
|
|
73
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "hypothesis analyze 必须提供 --has-hypothesis 与 --next-sub-step(来自 Step1 _handoff)");
|
|
74
|
+
}
|
|
75
|
+
if (!options.inputsFile?.trim()) {
|
|
76
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "hypothesis analyze 必须提供 --inputs-file(Step1 data.inputs JSON)");
|
|
77
|
+
}
|
|
78
|
+
const hasHypothesis = parseNsfcHasHypothesis(options.hasHypothesis);
|
|
79
|
+
const nextSubStep = parseNsfcNextSubStep(options.nextSubStep);
|
|
80
|
+
const inputs = await readJsonFile(options.inputsFile);
|
|
81
|
+
let query = await resolveQuery(options);
|
|
82
|
+
if (!query) {
|
|
83
|
+
query = String((hasHypothesis === "existing" ? inputs.text : inputs.input) ?? "").trim();
|
|
84
|
+
}
|
|
85
|
+
if (!query && nextSubStep !== "research_path") {
|
|
86
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "缺少主文本 query(--query / --query-file 或 inputs.input/text)");
|
|
87
|
+
}
|
|
88
|
+
const projectLevel = String(inputs.projectLevel ?? "");
|
|
89
|
+
const outlineAppSuffix = resolveOutlineAppSuffix(hasHypothesis);
|
|
90
|
+
log("接口正在处理中,请耐心等待...");
|
|
91
|
+
const order = await createNsfcOrder({
|
|
92
|
+
index: 0,
|
|
93
|
+
count: 1,
|
|
94
|
+
query,
|
|
95
|
+
inputs,
|
|
96
|
+
parent_order_id: null,
|
|
97
|
+
});
|
|
98
|
+
const orderId = extractNsfcOrderId(order);
|
|
99
|
+
const baseCache = {
|
|
100
|
+
orderId,
|
|
101
|
+
query,
|
|
102
|
+
inputs,
|
|
103
|
+
hasHypothesis,
|
|
104
|
+
nextSubStep,
|
|
105
|
+
outlineAppSuffix,
|
|
106
|
+
};
|
|
107
|
+
// —— Path: background_genes ——
|
|
108
|
+
if (nextSubStep === "background_genes") {
|
|
109
|
+
const fileContent = extractFileContent(inputs, "file");
|
|
110
|
+
if (!fileContent) {
|
|
111
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "background_genes 路径需要 inputs.file[0].content(Step1 上传解析结果)");
|
|
112
|
+
}
|
|
113
|
+
const stream = await runWorkflow({
|
|
114
|
+
orderId,
|
|
115
|
+
query,
|
|
116
|
+
inputs: {
|
|
117
|
+
List_Disease: query,
|
|
118
|
+
text: articleContentToJsonArrayString(fileContent),
|
|
119
|
+
},
|
|
120
|
+
appId: NSFC_HYPOTHESIS_APP_IDS.articleAnalysis,
|
|
121
|
+
appName: NSFC_APP_NAMES.generateHypothesis,
|
|
122
|
+
format,
|
|
123
|
+
allowEmptyText: true,
|
|
124
|
+
labels: {
|
|
125
|
+
start: "研究背景分析中…",
|
|
126
|
+
progress: "背景分析进行中",
|
|
127
|
+
finish: "背景分析完成",
|
|
128
|
+
fail: "研究背景分析失败,请稍后重试",
|
|
129
|
+
empty: "研究背景分析未返回有效结果",
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
const parsed = parseNsfcV2ArticleWorkflowResult(stream.outputs?.result);
|
|
133
|
+
if (!parsed) {
|
|
134
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, "研究背景分析未返回有效候选基因结果");
|
|
135
|
+
}
|
|
136
|
+
await saveNsfcSessionCache({
|
|
137
|
+
...baseCache,
|
|
138
|
+
backgroundReport: parsed.backgroundReport,
|
|
139
|
+
genes: parsed.genes,
|
|
140
|
+
workflowRunId: stream.workflowRunId,
|
|
141
|
+
});
|
|
142
|
+
const result = {
|
|
143
|
+
path: "background_genes",
|
|
144
|
+
backgroundReport: parsed.backgroundReport,
|
|
145
|
+
genes: parsed.genes.map((g) => ({
|
|
146
|
+
id: g.id,
|
|
147
|
+
gene: g.gene,
|
|
148
|
+
directions: g.directions,
|
|
149
|
+
mechanism: g.mechanism,
|
|
150
|
+
results: g.results,
|
|
151
|
+
})),
|
|
152
|
+
selectionOptions: buildGeneSelectionOptions(parsed.genes),
|
|
153
|
+
ready: true,
|
|
154
|
+
};
|
|
155
|
+
if (format === "json") {
|
|
156
|
+
printOutput(wrapWorkbenchResult(result, { step: "hypothesis-analyze", subType: "nsfc" }, {
|
|
157
|
+
orderId,
|
|
158
|
+
workflowRunId: stream.workflowRunId,
|
|
159
|
+
hasHypothesis,
|
|
160
|
+
nextSubStep,
|
|
161
|
+
outlineAppSuffix,
|
|
162
|
+
}), "json");
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
console.log(`\n## 研究背景分析完成${formatElapsedHint(stream.elapsedTime)}\n`);
|
|
166
|
+
if (parsed.backgroundReport) {
|
|
167
|
+
console.log("### 研究背景\n");
|
|
168
|
+
console.log(parsed.backgroundReport.slice(0, 500) +
|
|
169
|
+
(parsed.backgroundReport.length > 500 ? "…\n" : "\n"));
|
|
170
|
+
}
|
|
171
|
+
console.log(`候选基因 ${parsed.genes.length} 个。请用选择器 N 选 1,再执行 hypothesis genes select。`);
|
|
172
|
+
console.log(`(内部 order 请用 --format=json 的 _handoff 串联,勿展示给用户)`);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// —— Path: hypothesis_pick(无前期) ——
|
|
176
|
+
if (nextSubStep === "hypothesis_pick") {
|
|
177
|
+
const isProvince = projectLevel === "省部级";
|
|
178
|
+
const stream = await runWorkflow({
|
|
179
|
+
orderId,
|
|
180
|
+
query: "",
|
|
181
|
+
inputs: {
|
|
182
|
+
project: isProvince
|
|
183
|
+
? NSFC_PROVINCE_PROGRAM
|
|
184
|
+
: String(inputs.project ?? ""),
|
|
185
|
+
theme: String(inputs.input ?? query),
|
|
186
|
+
value: String(inputs.value ?? ""),
|
|
187
|
+
},
|
|
188
|
+
appId: resolvePickNoPriorAppId(projectLevel),
|
|
189
|
+
appName: NSFC_APP_NAMES.generateHypothesis,
|
|
190
|
+
format,
|
|
191
|
+
allowEmptyText: true,
|
|
192
|
+
labels: {
|
|
193
|
+
start: "科学假说生成中…",
|
|
194
|
+
progress: "假说生成进行中",
|
|
195
|
+
finish: "假说生成完成",
|
|
196
|
+
fail: "科学假说生成失败,请稍后重试",
|
|
197
|
+
empty: "科学假说生成结果为空",
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
const hypotheses = tryParseHypothesisList(stream.outputs);
|
|
201
|
+
if (!hypotheses.length) {
|
|
202
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, "科学假说生成结果为空,请稍后重试");
|
|
203
|
+
}
|
|
204
|
+
await saveNsfcSessionCache({
|
|
205
|
+
...baseCache,
|
|
206
|
+
hypotheses,
|
|
207
|
+
workflowRunId: stream.workflowRunId,
|
|
208
|
+
});
|
|
209
|
+
const result = {
|
|
210
|
+
path: "hypothesis_pick",
|
|
211
|
+
hypotheses: hypotheses.map((h) => ({
|
|
212
|
+
id: h.id,
|
|
213
|
+
text: h.new_text || h.original_text,
|
|
214
|
+
})),
|
|
215
|
+
selectionOptions: buildHypothesisSelectionOptions(hypotheses),
|
|
216
|
+
ready: true,
|
|
217
|
+
};
|
|
218
|
+
if (format === "json") {
|
|
219
|
+
printOutput(wrapWorkbenchResult(result, { step: "hypothesis-analyze", subType: "nsfc" }, {
|
|
220
|
+
orderId,
|
|
221
|
+
workflowRunId: stream.workflowRunId,
|
|
222
|
+
hasHypothesis,
|
|
223
|
+
nextSubStep,
|
|
224
|
+
outlineAppSuffix,
|
|
225
|
+
}), "json");
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
console.log(`\n## 科学假说候选${formatElapsedHint(stream.elapsedTime)}\n`);
|
|
229
|
+
hypotheses.forEach((h, i) => {
|
|
230
|
+
console.log(`### ${i + 1}\n${h.new_text || h.original_text}\n`);
|
|
231
|
+
});
|
|
232
|
+
console.log("请选择或自定义假说,再执行 hypothesis pick。");
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
// —— Path: research_path ——
|
|
236
|
+
if (nextSubStep === "research_path") {
|
|
237
|
+
const disease = String(inputs.value ?? "").trim();
|
|
238
|
+
const hypothesisText = String(inputs.text ?? query).trim();
|
|
239
|
+
if (!disease || !hypothesisText) {
|
|
240
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "research_path 需要 inputs.value(疾病)与 inputs.text(假说)");
|
|
241
|
+
}
|
|
242
|
+
let genePreResultsText = String(inputs.gene_pre_results_text ?? "").trim();
|
|
243
|
+
const file1Content = extractFileContent(inputs, "file1");
|
|
244
|
+
if (file1Content && !genePreResultsText) {
|
|
245
|
+
const attachStream = await runWorkflow({
|
|
246
|
+
orderId,
|
|
247
|
+
query: disease,
|
|
248
|
+
inputs: {
|
|
249
|
+
List_Disease: disease,
|
|
250
|
+
text: articleContentToJsonArrayString(file1Content),
|
|
251
|
+
},
|
|
252
|
+
appId: NSFC_HYPOTHESIS_APP_IDS.articleAnalysis,
|
|
253
|
+
appName: NSFC_APP_NAMES.generateHypothesis,
|
|
254
|
+
format,
|
|
255
|
+
allowEmptyText: true,
|
|
256
|
+
labels: {
|
|
257
|
+
start: "附件分析中…",
|
|
258
|
+
progress: "附件分析进行中",
|
|
259
|
+
finish: "附件分析完成",
|
|
260
|
+
fail: "附件分析失败,请稍后重试",
|
|
261
|
+
empty: "附件分析未返回有效结果",
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
const attachParsed = parseNsfcV2ArticleWorkflowResult(attachStream.outputs?.result);
|
|
265
|
+
genePreResultsText = buildNsfcV2GenePreResultsText(attachParsed?.genes ?? []);
|
|
266
|
+
}
|
|
267
|
+
const isProvince = projectLevel === "省部级";
|
|
268
|
+
const program = isProvince
|
|
269
|
+
? NSFC_PROVINCE_PROGRAM
|
|
270
|
+
: String(inputs.program ?? inputs.project ?? "");
|
|
271
|
+
const stream = await runWorkflow({
|
|
272
|
+
orderId,
|
|
273
|
+
query: "",
|
|
274
|
+
inputs: {
|
|
275
|
+
List_Disease: disease,
|
|
276
|
+
text: articleContentToJsonArrayString(file1Content || ""),
|
|
277
|
+
program,
|
|
278
|
+
hypothesis: hypothesisText,
|
|
279
|
+
},
|
|
280
|
+
appId: resolveResearchPathAppId(projectLevel),
|
|
281
|
+
appName: NSFC_APP_NAMES.generateHypothesis,
|
|
282
|
+
format,
|
|
283
|
+
allowEmptyText: true,
|
|
284
|
+
labels: {
|
|
285
|
+
start: "研究思路分析中…",
|
|
286
|
+
progress: "研究路径分析进行中",
|
|
287
|
+
finish: "研究路径分析完成",
|
|
288
|
+
fail: "研究思路分析失败,请稍后重试",
|
|
289
|
+
empty: "研究思路分析未返回有效结果",
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
const analysisResult = stream.outputs?.result;
|
|
293
|
+
if (analysisResult === undefined || analysisResult === null) {
|
|
294
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, "研究思路分析未返回有效结果");
|
|
295
|
+
}
|
|
296
|
+
const researchPathText = getResearchPathReportText(analysisResult);
|
|
297
|
+
const missingInfo = parseMissingInfoFromAnalysisResult(analysisResult);
|
|
298
|
+
const missingInfoEmpty = missingInfo.length === 0;
|
|
299
|
+
await saveNsfcSessionCache({
|
|
300
|
+
...baseCache,
|
|
301
|
+
query: hypothesisText,
|
|
302
|
+
inputs: {
|
|
303
|
+
...inputs,
|
|
304
|
+
gene_pre_results_text: genePreResultsText,
|
|
305
|
+
},
|
|
306
|
+
researchPathText,
|
|
307
|
+
researchPathResult: analysisResult,
|
|
308
|
+
missingInfo,
|
|
309
|
+
genePreResultsText,
|
|
310
|
+
workflowRunId: stream.workflowRunId,
|
|
311
|
+
});
|
|
312
|
+
const result = {
|
|
313
|
+
path: "research_path",
|
|
314
|
+
researchPath: researchPathText,
|
|
315
|
+
missingInfo: missingInfo.map((b) => ({
|
|
316
|
+
title: b.title,
|
|
317
|
+
options: b.select,
|
|
318
|
+
selectionOptions: buildMissingInfoBlockSelectionOptions(b),
|
|
319
|
+
})),
|
|
320
|
+
missingInfoEmpty,
|
|
321
|
+
ready: true,
|
|
322
|
+
};
|
|
323
|
+
if (format === "json") {
|
|
324
|
+
printOutput(wrapWorkbenchResult(result, { step: "hypothesis-analyze", subType: "nsfc" }, {
|
|
325
|
+
orderId,
|
|
326
|
+
workflowRunId: stream.workflowRunId,
|
|
327
|
+
hasHypothesis,
|
|
328
|
+
nextSubStep,
|
|
329
|
+
outlineAppSuffix,
|
|
330
|
+
missingInfoEmpty,
|
|
331
|
+
}), "json");
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
console.log(`\n## 研究路径${formatElapsedHint(stream.elapsedTime)}\n`);
|
|
335
|
+
console.log(researchPathText || "(暂无相关数据)");
|
|
336
|
+
console.log("\n## 缺失信息\n");
|
|
337
|
+
if (missingInfoEmpty) {
|
|
338
|
+
console.log("暂无缺失信息。请立即执行 research-path confirm 生成提纲。");
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
missingInfo.forEach((b, i) => {
|
|
342
|
+
console.log(`### ${i + 1}. ${b.title}`);
|
|
343
|
+
b.select.forEach((o, j) => console.log(` ${j + 1}) ${o}`));
|
|
344
|
+
});
|
|
345
|
+
console.log("\n请从当前缺失信息选项中至少选一项,再执行 research-path confirm(禁止自定义假说/忽略并继续)。");
|
|
346
|
+
}
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `未支持的 nextSubStep: ${String(nextSubStep)}`);
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=hypothesis-analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hypothesis-analyze.js","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc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putFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface CreateNsfcHypothesisOptions {
|
|
3
|
+
hasHypothesis?: string;
|
|
4
|
+
projectLevel?: string;
|
|
5
|
+
project?: string;
|
|
6
|
+
priorResult?: string;
|
|
7
|
+
query?: string;
|
|
8
|
+
queryFile?: string;
|
|
9
|
+
disease?: string;
|
|
10
|
+
diseaseFile?: string;
|
|
11
|
+
attach?: string;
|
|
12
|
+
yes?: boolean;
|
|
13
|
+
format?: OutputFormat;
|
|
14
|
+
}
|
|
15
|
+
export interface NsfcHypothesisCreateResult {
|
|
16
|
+
query: string;
|
|
17
|
+
inputs: Record<string, unknown>;
|
|
18
|
+
ready: true;
|
|
19
|
+
}
|
|
20
|
+
export declare function runCreateNsfcHypothesis(options: CreateNsfcHypothesisOptions): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=hypothesis-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hypothesis-create.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/hypothesis-create.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAqBnC,MAAM,WAAW,2BAA2B;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE,IAAI,CAAC;CACb;AAmFD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,IAAI,CAAC,CAoKf"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// Step1:生成假说 — 采集 + 校验 + 可选上传,不调假说工作流
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { helixlifeError, helixlifeErrorCode, printOutput, createFormatLogger, resolveUserPath, } from "../../../../core/index.js";
|
|
4
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
5
|
+
import { parseNsfcHasHypothesis, parseNsfcPriorResult, parseNsfcProjectLevel, parseNsfcProjectType, } from "../constants.js";
|
|
6
|
+
import { promptNsfcHypothesisCreate } from "../prompt-hypothesis.js";
|
|
7
|
+
import { buildNsfcHandoff, buildNsfcHypothesisBody, } from "../request-body.js";
|
|
8
|
+
import { uploadNsfcAttach } from "../upload.js";
|
|
9
|
+
import { validateNsfcHypothesisCreate } from "../validate.js";
|
|
10
|
+
async function resolveTextOrFile(options) {
|
|
11
|
+
if (options.text?.trim() && options.file?.trim()) {
|
|
12
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `${options.label} 不能同时使用内联参数与 *-file,请二选一`);
|
|
13
|
+
}
|
|
14
|
+
if (options.file?.trim()) {
|
|
15
|
+
const filePath = resolveUserPath(options.file);
|
|
16
|
+
try {
|
|
17
|
+
return (await readFile(filePath, "utf8")).trim();
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `无法读取文件: ${options.file}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (options.text?.trim()) {
|
|
24
|
+
return options.text.trim();
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
function parseOptionalFlags(options) {
|
|
29
|
+
return {
|
|
30
|
+
hasHypothesis: options.hasHypothesis
|
|
31
|
+
? parseNsfcHasHypothesis(options.hasHypothesis)
|
|
32
|
+
: undefined,
|
|
33
|
+
projectLevel: options.projectLevel
|
|
34
|
+
? parseNsfcProjectLevel(options.projectLevel)
|
|
35
|
+
: undefined,
|
|
36
|
+
project: options.project
|
|
37
|
+
? parseNsfcProjectType(options.project)
|
|
38
|
+
: undefined,
|
|
39
|
+
priorResult: options.priorResult
|
|
40
|
+
? parseNsfcPriorResult(options.priorResult)
|
|
41
|
+
: undefined,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function isIncomplete(params) {
|
|
45
|
+
if (!params.hasHypothesis || !params.projectLevel || !params.query?.trim()) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
if (params.projectLevel === "国家级" && !params.project) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (params.hasHypothesis === "blank" && !params.priorResult) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (params.hasHypothesis === "existing" && !params.disease?.trim()) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
if (params.hasHypothesis === "blank" &&
|
|
58
|
+
params.priorResult === "yes" &&
|
|
59
|
+
!params.attachPath?.trim()) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
export async function runCreateNsfcHypothesis(options) {
|
|
65
|
+
const format = options.format ?? "markdown";
|
|
66
|
+
const log = createFormatLogger(format);
|
|
67
|
+
const queryFromArgs = await resolveTextOrFile({
|
|
68
|
+
text: options.query,
|
|
69
|
+
file: options.queryFile,
|
|
70
|
+
label: "主文本(--query / --query-file)",
|
|
71
|
+
});
|
|
72
|
+
const diseaseFromArgs = await resolveTextOrFile({
|
|
73
|
+
text: options.disease,
|
|
74
|
+
file: options.diseaseFile,
|
|
75
|
+
label: "疾病名称(--disease / --disease-file)",
|
|
76
|
+
});
|
|
77
|
+
const parsed = parseOptionalFlags(options);
|
|
78
|
+
let hasHypothesis = parsed.hasHypothesis;
|
|
79
|
+
let projectLevel = parsed.projectLevel;
|
|
80
|
+
let project = parsed.project;
|
|
81
|
+
let priorResult = parsed.priorResult;
|
|
82
|
+
let query = queryFromArgs;
|
|
83
|
+
let disease = diseaseFromArgs;
|
|
84
|
+
let attachPath = options.attach?.trim() || undefined;
|
|
85
|
+
if (options.yes) {
|
|
86
|
+
if (isIncomplete({
|
|
87
|
+
hasHypothesis,
|
|
88
|
+
projectLevel,
|
|
89
|
+
project,
|
|
90
|
+
priorResult,
|
|
91
|
+
query,
|
|
92
|
+
disease,
|
|
93
|
+
attachPath,
|
|
94
|
+
})) {
|
|
95
|
+
// 用校验器给出明确缺项错误(缺枚举时先补齐最小报错)
|
|
96
|
+
if (!hasHypothesis || !projectLevel) {
|
|
97
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "使用 -y/--yes 时必须提供 --has-hypothesis 与 --project-level,以及当前路径全部必填项");
|
|
98
|
+
}
|
|
99
|
+
validateNsfcHypothesisCreate({
|
|
100
|
+
hasHypothesis,
|
|
101
|
+
projectLevel,
|
|
102
|
+
project,
|
|
103
|
+
priorResult,
|
|
104
|
+
query,
|
|
105
|
+
disease,
|
|
106
|
+
attachPath,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (isIncomplete({
|
|
111
|
+
hasHypothesis,
|
|
112
|
+
projectLevel,
|
|
113
|
+
project,
|
|
114
|
+
priorResult,
|
|
115
|
+
query,
|
|
116
|
+
disease,
|
|
117
|
+
attachPath,
|
|
118
|
+
})) {
|
|
119
|
+
const prompted = await promptNsfcHypothesisCreate({
|
|
120
|
+
hasHypothesis,
|
|
121
|
+
projectLevel,
|
|
122
|
+
project,
|
|
123
|
+
priorResult,
|
|
124
|
+
query,
|
|
125
|
+
disease,
|
|
126
|
+
attachPath,
|
|
127
|
+
});
|
|
128
|
+
hasHypothesis = prompted.hasHypothesis;
|
|
129
|
+
projectLevel = prompted.projectLevel;
|
|
130
|
+
project = prompted.project;
|
|
131
|
+
priorResult = prompted.priorResult;
|
|
132
|
+
query = prompted.query;
|
|
133
|
+
disease = prompted.disease;
|
|
134
|
+
attachPath = prompted.attachPath;
|
|
135
|
+
}
|
|
136
|
+
if (!hasHypothesis || !projectLevel || !query) {
|
|
137
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "缺少必填项:是否有科学假说 / 项目级别 / 主文本");
|
|
138
|
+
}
|
|
139
|
+
const validated = validateNsfcHypothesisCreate({
|
|
140
|
+
hasHypothesis,
|
|
141
|
+
projectLevel,
|
|
142
|
+
project,
|
|
143
|
+
priorResult,
|
|
144
|
+
query,
|
|
145
|
+
disease,
|
|
146
|
+
attachPath,
|
|
147
|
+
});
|
|
148
|
+
let attachFiles;
|
|
149
|
+
if (validated.attachPath) {
|
|
150
|
+
log("接口正在处理中,请耐心等待...");
|
|
151
|
+
const uploaded = await uploadNsfcAttach(validated.attachPath);
|
|
152
|
+
attachFiles = [uploaded];
|
|
153
|
+
}
|
|
154
|
+
const body = buildNsfcHypothesisBody({
|
|
155
|
+
hasHypothesis: validated.hasHypothesis,
|
|
156
|
+
projectLevel: validated.projectLevel,
|
|
157
|
+
project: validated.project,
|
|
158
|
+
priorResult: validated.priorResult,
|
|
159
|
+
query: validated.query,
|
|
160
|
+
disease: validated.disease,
|
|
161
|
+
attachFiles,
|
|
162
|
+
});
|
|
163
|
+
const handoff = buildNsfcHandoff({
|
|
164
|
+
hasHypothesis: validated.hasHypothesis,
|
|
165
|
+
priorResult: validated.priorResult,
|
|
166
|
+
});
|
|
167
|
+
const result = {
|
|
168
|
+
query: body.query,
|
|
169
|
+
inputs: body.inputs,
|
|
170
|
+
ready: true,
|
|
171
|
+
};
|
|
172
|
+
if (format === "json") {
|
|
173
|
+
printOutput(wrapWorkbenchResult(result, { step: "hypothesis", subType: "nsfc" }, handoff), "json");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const pathLabel = validated.hasHypothesis === "blank"
|
|
177
|
+
? validated.priorResult === "yes"
|
|
178
|
+
? "无假说 · 有前期研究结果"
|
|
179
|
+
: "无假说 · 无前期研究结果"
|
|
180
|
+
: "已有科学假说";
|
|
181
|
+
console.log("## 基金申请 · 第 1 步已就绪\n");
|
|
182
|
+
console.log(`- 路径:${pathLabel}`);
|
|
183
|
+
console.log(`- 项目级别:${validated.projectLevel}`);
|
|
184
|
+
if (validated.project) {
|
|
185
|
+
console.log(`- 项目类型:${validated.project}`);
|
|
186
|
+
}
|
|
187
|
+
console.log(`- 主文本:${validated.query.slice(0, 80)}${validated.query.length > 80 ? "…" : ""}`);
|
|
188
|
+
if (validated.disease) {
|
|
189
|
+
console.log(`- 疾病名称:${validated.disease}`);
|
|
190
|
+
}
|
|
191
|
+
if (attachFiles?.length) {
|
|
192
|
+
console.log(`- 补充材料:已上传 ${attachFiles[0].file_name}`);
|
|
193
|
+
}
|
|
194
|
+
console.log("\n参数已校验通过,可进入第 2 步「确认假说」。");
|
|
195
|
+
console.log("(使用 `--format=json` 可获取 Agent 串联用完整 payload)");
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=hypothesis-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hypothesis-create.js","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/hypothesis-create.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,eAAe,GAEhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GAKrB,MAAM,i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EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACjF,CAAC;IACF,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,UAAU,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,WAAW,EAAE,MAAM,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,cAAc,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface HypothesisFigureOptions {
|
|
3
|
+
orderId?: string;
|
|
4
|
+
output?: string;
|
|
5
|
+
yes?: boolean;
|
|
6
|
+
format?: OutputFormat;
|
|
7
|
+
}
|
|
8
|
+
export declare function runNsfcHypothesisFigure(options: HypothesisFigureOptions): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=hypothesis-figure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hypothesis-figure.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/hypothesis-figure.ts"],"names":[],"mappings":"AAGA,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAiBnC,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAiBD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAgIf"}
|