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,189 @@
|
|
|
1
|
+
// Step4:导出原始引文格式 MD + Word(文件名对齐原站 getTitleFromArticle)
|
|
2
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, extname, join } from "node:path";
|
|
4
|
+
import { ApiClient, getDefaultNewideaBaseUrl, helixlifeError, helixlifeErrorCode, getUserDownloadsDir, printOutput, resolveUserPath, sanitizeFilename, } from "../../../../core/index.js";
|
|
5
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
6
|
+
import { loadNsfcArticleCache, popNsfcArticleCache } from "../article-cache.js";
|
|
7
|
+
import { NSFC_CONTENT_PRODUCER } from "../constants.js";
|
|
8
|
+
import { loadNsfcSessionCache } from "../session-cache.js";
|
|
9
|
+
/** 无标题时的导出 basename(对齐原站「未命名」) */
|
|
10
|
+
const DEFAULT_NSFC_ARTICLE_TITLE = "未命名";
|
|
11
|
+
const DEFAULT_DOCX_NAME = `${DEFAULT_NSFC_ARTICLE_TITLE}.docx`;
|
|
12
|
+
/** 检测行首「标题:」/「Title:」类前缀(对齐官网 checkIsTitle) */
|
|
13
|
+
function checkIsTitleLabel(text) {
|
|
14
|
+
return /^(?:项目名称|标题|Title)\s*[::]?/.test(text);
|
|
15
|
+
}
|
|
16
|
+
/** 从「标题: xxx」提取标题正文(对齐官网 extractTitle) */
|
|
17
|
+
function extractLabeledTitle(text) {
|
|
18
|
+
const match = text.match(/^(?:项目名称|标题|Title)\s*[::]?\s*\*{0,2}([^*]+)\*{0,2}/);
|
|
19
|
+
return match?.[1]?.trim() || "";
|
|
20
|
+
}
|
|
21
|
+
/** 剥 ATX 标题前缀,便于与官网节点纯文本对齐 */
|
|
22
|
+
function stripAtxPrefix(line) {
|
|
23
|
+
return line.replace(/^#{1,6}\s+/, "").trim();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 候选是否像正文(禁止当文件名)。
|
|
27
|
+
* 对齐官网:不因长度否决;仅空串 / 换行 / `##` 等多段泄漏(MD 特有防护)。
|
|
28
|
+
*/
|
|
29
|
+
function looksLikeArticleBody(text) {
|
|
30
|
+
if (!text.trim()) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (/[\r\n]/.test(text)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
if (text.includes("##") || /\n#{1,6}/.test(text)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 将标题候选收成安全导出 basename(不含扩展名)。
|
|
43
|
+
* 对齐官网:整题作文件名、不截断;CLI 仅替换 Windows 非法字符以便 writeFile。
|
|
44
|
+
*/
|
|
45
|
+
export function toNsfcExportBasename(titleCandidate) {
|
|
46
|
+
const raw = titleCandidate.trim();
|
|
47
|
+
if (!raw || looksLikeArticleBody(raw)) {
|
|
48
|
+
return DEFAULT_NSFC_ARTICLE_TITLE;
|
|
49
|
+
}
|
|
50
|
+
const sanitized = sanitizeFilename(raw, { maxLength: null });
|
|
51
|
+
return (sanitized.replace(/\.[A-Za-z0-9]{1,8}$/, "") || DEFAULT_NSFC_ARTICLE_TITLE);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 从全文 Markdown 提取项目标题(对齐官网 getTitleFromArticle)。
|
|
55
|
+
* 标签行「标题」无值时跳过,取下一行正文;「标题:xxx」同行取值;否则取首个非空内容行。
|
|
56
|
+
*/
|
|
57
|
+
export function extractNsfcArticleTitle(markdown) {
|
|
58
|
+
const lines = markdown.split(/\r?\n/);
|
|
59
|
+
for (const raw of lines) {
|
|
60
|
+
const line = raw.trim();
|
|
61
|
+
if (!line) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const text = stripAtxPrefix(line);
|
|
65
|
+
if (!text) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (checkIsTitleLabel(text)) {
|
|
69
|
+
const labeled = extractLabeledTitle(text);
|
|
70
|
+
if (labeled) {
|
|
71
|
+
return labeled;
|
|
72
|
+
}
|
|
73
|
+
// 仅标签(如「标题」/「# 标题」)→ 继续取下一行,对齐官网 extractTitle 为空时不 return
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
return text;
|
|
77
|
+
}
|
|
78
|
+
return DEFAULT_NSFC_ARTICLE_TITLE;
|
|
79
|
+
}
|
|
80
|
+
function buildDocxFormData(markdown, produceId) {
|
|
81
|
+
const form = new FormData();
|
|
82
|
+
form.append("data", new Blob([markdown], { type: "text/plain" }), "blob");
|
|
83
|
+
form.append("is_aigc", "true");
|
|
84
|
+
form.append("content_producer", NSFC_CONTENT_PRODUCER);
|
|
85
|
+
form.append("produce_id", produceId || "");
|
|
86
|
+
form.append("csl_key", "");
|
|
87
|
+
return form;
|
|
88
|
+
}
|
|
89
|
+
async function convertMarkdownToDocx(markdown, produceId) {
|
|
90
|
+
const client = new ApiClient();
|
|
91
|
+
return client.requestBinary("data_conversion/v2/markdown/to/docx", {
|
|
92
|
+
method: "POST",
|
|
93
|
+
baseUrl: getDefaultNewideaBaseUrl(),
|
|
94
|
+
body: buildDocxFormData(markdown, produceId),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 确定 docx 输出路径。
|
|
99
|
+
* article download 传入标题 basename;format-convert 可传固定 defaultName。
|
|
100
|
+
* 不再依赖转换 API 的 Content-Disposition 文件名。
|
|
101
|
+
*/
|
|
102
|
+
function resolveDocxPath(outputOption, preferredFilename, defaultName = DEFAULT_DOCX_NAME) {
|
|
103
|
+
const safeName = sanitizeFilename(preferredFilename ?? defaultName);
|
|
104
|
+
if (outputOption) {
|
|
105
|
+
const resolved = resolveUserPath(outputOption);
|
|
106
|
+
if (extname(resolved))
|
|
107
|
+
return resolved;
|
|
108
|
+
return join(resolved, safeName);
|
|
109
|
+
}
|
|
110
|
+
return join(getUserDownloadsDir(), safeName);
|
|
111
|
+
}
|
|
112
|
+
function resolveMarkdownPath(docxPath) {
|
|
113
|
+
const ext = extname(docxPath);
|
|
114
|
+
if (ext)
|
|
115
|
+
return docxPath.slice(0, docxPath.length - ext.length) + ".md";
|
|
116
|
+
return `${docxPath}.md`;
|
|
117
|
+
}
|
|
118
|
+
export async function runDownloadNsfcArticle(options) {
|
|
119
|
+
const format = options.format ?? "markdown";
|
|
120
|
+
if (options.orderId && options.file) {
|
|
121
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "--order-id 与 --file 互斥,请二选一");
|
|
122
|
+
}
|
|
123
|
+
let article = "";
|
|
124
|
+
let produceId = options.produceId ?? "";
|
|
125
|
+
if (options.orderId) {
|
|
126
|
+
const cached = await loadNsfcArticleCache(options.orderId);
|
|
127
|
+
if (cached?.article) {
|
|
128
|
+
article = cached.article;
|
|
129
|
+
if (!produceId && cached.workflowRunId) {
|
|
130
|
+
produceId = cached.workflowRunId;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
const session = await loadNsfcSessionCache(options.orderId);
|
|
135
|
+
article = String(session?.article ?? "").trim();
|
|
136
|
+
if (!produceId && session?.workflowRunId) {
|
|
137
|
+
produceId = session.workflowRunId;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (!article) {
|
|
141
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `订单 ${options.orderId} 全文缓存缺失,请重新执行 article create 或通过 --file 提供 Markdown`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (options.file) {
|
|
145
|
+
try {
|
|
146
|
+
article = await readFile(resolveUserPath(options.file), "utf8");
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `无法读取全文文件: ${options.file}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "请通过 --order-id 或 --file 提供全文");
|
|
154
|
+
}
|
|
155
|
+
const markdown = `${article.trim()}\n`;
|
|
156
|
+
const articleTitle = extractNsfcArticleTitle(markdown);
|
|
157
|
+
const filename = `${toNsfcExportBasename(articleTitle)}.docx`;
|
|
158
|
+
const { buffer, contentType } = await convertMarkdownToDocx(markdown, produceId);
|
|
159
|
+
// 本地标题命名(对齐原站 saveAs);忽略 API Content-Disposition
|
|
160
|
+
const docxPath = resolveDocxPath(options.output, filename);
|
|
161
|
+
await mkdir(dirname(docxPath), { recursive: true });
|
|
162
|
+
await writeFile(docxPath, buffer);
|
|
163
|
+
const mdPath = resolveMarkdownPath(docxPath);
|
|
164
|
+
const mdBuffer = Buffer.from(markdown, "utf8");
|
|
165
|
+
await writeFile(mdPath, mdBuffer);
|
|
166
|
+
if (options.orderId) {
|
|
167
|
+
await popNsfcArticleCache(options.orderId).catch(() => undefined);
|
|
168
|
+
}
|
|
169
|
+
const result = {
|
|
170
|
+
mdPath,
|
|
171
|
+
mdSize: mdBuffer.byteLength,
|
|
172
|
+
docxPath,
|
|
173
|
+
docxSize: buffer.byteLength,
|
|
174
|
+
contentType,
|
|
175
|
+
filename,
|
|
176
|
+
};
|
|
177
|
+
if (format === "json") {
|
|
178
|
+
printOutput(wrapWorkbenchResult(result, { step: "article-download", subType: "nsfc" }, {
|
|
179
|
+
orderId: options.orderId,
|
|
180
|
+
}), "json");
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
console.log(`全文 Markdown 已保存: ${mdPath} (${result.mdSize} 字节)`);
|
|
184
|
+
console.log(`全文 Word(原始引文)已保存: ${docxPath} (${result.docxSize} 字节)`);
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
/** 供 format-convert 复用的 docx 转换 */
|
|
188
|
+
export { convertMarkdownToDocx, resolveDocxPath, resolveMarkdownPath };
|
|
189
|
+
//# sourceMappingURL=article-download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"article-download.js","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/article-download.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,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,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,kCAAkC;AAClC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAEzC,MAAM,iBAAiB,GAAG,GAAG,0BAA0B,OAAO,CAAC;AAmB/D,+CAA+C;AAC/C,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAO,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAED,0CAA0C;AAC1C,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CACtB,oDAAoD,CACrD,CAAC;IACF,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC;AAED,8BAA8B;AAC9B,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,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,CAAC;AAChB,CAAC;AAED,mCAAmC;AACnC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface FormatConvertOptions {
|
|
3
|
+
orderId?: string;
|
|
4
|
+
output?: string;
|
|
5
|
+
yes?: boolean;
|
|
6
|
+
format?: OutputFormat;
|
|
7
|
+
}
|
|
8
|
+
export declare function runNsfcFormatConvert(options: FormatConvertOptions): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=format-convert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-convert.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/format-convert.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAwBnC,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAyHf"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// 格式转换:全文 MD → 工作流改写 → Word
|
|
2
|
+
// Agent/原站 UI 在 program 为「地区项目」「省市级别项目」时不提示此入口;本命令本身不拦(与源码只藏按钮一致)
|
|
3
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
|
+
import { helixlifeError, helixlifeErrorCode, printOutput, createFormatLogger, } from "../../../../core/index.js";
|
|
6
|
+
import { wrapWorkbenchResult } from "../../../shared/result-wrapper.js";
|
|
7
|
+
import { buildNsfcExecuteBody, createNsfcOrder, extractNsfcOrderId, } from "../apps.js";
|
|
8
|
+
import { convertMarkdownToDocx, resolveDocxPath, resolveMarkdownPath, } from "./article-download.js";
|
|
9
|
+
import { NSFC_APP_NAMES, NSFC_EXECUTE_API_PATH, NSFC_FORMAT_CONVERT_APP_ID, } from "../constants.js";
|
|
10
|
+
import { buildNsfcOutlineSlimBody } from "../parse-outline.js";
|
|
11
|
+
import { loadNsfcSessionCache, saveNsfcSessionCache, } from "../session-cache.js";
|
|
12
|
+
import { streamNsfcWorkflow } from "../sse-utils.js";
|
|
13
|
+
export async function runNsfcFormatConvert(options) {
|
|
14
|
+
const format = options.format ?? "markdown";
|
|
15
|
+
const log = createFormatLogger(format);
|
|
16
|
+
if (!options.orderId?.trim()) {
|
|
17
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "format-convert 必须提供 --order-id");
|
|
18
|
+
}
|
|
19
|
+
const session = await loadNsfcSessionCache(options.orderId);
|
|
20
|
+
if (!session) {
|
|
21
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, `会话缓存缺失:orderId=${options.orderId}`);
|
|
22
|
+
}
|
|
23
|
+
const article = String(session.article ?? "").trim();
|
|
24
|
+
if (!article) {
|
|
25
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_ARGUMENT, "缺少全文:请先执行 article create");
|
|
26
|
+
}
|
|
27
|
+
const slim = buildNsfcOutlineSlimBody(session);
|
|
28
|
+
const program = slim.inputs.program;
|
|
29
|
+
log("接口正在处理中,请耐心等待...");
|
|
30
|
+
const childOrder = await createNsfcOrder({
|
|
31
|
+
index: 3,
|
|
32
|
+
count: 1,
|
|
33
|
+
query: "格式转换",
|
|
34
|
+
inputs: { program, text: article },
|
|
35
|
+
parent_order_id: session.orderId,
|
|
36
|
+
});
|
|
37
|
+
const childOrderId = extractNsfcOrderId(childOrder);
|
|
38
|
+
const body = buildNsfcExecuteBody({
|
|
39
|
+
query: "格式转换",
|
|
40
|
+
inputs: { program, text: article },
|
|
41
|
+
appId: NSFC_FORMAT_CONVERT_APP_ID,
|
|
42
|
+
appName: NSFC_APP_NAMES.formatConversion,
|
|
43
|
+
orderId: childOrderId,
|
|
44
|
+
index: 3,
|
|
45
|
+
parentOrderId: session.orderId,
|
|
46
|
+
end: false,
|
|
47
|
+
});
|
|
48
|
+
const stream = await streamNsfcWorkflow({
|
|
49
|
+
path: NSFC_EXECUTE_API_PATH,
|
|
50
|
+
body,
|
|
51
|
+
format,
|
|
52
|
+
startLabel: "格式转换中…",
|
|
53
|
+
progressLabel: "格式转换进行中",
|
|
54
|
+
finishLabel: "格式转换完成",
|
|
55
|
+
failureMessage: "格式转换失败",
|
|
56
|
+
emptyMessage: "格式转换结果为空",
|
|
57
|
+
});
|
|
58
|
+
const fromOutput = typeof stream.outputs?.output === "string"
|
|
59
|
+
? stream.outputs.output.trim()
|
|
60
|
+
: typeof stream.outputs?.text === "string"
|
|
61
|
+
? stream.outputs.text.trim()
|
|
62
|
+
: typeof stream.outputs?.answer === "string"
|
|
63
|
+
? stream.outputs.answer.trim()
|
|
64
|
+
: "";
|
|
65
|
+
const converted = (fromOutput || stream.text).trim();
|
|
66
|
+
if (!converted) {
|
|
67
|
+
throw new helixlifeError(helixlifeErrorCode.INVALID_RESPONSE, "格式转换结果为空");
|
|
68
|
+
}
|
|
69
|
+
await saveNsfcSessionCache({
|
|
70
|
+
...session,
|
|
71
|
+
convertedArticle: converted,
|
|
72
|
+
});
|
|
73
|
+
const defaultName = "nsfc-format-converted.docx";
|
|
74
|
+
const docxPath = resolveDocxPath(options.output, undefined, defaultName);
|
|
75
|
+
const { buffer } = await convertMarkdownToDocx(`${converted}\n`, stream.workflowRunId ?? "");
|
|
76
|
+
await mkdir(dirname(docxPath), { recursive: true });
|
|
77
|
+
await writeFile(docxPath, buffer);
|
|
78
|
+
const mdPath = resolveMarkdownPath(docxPath);
|
|
79
|
+
await writeFile(mdPath, `${converted}\n`, "utf8");
|
|
80
|
+
const result = {
|
|
81
|
+
mdPath,
|
|
82
|
+
docxPath,
|
|
83
|
+
mdSize: Buffer.byteLength(converted, "utf8"),
|
|
84
|
+
docxSize: buffer.byteLength,
|
|
85
|
+
ready: true,
|
|
86
|
+
};
|
|
87
|
+
if (format === "json") {
|
|
88
|
+
printOutput(wrapWorkbenchResult(result, { step: "format-convert", subType: "nsfc" }, {
|
|
89
|
+
orderId: session.orderId,
|
|
90
|
+
workflowRunId: stream.workflowRunId,
|
|
91
|
+
}), "json");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
console.log("## 格式转换完成\n");
|
|
95
|
+
console.log(`Markdown: ${mdPath}`);
|
|
96
|
+
console.log(`Word: ${docxPath}`);
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=format-convert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-convert.js","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/format-convert.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,kBAAkB,GAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,E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,QAAQ,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type OutputFormat } from "../../../../core/index.js";
|
|
2
|
+
export interface AnalyzeNsfcHypothesisOptions {
|
|
3
|
+
query?: string;
|
|
4
|
+
queryFile?: string;
|
|
5
|
+
inputsFile?: string;
|
|
6
|
+
hasHypothesis?: string;
|
|
7
|
+
nextSubStep?: string;
|
|
8
|
+
yes?: boolean;
|
|
9
|
+
format?: OutputFormat;
|
|
10
|
+
}
|
|
11
|
+
export declare function runAnalyzeNsfcHypothesis(options: AnalyzeNsfcHypothesisOptions): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=hypothesis-analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hypothesis-analyze.d.ts","sourceRoot":"","sources":["../../../../../src/modules/fund/nsfc/commands/hypothesis-analyze.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AAkCnC,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AA8FD,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAuXf"}
|