skill-calorie 0.2.3 → 0.2.4
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/SKILL.md +469 -118
- package/dist/.gen-inputs.json +170 -0
- package/dist/analysis/commands.d.ts +62 -0
- package/dist/analysis/commands.d.ts.map +1 -0
- package/dist/analysis/commands.js +386 -0
- package/dist/analysis/commands.js.map +1 -0
- package/dist/analysis/contraindications.d.ts.map +1 -1
- package/dist/analysis/contraindications.js +16 -12
- package/dist/analysis/contraindications.js.map +1 -1
- package/dist/analysis/cross.d.ts +3 -0
- package/dist/analysis/cross.d.ts.map +1 -1
- package/dist/analysis/cross.js +54 -26
- package/dist/analysis/cross.js.map +1 -1
- package/dist/analysis/dashboard.d.ts.map +1 -1
- package/dist/analysis/dashboard.js +3 -2
- package/dist/analysis/dashboard.js.map +1 -1
- package/dist/analysis/exerciseReview.js +1 -1
- package/dist/analysis/exerciseReview.js.map +1 -1
- package/dist/analysis/healthPlate.d.ts +21 -0
- package/dist/analysis/healthPlate.d.ts.map +1 -0
- package/dist/analysis/healthPlate.js +41 -0
- package/dist/analysis/healthPlate.js.map +1 -0
- package/dist/analysis/historyStore.d.ts +30 -0
- package/dist/analysis/historyStore.d.ts.map +1 -0
- package/dist/analysis/historyStore.js +32 -0
- package/dist/analysis/historyStore.js.map +1 -0
- package/dist/analysis/index.d.ts +23 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +23 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/multiTrend.d.ts +67 -0
- package/dist/analysis/multiTrend.d.ts.map +1 -0
- package/dist/analysis/multiTrend.js +106 -0
- package/dist/analysis/multiTrend.js.map +1 -0
- package/dist/analysis/multiTrendPage.d.ts +4 -0
- package/dist/analysis/multiTrendPage.d.ts.map +1 -0
- package/dist/analysis/multiTrendPage.js +502 -0
- package/dist/analysis/multiTrendPage.js.map +1 -0
- package/dist/analysis/reportDoc.d.ts +12 -0
- package/dist/analysis/reportDoc.d.ts.map +1 -0
- package/dist/analysis/reportDoc.js +244 -0
- package/dist/analysis/reportDoc.js.map +1 -0
- package/dist/analysis/reportDocBmi.d.ts +4 -0
- package/dist/analysis/reportDocBmi.d.ts.map +1 -0
- package/dist/analysis/reportDocBmi.js +104 -0
- package/dist/analysis/reportDocBmi.js.map +1 -0
- package/dist/analysis/reportDocParts.d.ts +77 -0
- package/dist/analysis/reportDocParts.d.ts.map +1 -0
- package/dist/analysis/reportDocParts.js +249 -0
- package/dist/analysis/reportDocParts.js.map +1 -0
- package/dist/analysis/reportDocScore.d.ts +8 -0
- package/dist/analysis/reportDocScore.d.ts.map +1 -0
- package/dist/analysis/reportDocScore.js +223 -0
- package/dist/analysis/reportDocScore.js.map +1 -0
- package/dist/analysis/reportDocScoreSeries.d.ts +3 -0
- package/dist/analysis/reportDocScoreSeries.d.ts.map +1 -0
- package/dist/analysis/reportDocScoreSeries.js +27 -0
- package/dist/analysis/reportDocScoreSeries.js.map +1 -0
- package/dist/analysis/reportDocTracked.d.ts +10 -0
- package/dist/analysis/reportDocTracked.d.ts.map +1 -0
- package/dist/analysis/reportDocTracked.js +195 -0
- package/dist/analysis/reportDocTracked.js.map +1 -0
- package/dist/analysis/reportPlate.d.ts +163 -0
- package/dist/analysis/reportPlate.d.ts.map +1 -0
- package/dist/analysis/reportPlate.js +251 -0
- package/dist/analysis/reportPlate.js.map +1 -0
- package/dist/analysis/routes.d.ts +18 -0
- package/dist/analysis/routes.d.ts.map +1 -0
- package/dist/analysis/routes.js +178 -0
- package/dist/analysis/routes.js.map +1 -0
- package/dist/analysis/series.d.ts +31 -6
- package/dist/analysis/series.d.ts.map +1 -1
- package/dist/analysis/series.js +121 -24
- package/dist/analysis/series.js.map +1 -1
- package/dist/analysis/simulate.d.ts.map +1 -1
- package/dist/analysis/simulate.js +17 -6
- package/dist/analysis/simulate.js.map +1 -1
- package/dist/analysis/simulate2.d.ts.map +1 -1
- package/dist/analysis/simulate2.js +43 -11
- package/dist/analysis/simulate2.js.map +1 -1
- package/dist/analysis/trend.d.ts +9 -1
- package/dist/analysis/trend.d.ts.map +1 -1
- package/dist/analysis/trend.js +24 -8
- package/dist/analysis/trend.js.map +1 -1
- package/dist/analysis/utils.d.ts +40 -2
- package/dist/analysis/utils.d.ts.map +1 -1
- package/dist/analysis/utils.js +63 -2
- package/dist/analysis/utils.js.map +1 -1
- package/dist/body/bodyDocs.d.ts +4 -0
- package/dist/body/bodyDocs.d.ts.map +1 -0
- package/dist/body/bodyDocs.js +284 -0
- package/dist/body/bodyDocs.js.map +1 -0
- package/dist/body/bodyPlate.d.ts +145 -0
- package/dist/body/bodyPlate.d.ts.map +1 -0
- package/dist/body/bodyPlate.js +243 -0
- package/dist/body/bodyPlate.js.map +1 -0
- package/dist/body/bodyReadUi.d.ts +47 -0
- package/dist/body/bodyReadUi.d.ts.map +1 -0
- package/dist/body/bodyReadUi.js +164 -0
- package/dist/body/bodyReadUi.js.map +1 -0
- package/dist/body/commands.d.ts +29 -0
- package/dist/body/commands.d.ts.map +1 -0
- package/dist/body/commands.js +18 -0
- package/dist/body/commands.js.map +1 -0
- package/dist/body/compare.d.ts +62 -0
- package/dist/body/compare.d.ts.map +1 -0
- package/dist/body/compare.js +162 -0
- package/dist/body/compare.js.map +1 -0
- package/dist/body/compareCompositionDoc.d.ts +3 -0
- package/dist/body/compareCompositionDoc.d.ts.map +1 -0
- package/dist/body/compareCompositionDoc.js +99 -0
- package/dist/body/compareCompositionDoc.js.map +1 -0
- package/dist/body/compareMeasureDoc.d.ts +3 -0
- package/dist/body/compareMeasureDoc.d.ts.map +1 -0
- package/dist/body/compareMeasureDoc.js +91 -0
- package/dist/body/compareMeasureDoc.js.map +1 -0
- package/dist/body/compareUi.d.ts +12 -0
- package/dist/body/compareUi.d.ts.map +1 -0
- package/dist/body/compareUi.js +27 -0
- package/dist/body/compareUi.js.map +1 -0
- package/dist/body/index.d.ts +21 -0
- package/dist/body/index.d.ts.map +1 -0
- package/dist/body/index.js +22 -0
- package/dist/body/index.js.map +1 -0
- package/dist/body/log.d.ts +29 -0
- package/dist/body/log.d.ts.map +1 -0
- package/dist/body/log.js +196 -0
- package/dist/body/log.js.map +1 -0
- package/dist/body/receipt.d.ts +52 -0
- package/dist/body/receipt.d.ts.map +1 -0
- package/dist/body/receipt.js +248 -0
- package/dist/body/receipt.js.map +1 -0
- package/dist/body/receiptData.d.ts +46 -0
- package/dist/body/receiptData.d.ts.map +1 -0
- package/dist/body/receiptData.js +107 -0
- package/dist/body/receiptData.js.map +1 -0
- package/dist/body/receiptUi.d.ts +9 -0
- package/dist/body/receiptUi.d.ts.map +1 -0
- package/dist/body/receiptUi.js +75 -0
- package/dist/body/receiptUi.js.map +1 -0
- package/dist/body/remove.d.ts +21 -0
- package/dist/body/remove.d.ts.map +1 -0
- package/dist/body/remove.js +78 -0
- package/dist/body/remove.js.map +1 -0
- package/dist/body/routes.d.ts +10 -0
- package/dist/body/routes.d.ts.map +1 -0
- package/dist/body/routes.js +20 -0
- package/dist/body/routes.js.map +1 -0
- package/dist/body/view.d.ts +21 -0
- package/dist/body/view.d.ts.map +1 -0
- package/dist/body/view.js +50 -0
- package/dist/body/view.js.map +1 -0
- package/dist/body/wizard.d.ts +14 -0
- package/dist/body/wizard.d.ts.map +1 -0
- package/dist/body/wizard.js +21 -0
- package/dist/body/wizard.js.map +1 -0
- package/dist/body/wizardDocs.d.ts +4 -0
- package/dist/body/wizardDocs.d.ts.map +1 -0
- package/dist/body/wizardDocs.js +260 -0
- package/dist/body/wizardDocs.js.map +1 -0
- package/dist/body/wizardPlate.d.ts +146 -0
- package/dist/body/wizardPlate.d.ts.map +1 -0
- package/dist/body/wizardPlate.js +260 -0
- package/dist/body/wizardPlate.js.map +1 -0
- package/dist/body/wizardPrompt.d.ts +52 -0
- package/dist/body/wizardPrompt.d.ts.map +1 -0
- package/dist/body/wizardPrompt.js +146 -0
- package/dist/body/wizardPrompt.js.map +1 -0
- package/dist/body/wizardUi.d.ts +11 -0
- package/dist/body/wizardUi.d.ts.map +1 -0
- package/dist/body/wizardUi.js +35 -0
- package/dist/body/wizardUi.js.map +1 -0
- package/dist/cli/cmd_read.d.ts +7 -26
- package/dist/cli/cmd_read.d.ts.map +1 -1
- package/dist/cli/cmd_read.js +46 -1081
- package/dist/cli/cmd_read.js.map +1 -1
- package/dist/cli/delivery.d.ts +34 -0
- package/dist/cli/delivery.d.ts.map +1 -0
- package/dist/cli/delivery.js +223 -0
- package/dist/cli/delivery.js.map +1 -0
- package/dist/cli/keys.d.ts +303 -165
- package/dist/cli/keys.d.ts.map +1 -1
- package/dist/cli/keys.js +101 -77
- package/dist/cli/keys.js.map +1 -1
- package/dist/cli/legacy/index.d.ts +25 -0
- package/dist/cli/legacy/index.d.ts.map +1 -0
- package/dist/cli/legacy/index.js +37 -0
- package/dist/cli/legacy/index.js.map +1 -0
- package/dist/cli/legacy/routes/index.d.ts +8 -0
- package/dist/cli/legacy/routes/index.d.ts.map +1 -0
- package/dist/cli/legacy/routes/index.js +23 -0
- package/dist/cli/legacy/routes/index.js.map +1 -0
- package/dist/cli/legacy/routes/scene-01.d.ts +12 -0
- package/dist/cli/legacy/routes/scene-01.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-01.js +2 -0
- package/dist/cli/legacy/routes/scene-01.js.map +1 -0
- package/dist/cli/legacy/routes/scene-02.d.ts +18 -0
- package/dist/cli/legacy/routes/scene-02.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-02.js +2 -0
- package/dist/cli/legacy/routes/scene-02.js.map +1 -0
- package/dist/cli/legacy/routes/scene-03.d.ts +13 -0
- package/dist/cli/legacy/routes/scene-03.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-03.js +2 -0
- package/dist/cli/legacy/routes/scene-03.js.map +1 -0
- package/dist/cli/legacy/routes/scene-04.d.ts +10 -0
- package/dist/cli/legacy/routes/scene-04.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-04.js +2 -0
- package/dist/cli/legacy/routes/scene-04.js.map +1 -0
- package/dist/cli/legacy/routes/scene-05.d.ts +10 -0
- package/dist/cli/legacy/routes/scene-05.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-05.js +2 -0
- package/dist/cli/legacy/routes/scene-05.js.map +1 -0
- package/dist/cli/legacy/routes/scene-06.d.ts +10 -0
- package/dist/cli/legacy/routes/scene-06.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-06.js +2 -0
- package/dist/cli/legacy/routes/scene-06.js.map +1 -0
- package/dist/cli/legacy/routes/scene-07.d.ts +10 -0
- package/dist/cli/legacy/routes/scene-07.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-07.js +2 -0
- package/dist/cli/legacy/routes/scene-07.js.map +1 -0
- package/dist/cli/legacy/routes/scene-08.d.ts +12 -0
- package/dist/cli/legacy/routes/scene-08.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-08.js +2 -0
- package/dist/cli/legacy/routes/scene-08.js.map +1 -0
- package/dist/cli/legacy/routes/scene-09.d.ts +12 -0
- package/dist/cli/legacy/routes/scene-09.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-09.js +2 -0
- package/dist/cli/legacy/routes/scene-09.js.map +1 -0
- package/dist/cli/legacy/routes/scene-10.d.ts +10 -0
- package/dist/cli/legacy/routes/scene-10.d.ts.map +1 -0
- package/dist/cli/legacy/routes/scene-10.js +2 -0
- package/dist/cli/legacy/routes/scene-10.js.map +1 -0
- package/dist/cli/legacy/scene-01.d.ts +13 -0
- package/dist/cli/legacy/scene-01.d.ts.map +1 -0
- package/dist/cli/legacy/scene-01.js +2 -0
- package/dist/cli/legacy/scene-01.js.map +1 -0
- package/dist/cli/legacy/scene-02.d.ts +12 -0
- package/dist/cli/legacy/scene-02.d.ts.map +1 -0
- package/dist/cli/legacy/scene-02.js +2 -0
- package/dist/cli/legacy/scene-02.js.map +1 -0
- package/dist/cli/legacy/scene-03.d.ts +14 -0
- package/dist/cli/legacy/scene-03.d.ts.map +1 -0
- package/dist/cli/legacy/scene-03.js +2 -0
- package/dist/cli/legacy/scene-03.js.map +1 -0
- package/dist/cli/legacy/scene-04.d.ts +12 -0
- package/dist/cli/legacy/scene-04.d.ts.map +1 -0
- package/dist/cli/legacy/scene-04.js +2 -0
- package/dist/cli/legacy/scene-04.js.map +1 -0
- package/dist/cli/legacy/scene-05.d.ts +14 -0
- package/dist/cli/legacy/scene-05.d.ts.map +1 -0
- package/dist/cli/legacy/scene-05.js +2 -0
- package/dist/cli/legacy/scene-05.js.map +1 -0
- package/dist/cli/legacy/scene-06.d.ts +15 -0
- package/dist/cli/legacy/scene-06.d.ts.map +1 -0
- package/dist/cli/legacy/scene-06.js +2 -0
- package/dist/cli/legacy/scene-06.js.map +1 -0
- package/dist/cli/legacy/scene-07.d.ts +15 -0
- package/dist/cli/legacy/scene-07.d.ts.map +1 -0
- package/dist/cli/legacy/scene-07.js +2 -0
- package/dist/cli/legacy/scene-07.js.map +1 -0
- package/dist/cli/legacy/scene-08.d.ts +13 -0
- package/dist/cli/legacy/scene-08.d.ts.map +1 -0
- package/dist/cli/legacy/scene-08.js +2 -0
- package/dist/cli/legacy/scene-08.js.map +1 -0
- package/dist/cli/legacy/scene-09.d.ts +13 -0
- package/dist/cli/legacy/scene-09.d.ts.map +1 -0
- package/dist/cli/legacy/scene-09.js +2 -0
- package/dist/cli/legacy/scene-09.js.map +1 -0
- package/dist/cli/legacy/scene-10.d.ts +13 -0
- package/dist/cli/legacy/scene-10.d.ts.map +1 -0
- package/dist/cli/legacy/scene-10.js +2 -0
- package/dist/cli/legacy/scene-10.js.map +1 -0
- package/dist/cli/legacy/types.d.ts +16 -0
- package/dist/cli/legacy/types.d.ts.map +1 -0
- package/dist/cli/legacy/types.js +2 -0
- package/dist/cli/legacy/types.js.map +1 -0
- package/dist/cli/readArgs.d.ts +21 -0
- package/dist/cli/readArgs.d.ts.map +1 -0
- package/dist/cli/readArgs.js +72 -0
- package/dist/cli/readArgs.js.map +1 -0
- package/dist/cli/registry.d.ts +12 -0
- package/dist/cli/registry.d.ts.map +1 -0
- package/dist/cli/registry.js +38 -0
- package/dist/cli/registry.js.map +1 -0
- package/dist/cli/write.d.ts +15 -15
- package/dist/cli/write.d.ts.map +1 -1
- package/dist/cli/write.js +37 -945
- package/dist/cli/write.js.map +1 -1
- package/dist/diet/commands.d.ts +37 -0
- package/dist/diet/commands.d.ts.map +1 -0
- package/dist/diet/commands.js +44 -0
- package/dist/diet/commands.js.map +1 -0
- package/dist/diet/dietEngine.d.ts +79 -0
- package/dist/diet/dietEngine.d.ts.map +1 -0
- package/dist/diet/dietEngine.js +171 -0
- package/dist/diet/dietEngine.js.map +1 -0
- package/dist/diet/dietUi.d.ts +9 -0
- package/dist/diet/dietUi.d.ts.map +1 -0
- package/dist/diet/dietUi.js +45 -0
- package/dist/diet/dietUi.js.map +1 -0
- package/dist/diet/edit.d.ts +22 -0
- package/dist/diet/edit.d.ts.map +1 -0
- package/dist/diet/edit.js +96 -0
- package/dist/diet/edit.js.map +1 -0
- package/dist/diet/fieldLabels.d.ts +5 -0
- package/dist/diet/fieldLabels.d.ts.map +1 -0
- package/dist/diet/fieldLabels.js +44 -0
- package/dist/diet/fieldLabels.js.map +1 -0
- package/dist/diet/index.d.ts +26 -0
- package/dist/diet/index.d.ts.map +1 -0
- package/dist/diet/index.js +22 -0
- package/dist/diet/index.js.map +1 -0
- package/dist/diet/library.d.ts +20 -0
- package/dist/diet/library.d.ts.map +1 -0
- package/dist/diet/library.js +52 -0
- package/dist/diet/library.js.map +1 -0
- package/dist/diet/libraryDocs.d.ts +7 -0
- package/dist/diet/libraryDocs.d.ts.map +1 -0
- package/dist/diet/libraryDocs.js +361 -0
- package/dist/diet/libraryDocs.js.map +1 -0
- package/dist/diet/libraryPlate.d.ts +41 -0
- package/dist/diet/libraryPlate.d.ts.map +1 -0
- package/dist/diet/libraryPlate.js +57 -0
- package/dist/diet/libraryPlate.js.map +1 -0
- package/dist/diet/log.d.ts +18 -0
- package/dist/diet/log.d.ts.map +1 -0
- package/dist/diet/log.js +152 -0
- package/dist/diet/log.js.map +1 -0
- package/dist/diet/nutrition.d.ts +37 -0
- package/dist/diet/nutrition.d.ts.map +1 -0
- package/dist/diet/nutrition.js +135 -0
- package/dist/diet/nutrition.js.map +1 -0
- package/dist/diet/nutritionPort.d.ts +129 -0
- package/dist/diet/nutritionPort.d.ts.map +1 -0
- package/dist/diet/nutritionPort.js +246 -0
- package/dist/diet/nutritionPort.js.map +1 -0
- package/dist/diet/nutritionPortDocs.d.ts +106 -0
- package/dist/diet/nutritionPortDocs.d.ts.map +1 -0
- package/dist/diet/nutritionPortDocs.js +651 -0
- package/dist/diet/nutritionPortDocs.js.map +1 -0
- package/dist/diet/precheck.d.ts +7 -0
- package/dist/diet/precheck.d.ts.map +1 -0
- package/dist/diet/precheck.js +194 -0
- package/dist/diet/precheck.js.map +1 -0
- package/dist/diet/precheckLabel.d.ts +4 -0
- package/dist/diet/precheckLabel.d.ts.map +1 -0
- package/dist/diet/precheckLabel.js +191 -0
- package/dist/diet/precheckLabel.js.map +1 -0
- package/dist/diet/precheckParts.d.ts +49 -0
- package/dist/diet/precheckParts.d.ts.map +1 -0
- package/dist/diet/precheckParts.js +69 -0
- package/dist/diet/precheckParts.js.map +1 -0
- package/dist/diet/precheckPort.d.ts +82 -0
- package/dist/diet/precheckPort.d.ts.map +1 -0
- package/dist/diet/precheckPort.js +176 -0
- package/dist/diet/precheckPort.js.map +1 -0
- package/dist/diet/productImport.d.ts +28 -0
- package/dist/diet/productImport.d.ts.map +1 -0
- package/dist/diet/productImport.js +152 -0
- package/dist/diet/productImport.js.map +1 -0
- package/dist/diet/productStore.d.ts +62 -0
- package/dist/diet/productStore.d.ts.map +1 -0
- package/dist/diet/productStore.js +73 -0
- package/dist/diet/productStore.js.map +1 -0
- package/dist/diet/products.d.ts +15 -0
- package/dist/diet/products.d.ts.map +1 -0
- package/dist/diet/products.js +87 -0
- package/dist/diet/products.js.map +1 -0
- package/dist/diet/ranking.d.ts +18 -0
- package/dist/diet/ranking.d.ts.map +1 -0
- package/dist/diet/ranking.js +23 -0
- package/dist/diet/ranking.js.map +1 -0
- package/dist/diet/rankingDocs.d.ts +13 -0
- package/dist/diet/rankingDocs.d.ts.map +1 -0
- package/dist/diet/rankingDocs.js +341 -0
- package/dist/diet/rankingDocs.js.map +1 -0
- package/dist/diet/rankingPlate.d.ts +42 -0
- package/dist/diet/rankingPlate.d.ts.map +1 -0
- package/dist/diet/rankingPlate.js +96 -0
- package/dist/diet/rankingPlate.js.map +1 -0
- package/dist/diet/receipt.d.ts +34 -0
- package/dist/diet/receipt.d.ts.map +1 -0
- package/dist/diet/receipt.js +371 -0
- package/dist/diet/receipt.js.map +1 -0
- package/dist/diet/review.d.ts +36 -0
- package/dist/diet/review.d.ts.map +1 -0
- package/dist/diet/review.js +152 -0
- package/dist/diet/review.js.map +1 -0
- package/dist/diet/reviewDocs.d.ts +72 -0
- package/dist/diet/reviewDocs.d.ts.map +1 -0
- package/dist/diet/reviewDocs.js +312 -0
- package/dist/diet/reviewDocs.js.map +1 -0
- package/dist/diet/routes.d.ts +12 -0
- package/dist/diet/routes.d.ts.map +1 -0
- package/dist/diet/routes.js +108 -0
- package/dist/diet/routes.js.map +1 -0
- package/dist/diet/sourceStatsDocs.d.ts +3 -0
- package/dist/diet/sourceStatsDocs.d.ts.map +1 -0
- package/dist/diet/sourceStatsDocs.js +115 -0
- package/dist/diet/sourceStatsDocs.js.map +1 -0
- package/dist/diet/today.d.ts +14 -0
- package/dist/diet/today.d.ts.map +1 -0
- package/dist/diet/today.js +87 -0
- package/dist/diet/today.js.map +1 -0
- package/dist/diet/todayDocs.d.ts +53 -0
- package/dist/diet/todayDocs.d.ts.map +1 -0
- package/dist/diet/todayDocs.js +238 -0
- package/dist/diet/todayDocs.js.map +1 -0
- package/dist/exercise/cardio.d.ts +11 -0
- package/dist/exercise/cardio.d.ts.map +1 -0
- package/dist/exercise/cardio.js +14 -0
- package/dist/exercise/cardio.js.map +1 -0
- package/dist/exercise/categoryColors.d.ts +23 -0
- package/dist/exercise/categoryColors.d.ts.map +1 -0
- package/dist/exercise/categoryColors.js +28 -0
- package/dist/exercise/categoryColors.js.map +1 -0
- package/dist/exercise/commands.d.ts +20 -0
- package/dist/exercise/commands.d.ts.map +1 -0
- package/dist/exercise/commands.js +22 -0
- package/dist/exercise/commands.js.map +1 -0
- package/dist/exercise/distribution.d.ts +11 -0
- package/dist/exercise/distribution.d.ts.map +1 -0
- package/dist/exercise/distribution.js +14 -0
- package/dist/exercise/distribution.js.map +1 -0
- package/dist/exercise/edit.d.ts +22 -0
- package/dist/exercise/edit.d.ts.map +1 -0
- package/dist/exercise/edit.js +148 -0
- package/dist/exercise/edit.js.map +1 -0
- package/dist/exercise/exerciseStore.d.ts +87 -0
- package/dist/exercise/exerciseStore.d.ts.map +1 -0
- package/dist/exercise/exerciseStore.js +287 -0
- package/dist/exercise/exerciseStore.js.map +1 -0
- package/dist/exercise/fieldLabels.d.ts +5 -0
- package/dist/exercise/fieldLabels.d.ts.map +1 -0
- package/dist/exercise/fieldLabels.js +34 -0
- package/dist/exercise/fieldLabels.js.map +1 -0
- package/dist/exercise/goal.d.ts +16 -0
- package/dist/exercise/goal.d.ts.map +1 -0
- package/dist/exercise/goal.js +46 -0
- package/dist/exercise/goal.js.map +1 -0
- package/dist/exercise/index.d.ts +22 -0
- package/dist/exercise/index.d.ts.map +1 -0
- package/dist/exercise/index.js +22 -0
- package/dist/exercise/index.js.map +1 -0
- package/dist/exercise/log.d.ts +19 -0
- package/dist/exercise/log.d.ts.map +1 -0
- package/dist/exercise/log.js +102 -0
- package/dist/exercise/log.js.map +1 -0
- package/dist/exercise/precheck.d.ts +19 -0
- package/dist/exercise/precheck.d.ts.map +1 -0
- package/dist/exercise/precheck.js +127 -0
- package/dist/exercise/precheck.js.map +1 -0
- package/dist/exercise/recap.d.ts +11 -0
- package/dist/exercise/recap.d.ts.map +1 -0
- package/dist/exercise/recap.js +14 -0
- package/dist/exercise/recap.js.map +1 -0
- package/dist/exercise/receipt.d.ts +43 -0
- package/dist/exercise/receipt.d.ts.map +1 -0
- package/dist/exercise/receipt.js +401 -0
- package/dist/exercise/receipt.js.map +1 -0
- package/dist/exercise/records.d.ts +60 -0
- package/dist/exercise/records.d.ts.map +1 -0
- package/dist/exercise/records.js +317 -0
- package/dist/exercise/records.js.map +1 -0
- package/dist/exercise/routes.d.ts +21 -0
- package/dist/exercise/routes.d.ts.map +1 -0
- package/dist/exercise/routes.js +38 -0
- package/dist/exercise/routes.js.map +1 -0
- package/dist/exercise/sportUi.d.ts +77 -0
- package/dist/exercise/sportUi.d.ts.map +1 -0
- package/dist/exercise/sportUi.js +268 -0
- package/dist/exercise/sportUi.js.map +1 -0
- package/dist/exercise/strength.d.ts +11 -0
- package/dist/exercise/strength.d.ts.map +1 -0
- package/dist/exercise/strength.js +14 -0
- package/dist/exercise/strength.js.map +1 -0
- package/dist/exercise/trend.d.ts +11 -0
- package/dist/exercise/trend.d.ts.map +1 -0
- package/dist/exercise/trend.js +14 -0
- package/dist/exercise/trend.js.map +1 -0
- package/dist/fetch/audit.d.ts +2 -0
- package/dist/fetch/audit.d.ts.map +1 -1
- package/dist/fetch/audit.js +11 -10
- package/dist/fetch/audit.js.map +1 -1
- package/dist/fetch/batch.js +1 -1
- package/dist/fetch/batch.js.map +1 -1
- package/dist/fetch/body.d.ts +104 -1
- package/dist/fetch/body.d.ts.map +1 -1
- package/dist/fetch/body.js +195 -26
- package/dist/fetch/body.js.map +1 -1
- package/dist/fetch/cli.js +11 -5
- package/dist/fetch/cli.js.map +1 -1
- package/dist/fetch/index.d.ts +5 -7
- package/dist/fetch/index.d.ts.map +1 -1
- package/dist/fetch/index.js +7 -6
- package/dist/fetch/index.js.map +1 -1
- package/dist/fetch/profile.d.ts +24 -3
- package/dist/fetch/profile.d.ts.map +1 -1
- package/dist/fetch/profile.js +43 -14
- package/dist/fetch/profile.js.map +1 -1
- package/dist/fetch/xunji-catalog.d.ts +5 -0
- package/dist/fetch/xunji-catalog.d.ts.map +1 -1
- package/dist/fetch/xunji-catalog.js +22 -1
- package/dist/fetch/xunji-catalog.js.map +1 -1
- package/dist/goal/commands.d.ts +31 -0
- package/dist/goal/commands.d.ts.map +1 -0
- package/dist/goal/commands.js +20 -0
- package/dist/goal/commands.js.map +1 -0
- package/dist/goal/goalExtraPlate.d.ts +45 -0
- package/dist/goal/goalExtraPlate.d.ts.map +1 -0
- package/dist/goal/goalExtraPlate.js +95 -0
- package/dist/goal/goalExtraPlate.js.map +1 -0
- package/dist/goal/goalHistory.d.ts +24 -0
- package/dist/goal/goalHistory.d.ts.map +1 -0
- package/dist/goal/goalHistory.js +51 -0
- package/dist/goal/goalHistory.js.map +1 -0
- package/dist/goal/goalPlate.d.ts +24 -0
- package/dist/goal/goalPlate.d.ts.map +1 -0
- package/dist/goal/goalPlate.js +34 -0
- package/dist/goal/goalPlate.js.map +1 -0
- package/dist/goal/goalPlates.d.ts +66 -0
- package/dist/goal/goalPlates.d.ts.map +1 -0
- package/dist/goal/goalPlates.js +114 -0
- package/dist/goal/goalPlates.js.map +1 -0
- package/dist/goal/goalRecommendDoc.d.ts +6 -0
- package/dist/goal/goalRecommendDoc.d.ts.map +1 -0
- package/dist/goal/goalRecommendDoc.js +107 -0
- package/dist/goal/goalRecommendDoc.js.map +1 -0
- package/dist/goal/goalStore.d.ts +56 -0
- package/dist/goal/goalStore.d.ts.map +1 -0
- package/dist/goal/goalStore.js +111 -0
- package/dist/goal/goalStore.js.map +1 -0
- package/dist/goal/goalWeightDoc.d.ts +7 -0
- package/dist/goal/goalWeightDoc.d.ts.map +1 -0
- package/dist/goal/goalWeightDoc.js +107 -0
- package/dist/goal/goalWeightDoc.js.map +1 -0
- package/dist/goal/index.d.ts +17 -0
- package/dist/goal/index.d.ts.map +1 -0
- package/dist/goal/index.js +21 -0
- package/dist/goal/index.js.map +1 -0
- package/dist/goal/nutritionGoal.d.ts +115 -0
- package/dist/goal/nutritionGoal.d.ts.map +1 -0
- package/dist/goal/nutritionGoal.js +165 -0
- package/dist/goal/nutritionGoal.js.map +1 -0
- package/dist/goal/precheck.d.ts +14 -0
- package/dist/goal/precheck.d.ts.map +1 -0
- package/dist/goal/precheck.js +213 -0
- package/dist/goal/precheck.js.map +1 -0
- package/dist/goal/read.d.ts +53 -0
- package/dist/goal/read.d.ts.map +1 -0
- package/dist/goal/read.js +154 -0
- package/dist/goal/read.js.map +1 -0
- package/dist/goal/receipt.d.ts +38 -0
- package/dist/goal/receipt.d.ts.map +1 -0
- package/dist/goal/receipt.js +290 -0
- package/dist/goal/receipt.js.map +1 -0
- package/dist/goal/resultDocs.d.ts +23 -0
- package/dist/goal/resultDocs.d.ts.map +1 -0
- package/dist/goal/resultDocs.js +279 -0
- package/dist/goal/resultDocs.js.map +1 -0
- package/dist/goal/routes.d.ts +12 -0
- package/dist/goal/routes.d.ts.map +1 -0
- package/dist/goal/routes.js +29 -0
- package/dist/goal/routes.js.map +1 -0
- package/dist/goal/set.d.ts +97 -0
- package/dist/goal/set.d.ts.map +1 -0
- package/dist/goal/set.js +103 -0
- package/dist/goal/set.js.map +1 -0
- package/dist/goal/write.d.ts +30 -0
- package/dist/goal/write.d.ts.map +1 -0
- package/dist/goal/write.js +102 -0
- package/dist/goal/write.js.map +1 -0
- package/dist/help-missing.json +35 -0
- package/dist/home/commands.d.ts +11 -0
- package/dist/home/commands.d.ts.map +1 -0
- package/dist/home/commands.js +8 -0
- package/dist/home/commands.js.map +1 -0
- package/dist/home/exercise.d.ts +27 -0
- package/dist/home/exercise.d.ts.map +1 -0
- package/dist/home/exercise.js +60 -0
- package/dist/home/exercise.js.map +1 -0
- package/dist/home/goalProgressDocs.d.ts +27 -0
- package/dist/home/goalProgressDocs.d.ts.map +1 -0
- package/dist/home/goalProgressDocs.js +363 -0
- package/dist/home/goalProgressDocs.js.map +1 -0
- package/dist/home/home.d.ts +38 -0
- package/dist/home/home.d.ts.map +1 -0
- package/dist/home/home.js +78 -0
- package/dist/home/home.js.map +1 -0
- package/dist/home/homeDocs.d.ts +8 -0
- package/dist/home/homeDocs.d.ts.map +1 -0
- package/dist/home/homeDocs.js +307 -0
- package/dist/home/homeDocs.js.map +1 -0
- package/dist/home/homeViewParts.d.ts +42 -0
- package/dist/home/homeViewParts.d.ts.map +1 -0
- package/dist/home/homeViewParts.js +316 -0
- package/dist/home/homeViewParts.js.map +1 -0
- package/dist/home/index.d.ts +14 -0
- package/dist/home/index.d.ts.map +1 -0
- package/dist/home/index.js +13 -0
- package/dist/home/index.js.map +1 -0
- package/dist/home/routes.d.ts +10 -0
- package/dist/home/routes.d.ts.map +1 -0
- package/dist/home/routes.js +47 -0
- package/dist/home/routes.js.map +1 -0
- package/dist/home/today.d.ts +50 -0
- package/dist/home/today.d.ts.map +1 -0
- package/dist/home/today.js +255 -0
- package/dist/home/today.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/migrate/migrate.js +1 -1
- package/dist/output.d.ts +19 -9
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +58 -125
- package/dist/output.js.map +1 -1
- package/dist/photo/commands.d.ts +55 -0
- package/dist/photo/commands.d.ts.map +1 -0
- package/dist/photo/commands.js +25 -0
- package/dist/photo/commands.js.map +1 -0
- package/dist/photo/compare.d.ts +24 -0
- package/dist/photo/compare.d.ts.map +1 -0
- package/dist/photo/compare.js +48 -0
- package/dist/photo/compare.js.map +1 -0
- package/dist/photo/compareDoc.d.ts +5 -0
- package/dist/photo/compareDoc.d.ts.map +1 -0
- package/dist/photo/compareDoc.js +221 -0
- package/dist/photo/compareDoc.js.map +1 -0
- package/dist/photo/dir.d.ts +5 -0
- package/dist/photo/dir.d.ts.map +1 -0
- package/dist/photo/dir.js +22 -0
- package/dist/photo/dir.js.map +1 -0
- package/dist/photo/gallery.d.ts +16 -0
- package/dist/photo/gallery.d.ts.map +1 -0
- package/dist/photo/gallery.js +45 -0
- package/dist/photo/gallery.js.map +1 -0
- package/dist/photo/galleryDoc.d.ts +12 -0
- package/dist/photo/galleryDoc.d.ts.map +1 -0
- package/dist/photo/galleryDoc.js +291 -0
- package/dist/photo/galleryDoc.js.map +1 -0
- package/dist/photo/gif.d.ts +28 -0
- package/dist/photo/gif.d.ts.map +1 -0
- package/dist/photo/gif.js +281 -0
- package/dist/photo/gif.js.map +1 -0
- package/dist/photo/gifDoc.d.ts +52 -0
- package/dist/photo/gifDoc.d.ts.map +1 -0
- package/dist/photo/gifDoc.js +311 -0
- package/dist/photo/gifDoc.js.map +1 -0
- package/dist/photo/help.d.ts +4 -0
- package/dist/photo/help.d.ts.map +1 -0
- package/dist/photo/help.js +87 -0
- package/dist/photo/help.js.map +1 -0
- package/dist/photo/helpCenter.d.ts +137 -0
- package/dist/photo/helpCenter.d.ts.map +1 -0
- package/dist/photo/helpCenter.js +475 -0
- package/dist/photo/helpCenter.js.map +1 -0
- package/dist/photo/helpDoc.d.ts +5 -0
- package/dist/photo/helpDoc.d.ts.map +1 -0
- package/dist/photo/helpDoc.js +205 -0
- package/dist/photo/helpDoc.js.map +1 -0
- package/dist/photo/helpDocContent.d.ts +77 -0
- package/dist/photo/helpDocContent.d.ts.map +1 -0
- package/dist/photo/helpDocContent.js +120 -0
- package/dist/photo/helpDocContent.js.map +1 -0
- package/dist/photo/helpDocCss.d.ts +5 -0
- package/dist/photo/helpDocCss.d.ts.map +1 -0
- package/dist/photo/helpDocCss.js +119 -0
- package/dist/photo/helpDocCss.js.map +1 -0
- package/dist/photo/helpFile.d.ts +26 -0
- package/dist/photo/helpFile.d.ts.map +1 -0
- package/dist/photo/helpFile.js +90 -0
- package/dist/photo/helpFile.js.map +1 -0
- package/dist/photo/helpLookup.d.ts +18 -0
- package/dist/photo/helpLookup.d.ts.map +1 -0
- package/dist/photo/helpLookup.js +58 -0
- package/dist/photo/helpLookup.js.map +1 -0
- package/dist/photo/helpPaths.d.ts +22 -0
- package/dist/photo/helpPaths.d.ts.map +1 -0
- package/dist/photo/helpPaths.js +22 -0
- package/dist/photo/helpPaths.js.map +1 -0
- package/dist/photo/index.d.ts +17 -0
- package/dist/photo/index.d.ts.map +1 -0
- package/dist/photo/index.js +21 -0
- package/dist/photo/index.js.map +1 -0
- package/dist/photo/manage.d.ts +13 -0
- package/dist/photo/manage.d.ts.map +1 -0
- package/dist/photo/manage.js +64 -0
- package/dist/photo/manage.js.map +1 -0
- package/dist/photo/photo.d.ts +118 -0
- package/dist/photo/photo.d.ts.map +1 -0
- package/dist/photo/photo.js +279 -0
- package/dist/photo/photo.js.map +1 -0
- package/dist/photo/photoThumb.d.ts +38 -0
- package/dist/photo/photoThumb.d.ts.map +1 -0
- package/dist/photo/photoThumb.js +83 -0
- package/dist/photo/photoThumb.js.map +1 -0
- package/dist/photo/photoUi.d.ts +39 -0
- package/dist/photo/photoUi.d.ts.map +1 -0
- package/dist/photo/photoUi.js +233 -0
- package/dist/photo/photoUi.js.map +1 -0
- package/dist/photo/photos.d.ts +76 -0
- package/dist/photo/photos.d.ts.map +1 -0
- package/dist/photo/photos.js +193 -0
- package/dist/photo/photos.js.map +1 -0
- package/dist/photo/picker.d.ts +41 -0
- package/dist/photo/picker.d.ts.map +1 -0
- package/dist/photo/picker.js +132 -0
- package/dist/photo/picker.js.map +1 -0
- package/dist/photo/pickerDoc.d.ts +12 -0
- package/dist/photo/pickerDoc.d.ts.map +1 -0
- package/dist/photo/pickerDoc.js +231 -0
- package/dist/photo/pickerDoc.js.map +1 -0
- package/dist/photo/receipt.d.ts +23 -0
- package/dist/photo/receipt.d.ts.map +1 -0
- package/dist/photo/receipt.js +331 -0
- package/dist/photo/receipt.js.map +1 -0
- package/dist/photo/receiptUi.d.ts +42 -0
- package/dist/photo/receiptUi.d.ts.map +1 -0
- package/dist/photo/receiptUi.js +147 -0
- package/dist/photo/receiptUi.js.map +1 -0
- package/dist/photo/routes.d.ts +10 -0
- package/dist/photo/routes.d.ts.map +1 -0
- package/dist/photo/routes.js +29 -0
- package/dist/photo/routes.js.map +1 -0
- package/dist/photo/store.d.ts +10 -0
- package/dist/photo/store.d.ts.map +1 -0
- package/dist/photo/store.js +44 -0
- package/dist/photo/store.js.map +1 -0
- package/dist/photo/viewerDoc.d.ts +5 -0
- package/dist/photo/viewerDoc.d.ts.map +1 -0
- package/dist/photo/viewerDoc.js +255 -0
- package/dist/photo/viewerDoc.js.map +1 -0
- package/dist/photo/wizard.d.ts +15 -0
- package/dist/photo/wizard.d.ts.map +1 -0
- package/dist/photo/wizard.js +25 -0
- package/dist/photo/wizard.js.map +1 -0
- package/dist/photo/wizardUi.d.ts +24 -0
- package/dist/photo/wizardUi.d.ts.map +1 -0
- package/dist/photo/wizardUi.js +101 -0
- package/dist/photo/wizardUi.js.map +1 -0
- package/dist/profile/commands.d.ts +28 -0
- package/dist/profile/commands.d.ts.map +1 -0
- package/dist/profile/commands.js +10 -0
- package/dist/profile/commands.js.map +1 -0
- package/dist/profile/index.d.ts +23 -0
- package/dist/profile/index.d.ts.map +1 -0
- package/dist/profile/index.js +22 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/profile/labels.d.ts +10 -0
- package/dist/profile/labels.d.ts.map +1 -0
- package/dist/profile/labels.js +52 -0
- package/dist/profile/labels.js.map +1 -0
- package/dist/profile/read.d.ts +13 -0
- package/dist/profile/read.d.ts.map +1 -0
- package/dist/profile/read.js +24 -0
- package/dist/profile/read.js.map +1 -0
- package/dist/profile/receipt.d.ts +10 -0
- package/dist/profile/receipt.d.ts.map +1 -0
- package/dist/profile/receipt.js +19 -0
- package/dist/profile/receipt.js.map +1 -0
- package/dist/profile/routes.d.ts +8 -0
- package/dist/profile/routes.d.ts.map +1 -0
- package/dist/profile/routes.js +9 -0
- package/dist/profile/routes.js.map +1 -0
- package/dist/profile/setup.d.ts +25 -6
- package/dist/profile/setup.d.ts.map +1 -1
- package/dist/profile/setup.js +184 -78
- package/dist/profile/setup.js.map +1 -1
- package/dist/profile/update.d.ts +1 -1
- package/dist/profile/update.d.ts.map +1 -1
- package/dist/profile/update.js +33 -13
- package/dist/profile/update.js.map +1 -1
- package/dist/profile/view.d.ts +35 -4
- package/dist/profile/view.d.ts.map +1 -1
- package/dist/profile/view.js +132 -22
- package/dist/profile/view.js.map +1 -1
- package/dist/profile/write.d.ts +16 -0
- package/dist/profile/write.d.ts.map +1 -0
- package/dist/profile/write.js +75 -0
- package/dist/profile/write.js.map +1 -0
- package/dist/render/analysisPlate.d.ts +1 -1
- package/dist/render/analysisPlate.d.ts.map +1 -1
- package/dist/render/analysisPlate.js +1 -1
- package/dist/render/analysisPlate.js.map +1 -1
- package/dist/render/dietDocs.d.ts +19 -19
- package/dist/render/dietDocs.d.ts.map +1 -1
- package/dist/render/dietDocs.js +158 -457
- package/dist/render/dietDocs.js.map +1 -1
- package/dist/render/exercisePort.d.ts +3 -1
- package/dist/render/exercisePort.d.ts.map +1 -1
- package/dist/render/exercisePort.js +4 -3
- package/dist/render/exercisePort.js.map +1 -1
- package/dist/render/goalExtra.d.ts.map +1 -1
- package/dist/render/goalExtra.js +2 -1
- package/dist/render/goalExtra.js.map +1 -1
- package/dist/render/goalPlate.d.ts +2 -2
- package/dist/render/goalPlate.d.ts.map +1 -1
- package/dist/render/goalPlate.js +3 -3
- package/dist/render/goalPlate.js.map +1 -1
- package/dist/render/helpShell.d.ts +1 -1
- package/dist/render/helpShell.d.ts.map +1 -1
- package/dist/render/html.d.ts +36 -20
- package/dist/render/html.d.ts.map +1 -1
- package/dist/render/html.js +37 -45
- package/dist/render/html.js.map +1 -1
- package/dist/render/index.d.ts +35 -31
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +29 -17
- package/dist/render/index.js.map +1 -1
- package/dist/render/insightPlate.d.ts +17 -0
- package/dist/render/insightPlate.d.ts.map +1 -1
- package/dist/render/insightPlate.js +109 -1
- package/dist/render/insightPlate.js.map +1 -1
- package/dist/render/pageChromeCss.d.ts +24 -0
- package/dist/render/pageChromeCss.d.ts.map +1 -0
- package/dist/render/pageChromeCss.js +45 -0
- package/dist/render/pageChromeCss.js.map +1 -0
- package/dist/render/planCopyBlock.d.ts +32 -0
- package/dist/render/planCopyBlock.d.ts.map +1 -0
- package/dist/render/planCopyBlock.js +34 -0
- package/dist/render/planCopyBlock.js.map +1 -0
- package/dist/render/planEditor.d.ts +94 -0
- package/dist/render/planEditor.d.ts.map +1 -0
- package/dist/render/planEditor.js +38 -0
- package/dist/render/planEditor.js.map +1 -0
- package/dist/render/planEditorCss.d.ts +13 -0
- package/dist/render/planEditorCss.d.ts.map +1 -0
- package/dist/render/planEditorCss.js +140 -0
- package/dist/render/planEditorCss.js.map +1 -0
- package/dist/render/planEditorDocs.d.ts +7 -0
- package/dist/render/planEditorDocs.d.ts.map +1 -0
- package/dist/render/planEditorDocs.js +56 -0
- package/dist/render/planEditorDocs.js.map +1 -0
- package/dist/render/planEditorPort.d.ts +45 -0
- package/dist/render/planEditorPort.d.ts.map +1 -0
- package/dist/render/planEditorPort.js +217 -0
- package/dist/render/planEditorPort.js.map +1 -0
- package/dist/render/planEditorRuntime.d.ts +15 -0
- package/dist/render/planEditorRuntime.d.ts.map +1 -0
- package/dist/render/planEditorRuntime.js +427 -0
- package/dist/render/planEditorRuntime.js.map +1 -0
- package/dist/render/planPlate.d.ts +84 -4
- package/dist/render/planPlate.d.ts.map +1 -1
- package/dist/render/planPlate.js +155 -7
- package/dist/render/planPlate.js.map +1 -1
- package/dist/render/planWizardCss.d.ts +21 -0
- package/dist/render/planWizardCss.d.ts.map +1 -0
- package/dist/render/planWizardCss.js +121 -0
- package/dist/render/planWizardCss.js.map +1 -0
- package/dist/render/planWizardDocs.d.ts +8 -0
- package/dist/render/planWizardDocs.d.ts.map +1 -0
- package/dist/render/planWizardDocs.js +151 -0
- package/dist/render/planWizardDocs.js.map +1 -0
- package/dist/render/receipt.d.ts +1 -1
- package/dist/render/receipt.d.ts.map +1 -1
- package/dist/render/receipt.js +1 -1
- package/dist/render/receipt.js.map +1 -1
- package/dist/render/reviewDocs.d.ts +3 -0
- package/dist/render/reviewDocs.d.ts.map +1 -0
- package/dist/render/reviewDocs.js +222 -0
- package/dist/render/reviewDocs.js.map +1 -0
- package/dist/render/reviewDocsCss.d.ts +5 -0
- package/dist/render/reviewDocsCss.d.ts.map +1 -0
- package/dist/render/reviewDocsCss.js +128 -0
- package/dist/render/reviewDocsCss.js.map +1 -0
- package/dist/render/sportDocs.d.ts +17 -12
- package/dist/render/sportDocs.d.ts.map +1 -1
- package/dist/render/sportDocs.js +370 -525
- package/dist/render/sportDocs.js.map +1 -1
- package/dist/render/sportPortDocs.d.ts +3 -2
- package/dist/render/sportPortDocs.d.ts.map +1 -1
- package/dist/render/sportPortDocs.js +810 -389
- package/dist/render/sportPortDocs.js.map +1 -1
- package/dist/render/trendDocs.d.ts +16 -6
- package/dist/render/trendDocs.d.ts.map +1 -1
- package/dist/render/trendDocs.js +293 -252
- package/dist/render/trendDocs.js.map +1 -1
- package/dist/render/trendMiscPort.d.ts +9 -24
- package/dist/render/trendMiscPort.d.ts.map +1 -1
- package/dist/render/trendMiscPort.js +7 -30
- package/dist/render/trendMiscPort.js.map +1 -1
- package/dist/render/trendMiscPortDocs.d.ts +1 -2
- package/dist/render/trendMiscPortDocs.d.ts.map +1 -1
- package/dist/render/trendMiscPortDocs.js +256 -107
- package/dist/render/trendMiscPortDocs.js.map +1 -1
- package/dist/render/trendPredictDocs.d.ts +16 -0
- package/dist/render/trendPredictDocs.d.ts.map +1 -0
- package/dist/render/trendPredictDocs.js +1131 -0
- package/dist/render/trendPredictDocs.js.map +1 -0
- package/dist/render/wizardPort.d.ts +9 -62
- package/dist/render/wizardPort.d.ts.map +1 -1
- package/dist/render/wizardPort.js +20 -180
- package/dist/render/wizardPort.js.map +1 -1
- package/dist/render/wizardPortDocs.d.ts +5 -5
- package/dist/render/wizardPortDocs.d.ts.map +1 -1
- package/dist/render/wizardPortDocs.js +273 -215
- package/dist/render/wizardPortDocs.js.map +1 -1
- package/dist/render/workoutMovementTable.d.ts +10 -0
- package/dist/render/workoutMovementTable.d.ts.map +1 -0
- package/dist/render/workoutMovementTable.js +153 -0
- package/dist/render/workoutMovementTable.js.map +1 -0
- package/dist/render/workoutPlanCss.d.ts +15 -0
- package/dist/render/workoutPlanCss.d.ts.map +1 -0
- package/dist/render/workoutPlanCss.js +217 -0
- package/dist/render/workoutPlanCss.js.map +1 -0
- package/dist/render/workoutPlanDocs.d.ts +23 -0
- package/dist/render/workoutPlanDocs.d.ts.map +1 -0
- package/dist/render/workoutPlanDocs.js +244 -0
- package/dist/render/workoutPlanDocs.js.map +1 -0
- package/dist/render/workoutPlanLook.d.ts +16 -0
- package/dist/render/workoutPlanLook.d.ts.map +1 -0
- package/dist/render/workoutPlanLook.js +135 -0
- package/dist/render/workoutPlanLook.js.map +1 -0
- package/dist/shared/commandSpec.d.ts +73 -0
- package/dist/shared/commandSpec.d.ts.map +1 -0
- package/dist/shared/commandSpec.js +2 -0
- package/dist/shared/commandSpec.js.map +1 -0
- package/dist/shared/conclusionLine.d.ts +3 -0
- package/dist/shared/conclusionLine.d.ts.map +1 -0
- package/dist/shared/conclusionLine.js +21 -0
- package/dist/shared/conclusionLine.js.map +1 -0
- package/dist/shared/contentSuffix.d.ts +17 -0
- package/dist/shared/contentSuffix.d.ts.map +1 -0
- package/dist/shared/contentSuffix.js +125 -0
- package/dist/shared/contentSuffix.js.map +1 -0
- package/dist/shared/copyArea.d.ts +30 -11
- package/dist/shared/copyArea.d.ts.map +1 -1
- package/dist/shared/copyArea.js +68 -13
- package/dist/shared/copyArea.js.map +1 -1
- package/dist/shared/docPage.d.ts +26 -4
- package/dist/shared/docPage.d.ts.map +1 -1
- package/dist/shared/docPage.js +83 -9
- package/dist/shared/docPage.js.map +1 -1
- package/dist/shared/emptyGuide.d.ts +9 -0
- package/dist/shared/emptyGuide.d.ts.map +1 -0
- package/dist/shared/emptyGuide.js +31 -0
- package/dist/shared/emptyGuide.js.map +1 -0
- package/dist/shared/fieldLabel.d.ts +5 -0
- package/dist/shared/fieldLabel.d.ts.map +1 -0
- package/dist/shared/fieldLabel.js +42 -0
- package/dist/shared/fieldLabel.js.map +1 -0
- package/dist/shared/operationHead.d.ts +21 -0
- package/dist/shared/operationHead.d.ts.map +1 -0
- package/dist/shared/operationHead.js +73 -0
- package/dist/shared/operationHead.js.map +1 -0
- package/dist/shared/pageKit.d.ts +25 -0
- package/dist/shared/pageKit.d.ts.map +1 -0
- package/dist/shared/pageKit.js +56 -0
- package/dist/shared/pageKit.js.map +1 -0
- package/dist/shared/params.d.ts +54 -0
- package/dist/shared/params.d.ts.map +1 -0
- package/dist/shared/params.js +176 -0
- package/dist/shared/params.js.map +1 -0
- package/dist/shared/receiptParts.d.ts +9 -0
- package/dist/shared/receiptParts.d.ts.map +1 -0
- package/dist/shared/receiptParts.js +40 -0
- package/dist/shared/receiptParts.js.map +1 -0
- package/dist/shared/sceneEnvelope.d.ts +32 -0
- package/dist/shared/sceneEnvelope.d.ts.map +1 -0
- package/dist/shared/sceneEnvelope.js +12 -0
- package/dist/shared/sceneEnvelope.js.map +1 -0
- package/dist/shared/sourceLine.d.ts +10 -0
- package/dist/shared/sourceLine.d.ts.map +1 -0
- package/dist/shared/sourceLine.js +37 -0
- package/dist/shared/sourceLine.js.map +1 -0
- package/dist/shared/writeParts.d.ts +61 -0
- package/dist/shared/writeParts.d.ts.map +1 -0
- package/dist/shared/writeParts.js +79 -0
- package/dist/shared/writeParts.js.map +1 -0
- package/dist/triggers/help-lookup.d.ts +41 -5
- package/dist/triggers/help-lookup.d.ts.map +1 -1
- package/dist/triggers/help-lookup.js +100 -51
- package/dist/triggers/help-lookup.js.map +1 -1
- package/dist/triggers/index.js +1 -1
- package/dist/triggers/routeSpec.d.ts +66 -0
- package/dist/triggers/routeSpec.d.ts.map +1 -0
- package/dist/triggers/routeSpec.js +21 -0
- package/dist/triggers/routeSpec.js.map +1 -0
- package/dist/triggers/routes.generated.d.ts +17 -0
- package/dist/triggers/routes.generated.d.ts.map +1 -0
- package/dist/triggers/routes.generated.js +519 -0
- package/dist/triggers/routes.generated.js.map +1 -0
- package/dist/triggers/routing.d.ts +11 -34
- package/dist/triggers/routing.d.ts.map +1 -1
- package/dist/triggers/routing.js +12 -528
- package/dist/triggers/routing.js.map +1 -1
- package/dist/triggers/scene-01-home.js +9 -9
- package/dist/triggers/scene-01-home.js.map +1 -1
- package/dist/triggers/scene-02-diet.js +62 -62
- package/dist/triggers/scene-02-diet.js.map +1 -1
- package/dist/triggers/scene-03-weight.js +54 -54
- package/dist/triggers/scene-03-weight.js.map +1 -1
- package/dist/triggers/scene-04-exercise.js +33 -33
- package/dist/triggers/scene-04-exercise.js.map +1 -1
- package/dist/triggers/scene-05-workout.js +32 -32
- package/dist/triggers/scene-05-workout.js.map +1 -1
- package/dist/triggers/scene-06-goal.d.ts +1 -1
- package/dist/triggers/scene-06-goal.d.ts.map +1 -1
- package/dist/triggers/scene-06-goal.js +25 -24
- package/dist/triggers/scene-06-goal.js.map +1 -1
- package/dist/triggers/scene-07-profile.js +1 -1
- package/dist/triggers/scene-07-profile.js.map +1 -1
- package/dist/triggers/scene-08-body.js +10 -10
- package/dist/triggers/scene-08-body.js.map +1 -1
- package/dist/triggers/scene-09-photo.js +10 -10
- package/dist/triggers/scene-09-photo.js.map +1 -1
- package/dist/triggers/scene-10-analysis.js +176 -176
- package/dist/triggers/scene-10-analysis.js.map +1 -1
- package/dist/triggers/wake-assets.d.ts.map +1 -1
- package/dist/triggers/wake-assets.js +21 -11
- package/dist/triggers/wake-assets.js.map +1 -1
- package/dist/weight/commands.d.ts +21 -0
- package/dist/weight/commands.d.ts.map +1 -0
- package/dist/weight/commands.js +18 -0
- package/dist/weight/commands.js.map +1 -0
- package/dist/weight/compare.d.ts +60 -0
- package/dist/weight/compare.d.ts.map +1 -0
- package/dist/weight/compare.js +570 -0
- package/dist/weight/compare.js.map +1 -0
- package/dist/weight/edit.d.ts +13 -0
- package/dist/weight/edit.d.ts.map +1 -0
- package/dist/weight/edit.js +87 -0
- package/dist/weight/edit.js.map +1 -0
- package/dist/weight/fieldLabels.d.ts +5 -0
- package/dist/weight/fieldLabels.d.ts.map +1 -0
- package/dist/weight/fieldLabels.js +23 -0
- package/dist/weight/fieldLabels.js.map +1 -0
- package/dist/weight/figures.d.ts +87 -0
- package/dist/weight/figures.d.ts.map +1 -0
- package/dist/weight/figures.js +219 -0
- package/dist/weight/figures.js.map +1 -0
- package/dist/weight/history.d.ts +85 -0
- package/dist/weight/history.d.ts.map +1 -0
- package/dist/weight/history.js +771 -0
- package/dist/weight/history.js.map +1 -0
- package/dist/weight/index.d.ts +27 -0
- package/dist/weight/index.d.ts.map +1 -0
- package/dist/weight/index.js +23 -0
- package/dist/weight/index.js.map +1 -0
- package/dist/weight/log.d.ts +40 -0
- package/dist/weight/log.d.ts.map +1 -0
- package/dist/weight/log.js +355 -0
- package/dist/weight/log.js.map +1 -0
- package/dist/weight/logReceipt.d.ts +28 -0
- package/dist/weight/logReceipt.d.ts.map +1 -0
- package/dist/weight/logReceipt.js +259 -0
- package/dist/weight/logReceipt.js.map +1 -0
- package/dist/weight/plate.d.ts +77 -0
- package/dist/weight/plate.d.ts.map +1 -0
- package/dist/weight/plate.js +60 -0
- package/dist/weight/plate.js.map +1 -0
- package/dist/weight/plateDocs.d.ts +83 -0
- package/dist/weight/plateDocs.d.ts.map +1 -0
- package/dist/weight/plateDocs.js +179 -0
- package/dist/weight/plateDocs.js.map +1 -0
- package/dist/weight/receipt.d.ts +23 -0
- package/dist/weight/receipt.d.ts.map +1 -0
- package/dist/weight/receipt.js +178 -0
- package/dist/weight/receipt.js.map +1 -0
- package/dist/weight/records.d.ts +109 -0
- package/dist/weight/records.d.ts.map +1 -0
- package/dist/weight/records.js +210 -0
- package/dist/weight/records.js.map +1 -0
- package/dist/weight/review.d.ts +114 -0
- package/dist/weight/review.d.ts.map +1 -0
- package/dist/weight/review.js +651 -0
- package/dist/weight/review.js.map +1 -0
- package/dist/weight/routes.d.ts +7 -0
- package/dist/weight/routes.d.ts.map +1 -0
- package/dist/weight/routes.js +68 -0
- package/dist/weight/routes.js.map +1 -0
- package/dist/weight/volatility.d.ts +78 -0
- package/dist/weight/volatility.d.ts.map +1 -0
- package/dist/weight/volatility.js +203 -0
- package/dist/weight/volatility.js.map +1 -0
- package/dist/weight/volatilityDoc.d.ts +10 -0
- package/dist/weight/volatilityDoc.d.ts.map +1 -0
- package/dist/weight/volatilityDoc.js +395 -0
- package/dist/weight/volatilityDoc.js.map +1 -0
- package/dist/weight/weightCompare.d.ts +70 -0
- package/dist/weight/weightCompare.d.ts.map +1 -0
- package/dist/weight/weightCompare.js +221 -0
- package/dist/weight/weightCompare.js.map +1 -0
- package/dist/weight/weightCompare2.d.ts +66 -0
- package/dist/weight/weightCompare2.d.ts.map +1 -0
- package/dist/weight/weightCompare2.js +218 -0
- package/dist/weight/weightCompare2.js.map +1 -0
- package/dist/weight/weightCompare3.d.ts +18 -0
- package/dist/weight/weightCompare3.d.ts.map +1 -0
- package/dist/weight/weightCompare3.js +222 -0
- package/dist/weight/weightCompare3.js.map +1 -0
- package/dist/weight/weightUi.d.ts +114 -0
- package/dist/weight/weightUi.d.ts.map +1 -0
- package/dist/weight/weightUi.js +256 -0
- package/dist/weight/weightUi.js.map +1 -0
- package/dist/workout/commands.d.ts +29 -0
- package/dist/workout/commands.d.ts.map +1 -0
- package/dist/workout/commands.js +35 -0
- package/dist/workout/commands.js.map +1 -0
- package/dist/workout/contraindication.d.ts +11 -0
- package/dist/workout/contraindication.d.ts.map +1 -0
- package/dist/workout/contraindication.js +11 -0
- package/dist/workout/contraindication.js.map +1 -0
- package/dist/workout/dayPhrase.d.ts +13 -0
- package/dist/workout/dayPhrase.d.ts.map +1 -0
- package/dist/workout/dayPhrase.js +15 -0
- package/dist/workout/dayPhrase.js.map +1 -0
- package/dist/workout/fieldLabels.d.ts +5 -0
- package/dist/workout/fieldLabels.d.ts.map +1 -0
- package/dist/workout/fieldLabels.js +45 -0
- package/dist/workout/fieldLabels.js.map +1 -0
- package/dist/workout/index.d.ts +30 -0
- package/dist/workout/index.d.ts.map +1 -0
- package/dist/workout/index.js +34 -0
- package/dist/workout/index.js.map +1 -0
- package/dist/workout/land.d.ts +45 -0
- package/dist/workout/land.d.ts.map +1 -0
- package/dist/workout/land.js +280 -0
- package/dist/workout/land.js.map +1 -0
- package/dist/workout/landBatch.d.ts +60 -0
- package/dist/workout/landBatch.d.ts.map +1 -0
- package/dist/workout/landBatch.js +225 -0
- package/dist/workout/landBatch.js.map +1 -0
- package/dist/workout/landBatchPages.d.ts +31 -0
- package/dist/workout/landBatchPages.d.ts.map +1 -0
- package/dist/workout/landBatchPages.js +132 -0
- package/dist/workout/landBatchPages.js.map +1 -0
- package/dist/workout/landPages.d.ts +41 -0
- package/dist/workout/landPages.d.ts.map +1 -0
- package/dist/workout/landPages.js +153 -0
- package/dist/workout/landPages.js.map +1 -0
- package/dist/workout/landRunner.d.ts +42 -0
- package/dist/workout/landRunner.d.ts.map +1 -0
- package/dist/workout/landRunner.js +155 -0
- package/dist/workout/landRunner.js.map +1 -0
- package/dist/workout/movementType.d.ts +14 -0
- package/dist/workout/movementType.d.ts.map +1 -0
- package/dist/workout/movementType.js +16 -0
- package/dist/workout/movementType.js.map +1 -0
- package/dist/workout/plan.d.ts +21 -0
- package/dist/workout/plan.d.ts.map +1 -0
- package/dist/workout/plan.js +44 -0
- package/dist/workout/plan.js.map +1 -0
- package/dist/workout/planStore.d.ts +157 -0
- package/dist/workout/planStore.d.ts.map +1 -0
- package/dist/workout/planStore.js +282 -0
- package/dist/workout/planStore.js.map +1 -0
- package/dist/workout/precheckPrompt.d.ts +7 -0
- package/dist/workout/precheckPrompt.d.ts.map +1 -0
- package/dist/workout/precheckPrompt.js +35 -0
- package/dist/workout/precheckPrompt.js.map +1 -0
- package/dist/workout/progress.d.ts +12 -0
- package/dist/workout/progress.d.ts.map +1 -0
- package/dist/workout/progress.js +16 -0
- package/dist/workout/progress.js.map +1 -0
- package/dist/workout/receipt.d.ts +15 -0
- package/dist/workout/receipt.d.ts.map +1 -0
- package/dist/workout/receipt.js +128 -0
- package/dist/workout/receipt.js.map +1 -0
- package/dist/workout/review.d.ts +12 -0
- package/dist/workout/review.d.ts.map +1 -0
- package/dist/workout/review.js +15 -0
- package/dist/workout/review.js.map +1 -0
- package/dist/workout/routes.d.ts +13 -0
- package/dist/workout/routes.d.ts.map +1 -0
- package/dist/workout/routes.js +49 -0
- package/dist/workout/routes.js.map +1 -0
- package/dist/workout/wizard.d.ts +14 -0
- package/dist/workout/wizard.d.ts.map +1 -0
- package/dist/workout/wizard.js +20 -0
- package/dist/workout/wizard.js.map +1 -0
- package/dist/workout/write.d.ts +78 -0
- package/dist/workout/write.d.ts.map +1 -0
- package/dist/workout/write.js +607 -0
- package/dist/workout/write.js.map +1 -0
- package/dist/workout/xunjiBackfill.d.ts +36 -0
- package/dist/workout/xunjiBackfill.d.ts.map +1 -0
- package/dist/workout/xunjiBackfill.js +198 -0
- package/dist/workout/xunjiBackfill.js.map +1 -0
- package/dist/workout/xunjiPush.d.ts +33 -0
- package/dist/workout/xunjiPush.d.ts.map +1 -0
- package/dist/workout/xunjiPush.js +236 -0
- package/dist/workout/xunjiPush.js.map +1 -0
- package/dist/workout/xunjiRunner.d.ts +29 -0
- package/dist/workout/xunjiRunner.d.ts.map +1 -0
- package/dist/workout/xunjiRunner.js +110 -0
- package/dist/workout/xunjiRunner.js.map +1 -0
- package/dist/xunji/backfill.d.ts +63 -0
- package/dist/xunji/backfill.d.ts.map +1 -0
- package/dist/xunji/backfill.js +150 -0
- package/dist/xunji/backfill.js.map +1 -0
- package/dist/xunji/catalog.d.ts +53 -0
- package/dist/xunji/catalog.d.ts.map +1 -0
- package/dist/xunji/catalog.js +126 -0
- package/dist/xunji/catalog.js.map +1 -0
- package/dist/xunji/cli.d.ts +3 -0
- package/dist/xunji/cli.d.ts.map +1 -0
- package/dist/xunji/cli.js +15 -0
- package/dist/xunji/cli.js.map +1 -0
- package/dist/xunji/exitMap.d.ts +37 -0
- package/dist/xunji/exitMap.d.ts.map +1 -0
- package/dist/xunji/exitMap.js +42 -0
- package/dist/xunji/exitMap.js.map +1 -0
- package/dist/xunji/fetch.d.ts +77 -0
- package/dist/xunji/fetch.d.ts.map +1 -0
- package/dist/xunji/fetch.js +160 -0
- package/dist/xunji/fetch.js.map +1 -0
- package/dist/xunji/index.d.ts +21 -0
- package/dist/xunji/index.d.ts.map +1 -0
- package/dist/xunji/index.js +18 -0
- package/dist/xunji/index.js.map +1 -0
- package/dist/xunji/key.d.ts +77 -0
- package/dist/xunji/key.d.ts.map +1 -0
- package/dist/xunji/key.js +160 -0
- package/dist/xunji/key.js.map +1 -0
- package/dist/xunji/overlay-plan.d.ts +79 -0
- package/dist/xunji/overlay-plan.d.ts.map +1 -0
- package/dist/xunji/overlay-plan.js +145 -0
- package/dist/xunji/overlay-plan.js.map +1 -0
- package/dist/xunji/planSource.d.ts +40 -0
- package/dist/xunji/planSource.d.ts.map +1 -0
- package/dist/xunji/planSource.js +78 -0
- package/dist/xunji/planSource.js.map +1 -0
- package/dist/xunji/push.d.ts +55 -0
- package/dist/xunji/push.d.ts.map +1 -0
- package/dist/xunji/push.js +69 -0
- package/dist/xunji/push.js.map +1 -0
- package/dist/xunji/rateLimit.d.ts +44 -0
- package/dist/xunji/rateLimit.d.ts.map +1 -0
- package/dist/xunji/rateLimit.js +99 -0
- package/dist/xunji/rateLimit.js.map +1 -0
- package/dist/xunji/request.d.ts +48 -0
- package/dist/xunji/request.d.ts.map +1 -0
- package/dist/xunji/request.js +60 -0
- package/dist/xunji/request.js.map +1 -0
- package/dist/xunji/retry.d.ts +50 -0
- package/dist/xunji/retry.d.ts.map +1 -0
- package/dist/xunji/retry.js +106 -0
- package/dist/xunji/retry.js.map +1 -0
- package/dist/xunji/rows.d.ts +32 -0
- package/dist/xunji/rows.d.ts.map +1 -0
- package/dist/xunji/rows.js +74 -0
- package/dist/xunji/rows.js.map +1 -0
- package/dist/xunji/run-sync.d.ts +106 -0
- package/dist/xunji/run-sync.d.ts.map +1 -0
- package/dist/xunji/run-sync.js +223 -0
- package/dist/xunji/run-sync.js.map +1 -0
- package/dist/xunji/run.d.ts +56 -0
- package/dist/xunji/run.d.ts.map +1 -0
- package/dist/xunji/run.js +300 -0
- package/dist/xunji/run.js.map +1 -0
- package/dist/xunji/store.d.ts +31 -0
- package/dist/xunji/store.d.ts.map +1 -0
- package/dist/xunji/store.js +60 -0
- package/dist/xunji/store.js.map +1 -0
- package/dist/xunji/subcommands.d.ts +64 -0
- package/dist/xunji/subcommands.d.ts.map +1 -0
- package/dist/xunji/subcommands.js +203 -0
- package/dist/xunji/subcommands.js.map +1 -0
- package/dist/xunji/upsert.d.ts +61 -0
- package/dist/xunji/upsert.d.ts.map +1 -0
- package/dist/xunji/upsert.js +100 -0
- package/dist/xunji/upsert.js.map +1 -0
- package/package.json +7 -3
- package/src/xunji/data//350/256/255/350/256/260/345/256/230/346/226/271/345/212/250/344/275/234.json +1099 -0
- package/templates/help.html +1 -1
- package/workflows/08-/350/272/253/344/275/223/347/273/206/350/212/202.md +60 -0
- package/workflows/09-/350/272/253/346/235/220/347/205/247/347/211/207.md +98 -0
package/dist/cli/cmd_read.js
CHANGED
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
* 组合键为 registry 合法点式(见 cli/keys.ts;内部 VIEW_KEYS 下划线键仅渲染层复用,不直接登记)。
|
|
8
8
|
* 缺失阻断不返空:空库/空窗/无目标一律抛(CalorieRenderError missing-data / FetchError),exit 4,不返空数组冒充正常。
|
|
9
9
|
* 仅 type-only 消费 link-core(零运行时依赖);envelope 手工装配,形状校验本地镜像 link-core。
|
|
10
|
-
* HTML 默认落盘(utf8,见下行 #87)+
|
|
11
|
-
* #87 · 输出命名规范复刻(M10):不给
|
|
10
|
+
* HTML 默认落盘(utf8,见下行 #87)+ 可用 `--html` 显式覆盖:视图键走 render/html.ts 专属模板(与 T8/T9/T10 快照同源),其余走通用 section。
|
|
11
|
+
* #87 · 输出命名规范复刻(M10):不给 `--html` 时默认落
|
|
12
12
|
* <SKILLS_DB_PATH>/calorie_html/<中文command>_<YYYYMMDD>_<HHMMSS>[_N].html(同秒冲突自动加后缀),
|
|
13
|
-
* 中文 command 取 CALORIE_COMBOS[key].title;显式
|
|
13
|
+
* 中文 command 取 CALORIE_COMBOS[key].title;显式 `--html` 覆盖任意路径。
|
|
14
|
+
* ⚠️ 老技能的 `--output` 别名**已由 #245 收口删除**(与其余五家同形:只认 `--html`;给 `--output` 即 exit 2)。
|
|
14
15
|
* 落点随 envelope 的 data.output 回传(additive 字段,六形状守卫不校验 data 额外键)。
|
|
15
16
|
* #91 · `calorie.help.center` 承载**全量速查台**(Q9):`--params '{"mode":"file|inline|text"}'` 显式选交付形态
|
|
16
17
|
* (D6,缺省 `file`);`q`/`keyword` 保留**照片 10 键**语义(非空=现找、空串=全量 10 键)。envelope 恒五字段
|
|
@@ -19,1085 +20,37 @@
|
|
|
19
20
|
import { existsSync } from 'node:fs';
|
|
20
21
|
import { join } from 'node:path';
|
|
21
22
|
import { openDb } from '../schema.js';
|
|
22
|
-
import { DB_FILENAME
|
|
23
|
-
import { listMeals } from '../fetch/diet.js';
|
|
24
|
-
import { getCalorieHistory } from '../fetch/history.js';
|
|
23
|
+
import { DB_FILENAME } from '../paths.js';
|
|
25
24
|
import { FetchError } from '../fetch/errors.js';
|
|
26
|
-
import { buildHomeData } from '../render/home.js';
|
|
27
|
-
import { buildDietOverview, buildMealDistribution, zeroMealDistribution } from '../render/diet.js';
|
|
28
|
-
import { buildExerciseView } from '../render/exercise.js';
|
|
29
|
-
import { buildGoalView } from '../render/goal.js';
|
|
30
|
-
import { buildGoalConfig, buildGoalRecommend, buildGoalWeight, buildGoalProgress, buildGoalStatus } from '../render/goalPlate.js';
|
|
31
|
-
import { buildWeightDashboard, buildWeightHistoryView, buildWeightCompareView, buildWeightReviewView, buildVolatilityView } from '../render/weightPlate.js';
|
|
32
|
-
import { buildBodyCompositionView, buildBodyMeasureView } from '../render/bodyPlate.js';
|
|
33
|
-
import { buildPlanView, buildPlanWizardView, buildExerciseGoalView } from '../render/planPlate.js';
|
|
34
|
-
import { buildGoalExpiringView, buildGoalPredictView, buildGoalVsActualView } from '../render/goalExtra.js';
|
|
35
|
-
import { buildPredictView, buildAnomalyView, buildContraView, buildDedupeView } from '../render/insightPlate.js';
|
|
36
|
-
// #179 · 档案读链取数搬进能力目录 `src/profile/`(同一个取数不留两处)。
|
|
37
|
-
import { buildProfileView, buildProfileViewDoc } from '../profile/view.js';
|
|
38
|
-
import { buildProfileSettingDoc, buildProfileSettingView } from '../profile/setup.js';
|
|
39
|
-
import { buildCombinedAnalysis, buildDeficitPlate, buildDietReview } from '../render/analysisPlate.js';
|
|
40
|
-
import { dietFoodRanking, dietMacroRatio } from '../analysis/diet.js';
|
|
41
|
-
import { buildAllRankingsDoc, buildDedupeDoc, buildDietReviewDoc, buildHealthDoc, buildLibraryDoc, buildRankingDoc, buildSearchDoc, buildTodayDietDoc, buildViewDietDoc, } from '../render/dietDocs.js';
|
|
42
|
-
import { buildBodyCompositionDoc, buildBodyMeasureDoc, buildExerciseDoc, buildExerciseGoalDoc, buildVolatilityDoc, buildWeightCompareDoc, buildWeightDoc, buildWeightHistoryDoc, buildWeightReviewDoc, } from '../render/sportDocs.js';
|
|
43
|
-
import { buildCardioDoc, buildDistributionDoc, buildRecapDoc, buildReviewDoc, buildStrengthDoc, buildTrendDoc, } from '../render/sportPortDocs.js';
|
|
44
|
-
import { buildCardioView, buildDistributionView, buildRecapView, buildReviewView, buildStrengthView, buildTrendView, } from '../render/exercisePort.js';
|
|
45
|
-
import { buildNutritionDetailView, buildNutritionRatioView, buildSourceStatsView, buildTodayWaterView, } from '../render/nutritionPort.js';
|
|
46
|
-
import { buildNutritionDetailDoc, buildNutritionRatioDoc, buildSourceStatsDoc, buildTodayWaterDoc, } from '../render/nutritionPortDocs.js';
|
|
47
|
-
import { buildBatchImportPreviewView, buildCalorieTrendView, buildLintHealthView, buildLongTrendView, buildNutritionAnalysisView, buildProcessProgressView, buildReviewTemplateView, buildSixFactorsView, } from '../render/trendMiscPort.js';
|
|
48
|
-
import { buildBatchImportPreviewDoc, buildCalorieTrendDoc, buildLintHealthDoc, buildLongTrendDoc, buildNutritionAnalysisDoc, buildProcessProgressDoc, buildReviewTemplateDoc, buildSixFactorsDoc, } from '../render/trendMiscPortDocs.js';
|
|
49
|
-
import { buildCompositionWizardView, buildGifPlannerView, buildMeasureWizardView, buildPhotoLogWizardView, } from '../render/wizardPort.js';
|
|
50
|
-
import { buildCompositionWizardDoc, buildGifPlannerDoc, buildMeasureWizardDoc, buildPhotoLogWizardDoc, } from '../render/wizardPortDocs.js';
|
|
51
|
-
import { buildAnomalyDoc, buildCombinedDoc, buildContraDoc, buildDeficitDoc, buildGoalPredictDoc, buildPredictDoc, } from '../render/trendDocs.js';
|
|
52
|
-
import { buildHealthPlate } from '../render/health.js';
|
|
53
|
-
import { buildAllRankings, buildFoodRankingPlate } from '../render/ranking.js';
|
|
54
|
-
import { buildProductLibrary, buildProductSearch, buildProductStats } from '../render/library.js';
|
|
55
|
-
import { buildCompareData, buildGalleryData, buildGifTask, buildViewerData } from '../render/photo.js';
|
|
56
|
-
import { buildPhotoHelp, lookupPhotoHelp } from '../render/help.js';
|
|
57
|
-
// #91 · 全量速查台(Q9):只读消费 #88 的 `render/helpCenter.js`(三态同源,零改动)。
|
|
58
|
-
import { HELP_CENTER_MODES, buildHelpSceneData, renderHelpCenterHtml } from '../render/helpCenter.js';
|
|
59
|
-
import { HELP_FILE_STEM, buildHelpFileData, renderHelpFileHtml } from '../render/helpFile.js';
|
|
60
|
-
import { SHEET_FILE_STEM, HELP_HTML_DIR_NAME } from '../render/helpPaths.js';
|
|
61
|
-
import { renderGalleryHtml, renderCompareHtml, renderViewerHtml, renderGifHtml, renderPhotoHelpHtml, renderHelpLookupHtml, renderErrorHtml, renderGoalConfigHtml, renderGoalRecommendHtml, renderGoalWeightHtml, renderGoalProgressHtml, renderGoalStatusHtml, renderGoalHtml, renderHomeHtml, renderPlanHtml, renderPlanWizardHtml, renderGoalExpiringHtml, renderGoalVsActualHtml, } from '../render/html.js';
|
|
62
|
-
import { assertStatMetrics, buildDelivery, withDelivery } from '../render/envelope.js';
|
|
63
|
-
import { buildErrorReceipt } from '../render/receipt.js';
|
|
64
|
-
import { buildDataText } from 'base-paint';
|
|
65
25
|
import { CalorieRenderError } from '../render/errors.js';
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
import {
|
|
26
|
+
// #179 · 档案读链取数搬进能力目录 `src/profile/`(同一个取数不留两处)。
|
|
27
|
+
// #330 · CLI 前置与交付装配住同目录两件(纯搬,行为不变):`readArgs.ts`(参数+预检)/
|
|
28
|
+
// `delivery.ts`(envelope+三态交付+失败回执)。入口名与 `export function dispatch` 不挪。
|
|
29
|
+
import { USAGE, bodySceneFor, parseReadArgs, preflight, toast } from './readArgs.js';
|
|
30
|
+
import { buildDeliveredEnvelope, describeDeliveryTarget, failWithBodyReceipt, failWithReceipt } from './delivery.js';
|
|
31
|
+
export { buildDeliveredEnvelope };
|
|
32
|
+
// #250 · 窗口与锚点只有一个定义地(analysis/series.ts):读命令一律经下方 anchorOf/windowRange/dayField 取参。
|
|
33
|
+
import { CALORIE_COMBOS, calorieShapeFor, isCalorieWriteKey } from './keys.js';
|
|
34
|
+
// #294 · 参数读取与窗口口径上移共用位:能力目录里的命令与分派层用同一套口径(唯一定义地)。
|
|
35
|
+
import { fail } from '../shared/params.js';
|
|
70
36
|
import { openDbReadOnly } from '../db/readonly.js';
|
|
71
37
|
import { dispatchWrite } from './write.js';
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
console.error('ERR ' + code + ': ' + msg);
|
|
75
|
-
process.exit(code);
|
|
76
|
-
}
|
|
77
|
-
function toast(msg) {
|
|
78
|
-
console.error('TOAST: ' + msg);
|
|
79
|
-
}
|
|
80
|
-
function preflight() {
|
|
81
|
-
const v = process.versions.node.split('.').map(Number);
|
|
82
|
-
const major = v[0];
|
|
83
|
-
const minor = v[1];
|
|
84
|
-
if (!(major > 22 || (major === 22 && minor >= 13)))
|
|
85
|
-
fail(1, 'node 低于 22.13:' + process.versions.node);
|
|
86
|
-
const p = process.env.SKILLS_DB_PATH;
|
|
87
|
-
if (!p)
|
|
88
|
-
fail(1, 'SKILLS_DB_PATH 未设置(无默认值,必设)');
|
|
89
|
-
return p;
|
|
90
|
-
}
|
|
91
|
-
const USAGE = '用法:cmd_read <calorie.key> [--params JSON对象] [--output 输出路径] [--html 输出路径(--output 别名)] [--timeout 毫秒]';
|
|
92
|
-
function parseArgs(a) {
|
|
93
|
-
const o = {
|
|
94
|
-
key: a[0], params: undefined, html: undefined, output: undefined, timeout: DEFAULT_TIMEOUT_MS,
|
|
95
|
-
};
|
|
96
|
-
for (let i = 1; i < a.length; i++) {
|
|
97
|
-
if (a[i] === '--params' && i + 1 < a.length)
|
|
98
|
-
o.params = a[++i];
|
|
99
|
-
else if (a[i] === '--html' && i + 1 < a.length)
|
|
100
|
-
o.html = a[++i];
|
|
101
|
-
else if (a[i] === '--output' && i + 1 < a.length)
|
|
102
|
-
o.output = a[++i];
|
|
103
|
-
else if (a[i] === '--timeout' && i + 1 < a.length) {
|
|
104
|
-
o.timeout = Number(a[++i]);
|
|
105
|
-
if (!Number.isFinite(o.timeout) || o.timeout <= 0)
|
|
106
|
-
fail(2, '--timeout 须为正数毫秒');
|
|
107
|
-
}
|
|
108
|
-
else
|
|
109
|
-
fail(2, '未知参数:' + a[i] + '(' + USAGE + ')');
|
|
110
|
-
}
|
|
111
|
-
return o;
|
|
112
|
-
}
|
|
113
|
-
function needStr(params, name) {
|
|
114
|
-
const v = params[name];
|
|
115
|
-
if (typeof v !== 'string' || v.length === 0)
|
|
116
|
-
fail(2, '缺参数 ' + name);
|
|
117
|
-
return v;
|
|
118
|
-
}
|
|
119
|
-
function optStr(params, name) {
|
|
120
|
-
const v = params[name];
|
|
121
|
-
if (v === undefined || v === null)
|
|
122
|
-
return undefined;
|
|
123
|
-
if (typeof v !== 'string')
|
|
124
|
-
fail(2, '参数 ' + name + ' 须为字符串');
|
|
125
|
-
return v;
|
|
126
|
-
}
|
|
127
|
-
function optNum(params, name) {
|
|
128
|
-
const v = params[name];
|
|
129
|
-
if (v === undefined || v === null)
|
|
130
|
-
return undefined;
|
|
131
|
-
if (typeof v !== 'number' || !Number.isFinite(v))
|
|
132
|
-
fail(2, '参数 ' + name + ' 须为有限 number');
|
|
133
|
-
return v;
|
|
134
|
-
}
|
|
135
|
-
function assertISO(v, field) {
|
|
136
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(v))
|
|
137
|
-
fail(2, field + ' 非法(须 YYYY-MM-DD):' + v);
|
|
138
|
-
}
|
|
139
|
-
function latestFoodDate(db) {
|
|
140
|
-
try {
|
|
141
|
-
const row = db.prepare('SELECT MAX(date) AS m FROM food_log').get();
|
|
142
|
-
return row?.m ?? null;
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function defaultRange(db, params, defDays = 7) {
|
|
149
|
-
let end = optStr(params, 'end') ?? optStr(params, 'date') ?? optStr(params, 'today') ?? undefined;
|
|
150
|
-
let start = optStr(params, 'start') ?? undefined;
|
|
151
|
-
if (end)
|
|
152
|
-
assertISO(end, 'end');
|
|
153
|
-
if (start)
|
|
154
|
-
assertISO(start, 'start');
|
|
155
|
-
if (start && end) {
|
|
156
|
-
if (start > end)
|
|
157
|
-
fail(2, 'start 不得晚于 end');
|
|
158
|
-
return { start, end };
|
|
159
|
-
}
|
|
160
|
-
const latest = latestFoodDate(db) ?? todayISO();
|
|
161
|
-
end = end ?? latest;
|
|
162
|
-
assertISO(end, 'end');
|
|
163
|
-
if (start) {
|
|
164
|
-
if (start > end)
|
|
165
|
-
fail(2, 'start 不得晚于 end');
|
|
166
|
-
return { start, end: end };
|
|
167
|
-
}
|
|
168
|
-
return { start: shiftISODate(end, -(defDays - 1)), end: end };
|
|
169
|
-
}
|
|
170
|
-
/** 本地 envelope 形状校验(镜像 link-core assertShapeData,不运行时 import)。 */
|
|
171
|
-
function assertEnvelopeData(shape, data) {
|
|
172
|
-
switch (shape) {
|
|
173
|
-
case 'list':
|
|
174
|
-
if (!Array.isArray(data['items']))
|
|
175
|
-
throw new CalorieRenderError('bad-input', 'list 形缺 items 数组');
|
|
176
|
-
if (data['total'] !== undefined && typeof data['total'] !== 'number')
|
|
177
|
-
throw new CalorieRenderError('bad-input', 'list 形 total 须为 number');
|
|
178
|
-
break;
|
|
179
|
-
case 'detail':
|
|
180
|
-
if (typeof data['item'] !== 'object' || data['item'] === null || Array.isArray(data['item'])) {
|
|
181
|
-
throw new CalorieRenderError('bad-input', 'detail 形缺 item 对象');
|
|
182
|
-
}
|
|
183
|
-
break;
|
|
184
|
-
case 'stat':
|
|
185
|
-
if (typeof data['metrics'] !== 'object' || data['metrics'] === null || Array.isArray(data['metrics'])) {
|
|
186
|
-
throw new CalorieRenderError('bad-input', 'stat 形缺 metrics 对象');
|
|
187
|
-
}
|
|
188
|
-
assertStatMetrics(data['metrics']);
|
|
189
|
-
break;
|
|
190
|
-
case 'receipt':
|
|
191
|
-
if (typeof data['ok'] !== 'boolean' || typeof data['message'] !== 'string') {
|
|
192
|
-
throw new CalorieRenderError('bad-input', 'receipt 形缺 ok/message 全字段');
|
|
193
|
-
}
|
|
194
|
-
break;
|
|
195
|
-
case 'analysis':
|
|
196
|
-
if (typeof data['summary'] !== 'string' || data['summary'].length === 0) {
|
|
197
|
-
throw new CalorieRenderError('bad-input', 'analysis 形缺 summary 全字段');
|
|
198
|
-
}
|
|
199
|
-
break;
|
|
200
|
-
case 'fallback':
|
|
201
|
-
if (typeof data['reason'] !== 'string' || data['reason'].length === 0 || data['degraded'] !== true) {
|
|
202
|
-
throw new CalorieRenderError('bad-input', 'fallback 形缺 reason/degraded:true 全字段');
|
|
203
|
-
}
|
|
204
|
-
break;
|
|
205
|
-
default:
|
|
206
|
-
throw new CalorieRenderError('bad-input', '未知 shape:' + String(shape));
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
function buildEnvelope(key, shape, data) {
|
|
210
|
-
assertEnvelopeData(shape, data);
|
|
211
|
-
return { version: ENVELOPE_VERSION, skill: CALORIE_SKILL, shape, key, data };
|
|
212
|
-
}
|
|
213
|
-
/** 非空数挑拣:null/undefined/NaN/Infinity 一律丢弃(stat.metrics 须全有限 number)。 */
|
|
214
|
-
function nums(input) {
|
|
215
|
-
const out = {};
|
|
216
|
-
for (const [k, v] of Object.entries(input)) {
|
|
217
|
-
if (typeof v === 'number' && Number.isFinite(v))
|
|
218
|
-
out[k] = v;
|
|
219
|
-
}
|
|
220
|
-
return out;
|
|
221
|
-
}
|
|
222
|
-
function photosDirOf(params) {
|
|
223
|
-
const p = optStr(params, 'photosDir');
|
|
224
|
-
if (p)
|
|
225
|
-
return p;
|
|
226
|
-
const e = process.env.CALORIE_PHOTOS_DIR;
|
|
227
|
-
return e ? e : undefined;
|
|
228
|
-
}
|
|
229
|
-
/** #91 · 全量速查台的信封载荷:**10 分组索引**(不把 1 MB 产物塞进 envelope)。
|
|
230
|
-
*
|
|
231
|
-
* `items` 恒为 10 条分组(`total` = `items.length`,与 `list` 形语义一致);
|
|
232
|
-
* `sceneTotal`/`subgroupTotal` 把「436 场景/54 子功能」如实回传,避免只报 10 丢掉全量口径。
|
|
233
|
-
*/
|
|
234
|
-
function helpCenterIndex(data) {
|
|
235
|
-
let sceneTotal = 0;
|
|
236
|
-
let subgroupTotal = 0;
|
|
237
|
-
const items = data.groups.map((group) => {
|
|
238
|
-
const sceneCount = group.subgroups.reduce((n, sub) => n + sub.scenes.length, 0);
|
|
239
|
-
sceneTotal += sceneCount;
|
|
240
|
-
subgroupTotal += group.subgroups.length;
|
|
241
|
-
return {
|
|
242
|
-
id: group.id,
|
|
243
|
-
icon: typeof group.icon === 'string' ? group.icon : '',
|
|
244
|
-
label: group.label,
|
|
245
|
-
subgroupCount: group.subgroups.length,
|
|
246
|
-
sceneCount,
|
|
247
|
-
};
|
|
248
|
-
});
|
|
249
|
-
return { items, total: items.length, sceneTotal, subgroupTotal };
|
|
250
|
-
}
|
|
38
|
+
// #294 · 命令索引:命中即走能力目录里的实现;未命中即未知键(#320 起老 switch 已删)。
|
|
39
|
+
import { REGISTRY } from './registry.js';
|
|
251
40
|
// 全键分发:读走 render/fetch 读,HELP 走触发词现找;未知键上游已拦,此处再拦一道。
|
|
252
41
|
/** #41 · 测试直调出口(纯 CLI 同逻辑,不经过 argv/spawn;CLI 唯一出口仍为 main)。 */
|
|
253
42
|
export function dispatch(key, params, db) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const mt = dietMacroRatio(db, date, date);
|
|
266
|
-
return { data: { items, total: items.length }, html: buildTodayDietDoc({ overview: o, dist, meals: rows, macro: mt.status === 'ok' ? (mt.data ?? null) : null }) };
|
|
267
|
-
}
|
|
268
|
-
case 'calorie.view.home': {
|
|
269
|
-
const date = optStr(params, 'date') ?? optStr(params, 'today') ?? latestFoodDate(db) ?? todayISO();
|
|
270
|
-
assertISO(date, 'date');
|
|
271
|
-
const windowDays = optNum(params, 'windowDays') ?? 7;
|
|
272
|
-
if (!Number.isInteger(windowDays) || windowDays < 1 || windowDays > 90)
|
|
273
|
-
fail(2, 'windowDays 须为 1..90 整数');
|
|
274
|
-
const h = buildHomeData(db, date, windowDays);
|
|
275
|
-
const metrics = nums({
|
|
276
|
-
calorieGoal: h.calorieGoal, waterGoal: h.waterGoal, caloriePct: h.caloriePct, proteinPct: h.proteinPct,
|
|
277
|
-
waterPct: h.waterPct, deficitToday: h.deficitToday, streakDays: h.streakDays,
|
|
278
|
-
intakeCal: h.daily.totals.cal, proteinG: h.daily.totals.pro, carbsG: h.daily.totals.carbs, fatG: h.daily.totals.fat,
|
|
279
|
-
waterMl: h.daily.waterMl, entryCount: h.daily.entryCount, avgIntake: h.week.avgIntake, avgDeficit: h.week.avgDeficit,
|
|
280
|
-
loggedDays: h.week.loggedDays,
|
|
281
|
-
});
|
|
282
|
-
return { data: { metrics }, html: renderHomeHtml(h) };
|
|
283
|
-
}
|
|
284
|
-
case 'calorie.view.diet': {
|
|
285
|
-
const { start, end } = defaultRange(db, params);
|
|
286
|
-
const date = optStr(params, 'date') ?? end;
|
|
287
|
-
assertISO(date, 'date');
|
|
288
|
-
const o = buildDietOverview(db, start, end);
|
|
289
|
-
// C4 #43 · 尾日空回零(窗内有数不掀整窗 missing;窗全空由上行 overview 抛 missing-data)。
|
|
290
|
-
let dist;
|
|
291
|
-
try {
|
|
292
|
-
dist = buildMealDistribution(db, date);
|
|
293
|
-
}
|
|
294
|
-
catch (e) {
|
|
295
|
-
if (e instanceof CalorieRenderError && e.code === 'missing-data')
|
|
296
|
-
dist = zeroMealDistribution(date);
|
|
297
|
-
else
|
|
298
|
-
throw e;
|
|
299
|
-
}
|
|
300
|
-
// #108 · 窗口明细(逐日 listMeals 去水,上限 100 条并明示截断;单日失败跳过)。
|
|
301
|
-
const mealRows = [];
|
|
302
|
-
for (const d of o.series) {
|
|
303
|
-
try {
|
|
304
|
-
for (const r of listMeals(db, d.date)) {
|
|
305
|
-
if (r.food_name !== '💧水')
|
|
306
|
-
mealRows.push(r);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
catch {
|
|
310
|
-
continue;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const MEAL_CAP = 100;
|
|
314
|
-
const mealTotal = mealRows.length;
|
|
315
|
-
const mealSlice = mealRows.slice(0, MEAL_CAP);
|
|
316
|
-
const metrics = nums({
|
|
317
|
-
totalCalories: o.totalCalories, avgCalories: o.avgCalories, calorieGoal: o.calorieGoal,
|
|
318
|
-
loggedDays: o.loggedDays, days: o.days, distTotal: dist.totalCalories,
|
|
319
|
-
'meal.早餐': dist.slices.find((s) => s.meal === '早餐')?.calories,
|
|
320
|
-
'meal.午餐': dist.slices.find((s) => s.meal === '午餐')?.calories,
|
|
321
|
-
'meal.晚餐': dist.slices.find((s) => s.meal === '晚餐')?.calories,
|
|
322
|
-
'meal.加餐': dist.slices.find((s) => s.meal === '加餐')?.calories,
|
|
323
|
-
});
|
|
324
|
-
return { data: { metrics }, html: buildViewDietDoc({
|
|
325
|
-
overview: o, dist, distDate: date, days: o.series,
|
|
326
|
-
meals: mealSlice, mealTotal, mealsTruncated: mealTotal > MEAL_CAP,
|
|
327
|
-
}) };
|
|
328
|
-
}
|
|
329
|
-
case 'calorie.view.exercise': {
|
|
330
|
-
const { start, end } = defaultRange(db, params);
|
|
331
|
-
const v = buildExerciseView(db, start, end);
|
|
332
|
-
const metrics = nums({
|
|
333
|
-
totalBurned: v.review.totalBurned, totalMinutes: v.review.totalMinutes, sessions: v.review.sessions,
|
|
334
|
-
activeDays: v.review.activeDays, totalBurnedSeries: v.totalBurnedSeries,
|
|
335
|
-
avgBurnedPerLoggedDay: v.avgBurnedPerLoggedDay, seriesActiveDays: v.activeDays,
|
|
336
|
-
});
|
|
337
|
-
return { data: { metrics }, html: buildExerciseDoc(v) };
|
|
338
|
-
}
|
|
339
|
-
// #111 · 运动移植 6 键(t71 需移植 exercise_*;envelope stat metrics 只收确定数字)。
|
|
340
|
-
case 'calorie.view.exercise-strength': {
|
|
341
|
-
const { start, end } = defaultRange(db, params);
|
|
342
|
-
const v = buildStrengthView(db, start, end);
|
|
343
|
-
const metrics = nums({
|
|
344
|
-
movementCount: v.movementCount, totalSets: v.totalSets,
|
|
345
|
-
totalVolumeKg: v.totalVolumeKg, totalReps: v.totalReps,
|
|
346
|
-
});
|
|
347
|
-
return { data: { metrics }, html: buildStrengthDoc(v) };
|
|
348
|
-
}
|
|
349
|
-
case 'calorie.view.exercise-cardio': {
|
|
350
|
-
const { start, end } = defaultRange(db, params);
|
|
351
|
-
const v = buildCardioView(db, start, end);
|
|
352
|
-
const metrics = nums({
|
|
353
|
-
sessions: v.sessions, totalMinutes: v.totalMinutes,
|
|
354
|
-
totalDistanceKm: v.totalDistanceKm, avgPaceMinPerKm: v.avgPaceMinPerKm,
|
|
355
|
-
});
|
|
356
|
-
return { data: { metrics }, html: buildCardioDoc(v) };
|
|
357
|
-
}
|
|
358
|
-
case 'calorie.view.exercise-distribution': {
|
|
359
|
-
const { start, end } = defaultRange(db, params);
|
|
360
|
-
const v = buildDistributionView(db, start, end);
|
|
361
|
-
const metrics = nums({
|
|
362
|
-
sessions: v.sessions, activeDays: v.activeDays, days: v.days, totalBurned: v.totalBurned,
|
|
363
|
-
intakeCal: v.intakeCal, tdeeTotal: v.tdeeTotal, deficit: v.deficit,
|
|
364
|
-
});
|
|
365
|
-
return { data: { metrics }, html: buildDistributionDoc(v) };
|
|
366
|
-
}
|
|
367
|
-
case 'calorie.view.exercise-recap': {
|
|
368
|
-
const { start, end } = defaultRange(db, params);
|
|
369
|
-
const v = buildRecapView(db, start, end);
|
|
370
|
-
const metrics = nums({
|
|
371
|
-
sessions: v.sessions, totalMinutes: v.totalMinutes, totalBurned: v.totalBurned,
|
|
372
|
-
activeDays: v.activeDays, days: v.days,
|
|
373
|
-
});
|
|
374
|
-
return { data: { metrics }, html: buildRecapDoc(v) };
|
|
375
|
-
}
|
|
376
|
-
case 'calorie.view.exercise-review': {
|
|
377
|
-
const { start, end } = defaultRange(db, params);
|
|
378
|
-
const v = buildReviewView(db, start, end);
|
|
379
|
-
const metrics = nums({
|
|
380
|
-
plannedSessions: v.plannedSessions, hitSessions: v.hitSessions,
|
|
381
|
-
completionPct: v.completionPct, plannedMovements: v.plannedMovements,
|
|
382
|
-
hitMovements: v.hitMovements, movementPct: v.movementPct,
|
|
383
|
-
});
|
|
384
|
-
return { data: { metrics }, html: buildReviewDoc(v) };
|
|
385
|
-
}
|
|
386
|
-
case 'calorie.view.exercise-trend': {
|
|
387
|
-
const { start, end } = defaultRange(db, params);
|
|
388
|
-
const v = buildTrendView(db, start, end);
|
|
389
|
-
const metrics = nums({
|
|
390
|
-
activeDays: v.activeDays, totalMinutes: v.totalMinutes,
|
|
391
|
-
totalBurned: v.totalBurned, peakBurned: v.peak?.burned,
|
|
392
|
-
});
|
|
393
|
-
return { data: { metrics }, html: buildTrendDoc(v) };
|
|
394
|
-
}
|
|
395
|
-
// #112 · 营养移植 4 键(t71 需移植 nutrition_*/source_stats/today_water;envelope stat metrics 只收确定数字)。
|
|
396
|
-
case 'calorie.view.nutrition-ratio': {
|
|
397
|
-
const { start, end } = defaultRange(db, params);
|
|
398
|
-
const v = buildNutritionRatioView(db, start, end);
|
|
399
|
-
const metrics = nums({
|
|
400
|
-
totalCalorie: v.totalCalorie, proteinG: v.proteinG, proteinPct: v.proteinPct,
|
|
401
|
-
carbG: v.carbG, carbPct: v.carbPct, fatG: v.fatG, fatPct: v.fatPct,
|
|
402
|
-
targetProteinG: v.targetProteinG, targetCarbG: v.targetCarbG, targetFatG: v.targetFatG,
|
|
403
|
-
});
|
|
404
|
-
return { data: { metrics }, html: buildNutritionRatioDoc(v) };
|
|
405
|
-
}
|
|
406
|
-
case 'calorie.view.nutrition-detail': {
|
|
407
|
-
const { start, end } = defaultRange(db, params);
|
|
408
|
-
const v = buildNutritionDetailView(db, start, end);
|
|
409
|
-
const metrics = nums({
|
|
410
|
-
days: v.days,
|
|
411
|
-
matchedMeals: v.matchedMeals,
|
|
412
|
-
missingFoods: v.missingFoods.length,
|
|
413
|
-
fiberAvg: v.items[0]?.avg,
|
|
414
|
-
sodiumAvg: v.items[1]?.avg,
|
|
415
|
-
sugarAvg: v.items[2]?.avg,
|
|
416
|
-
fiberPct: v.items[0]?.pct,
|
|
417
|
-
sodiumPct: v.items[1]?.pct,
|
|
418
|
-
sugarPct: v.items[2]?.pct,
|
|
419
|
-
});
|
|
420
|
-
return { data: { metrics }, html: buildNutritionDetailDoc(v) };
|
|
421
|
-
}
|
|
422
|
-
case 'calorie.view.source-stats': {
|
|
423
|
-
const v = buildSourceStatsView(db);
|
|
424
|
-
const metrics = nums({ total: v.total, sources: v.sources });
|
|
425
|
-
return { data: { metrics }, html: buildSourceStatsDoc(v) };
|
|
426
|
-
}
|
|
427
|
-
case 'calorie.view.today-water': {
|
|
428
|
-
const date = optStr(params, 'date') ?? latestFoodDate(db) ?? todayISO();
|
|
429
|
-
assertISO(date, 'date');
|
|
430
|
-
const v = buildTodayWaterView(db, date);
|
|
431
|
-
const metrics = nums({
|
|
432
|
-
todayMl: v.todayMl, targetMl: v.targetMl, pct: v.pct, remainMl: v.remainMl, cups: v.cups.length,
|
|
433
|
-
});
|
|
434
|
-
return { data: { metrics }, html: buildTodayWaterDoc(v) };
|
|
435
|
-
}
|
|
436
|
-
// #113 · 趋势 2+其他 6 移植 8 键(t71 需移植八模板;envelope stat metrics 只收确定数字)。
|
|
437
|
-
case 'calorie.view.calorie-trend': {
|
|
438
|
-
const { start, end } = defaultRange(db, params);
|
|
439
|
-
const v = buildCalorieTrendView(db, start, end);
|
|
440
|
-
const s = v.data.summary;
|
|
441
|
-
const metrics = nums({
|
|
442
|
-
avg: s.avg, target: s.target, trendValue: s.trendValue,
|
|
443
|
-
startAvg: s.startAvg, endAvg: s.endAvg, weekdayAvg: s.weekdayAvg,
|
|
444
|
-
weekendAvg: s.weekendAvg, weekendDiff: s.weekendDiff,
|
|
445
|
-
compliantDays: s.compliantDays, complianceRate: s.complianceRate,
|
|
446
|
-
});
|
|
447
|
-
return { data: { metrics }, html: buildCalorieTrendDoc(v) };
|
|
448
|
-
}
|
|
449
|
-
case 'calorie.view.long-trend': {
|
|
450
|
-
const end = optStr(params, 'end') ?? latestFoodDate(db) ?? todayISO();
|
|
451
|
-
assertISO(end, 'end');
|
|
452
|
-
const v = buildLongTrendView(db, optStr(params, 'group'), optStr(params, 'window'), end);
|
|
453
|
-
const metrics = nums({
|
|
454
|
-
windowDays: v.windowDays, avgCalorie: v.avgCalorie, weightChange: v.weightChange,
|
|
455
|
-
});
|
|
456
|
-
return { data: { metrics }, html: buildLongTrendDoc(v) };
|
|
457
|
-
}
|
|
458
|
-
case 'calorie.view.nutrition-analysis': {
|
|
459
|
-
const { start, end } = defaultRange(db, params);
|
|
460
|
-
const v = buildNutritionAnalysisView(db, start, end);
|
|
461
|
-
const metrics = nums({
|
|
462
|
-
days: v.days, totalCalorie: v.totalCalorie,
|
|
463
|
-
proteinG: v.proteinG, proteinPct: v.proteinPct,
|
|
464
|
-
carbG: v.carbG, carbPct: v.carbPct, fatG: v.fatG, fatPct: v.fatPct,
|
|
465
|
-
fiberAvg: v.fiberAvg, sodiumAvg: v.sodiumAvg, sugarAvg: v.sugarAvg,
|
|
466
|
-
adviceCount: v.advice.length,
|
|
467
|
-
});
|
|
468
|
-
return { data: { metrics }, html: buildNutritionAnalysisDoc(v) };
|
|
469
|
-
}
|
|
470
|
-
case 'calorie.view.six-factors': {
|
|
471
|
-
const date = optStr(params, 'date') ?? latestFoodDate(db) ?? todayISO();
|
|
472
|
-
assertISO(date, 'date');
|
|
473
|
-
const v = buildSixFactorsView(db, date);
|
|
474
|
-
const metrics = nums({
|
|
475
|
-
score: v.score,
|
|
476
|
-
calorie: v.factors[0]?.ok ? 1 : 0,
|
|
477
|
-
protein: v.factors[1]?.ok ? 1 : 0,
|
|
478
|
-
water: v.factors[2]?.ok ? 1 : 0,
|
|
479
|
-
exercise: v.factors[3]?.ok ? 1 : 0,
|
|
480
|
-
weigh: v.factors[4]?.ok ? 1 : 0,
|
|
481
|
-
meals: v.factors[5]?.ok ? 1 : 0,
|
|
482
|
-
});
|
|
483
|
-
return { data: { metrics }, html: buildSixFactorsDoc(v) };
|
|
484
|
-
}
|
|
485
|
-
case 'calorie.view.measure-wizard': {
|
|
486
|
-
const v = buildMeasureWizardView(db, params);
|
|
487
|
-
const metrics = nums({
|
|
488
|
-
filledCount: v.filledCount, hasRecent: v.recent ? 1 : 0,
|
|
489
|
-
});
|
|
490
|
-
return { data: { metrics }, html: buildMeasureWizardDoc(v) };
|
|
491
|
-
}
|
|
492
|
-
case 'calorie.view.composition-wizard': {
|
|
493
|
-
const v = buildCompositionWizardView(db, params);
|
|
494
|
-
const metrics = nums({
|
|
495
|
-
filledCount: (v.source ? 1 : 0) + (v.bodyFatPct === null ? 0 : 1) + v.calipers.length,
|
|
496
|
-
caliperCount: v.calipers.length, sum7: v.sum7, hasRecent: v.recent ? 1 : 0,
|
|
497
|
-
});
|
|
498
|
-
return { data: { metrics }, html: buildCompositionWizardDoc(v) };
|
|
499
|
-
}
|
|
500
|
-
case 'calorie.view.photo-log-wizard': {
|
|
501
|
-
const v = buildPhotoLogWizardView(params);
|
|
502
|
-
const metrics = nums({
|
|
503
|
-
fileCount: v.srcPaths.length, hasTag: v.tag ? 1 : 0,
|
|
504
|
-
});
|
|
505
|
-
return { data: { metrics }, html: buildPhotoLogWizardDoc(v) };
|
|
506
|
-
}
|
|
507
|
-
case 'calorie.view.gif-planner': {
|
|
508
|
-
const dir = photosDirOf(params);
|
|
509
|
-
const v = buildGifPlannerView(db, params, dir ?? null);
|
|
510
|
-
const metrics = nums({
|
|
511
|
-
photoCount: v.photos.length, selectedCount: v.selectedIds.length,
|
|
512
|
-
missingCount: v.missingIds.length, cropCount: v.photos.filter((p) => p.crop).length,
|
|
513
|
-
});
|
|
514
|
-
return { data: { metrics }, html: buildGifPlannerDoc(v) };
|
|
515
|
-
}
|
|
516
|
-
case 'calorie.view.profile-wizard': {
|
|
517
|
-
const v = buildProfileSettingView(db, params);
|
|
518
|
-
const metrics = nums({
|
|
519
|
-
filledCount: v.filledCount, hasProfile: v.before ? 1 : 0,
|
|
520
|
-
latestWeightKg: v.latestWeightKg, activityLevels: v.activityChoices.length,
|
|
521
|
-
});
|
|
522
|
-
return { data: { metrics }, html: buildProfileSettingDoc(v) };
|
|
523
|
-
}
|
|
524
|
-
case 'calorie.view.lint-health': {
|
|
525
|
-
const v = buildLintHealthView(db);
|
|
526
|
-
const metrics = nums({
|
|
527
|
-
issueCount: v.issueCount,
|
|
528
|
-
unmatched: v.checks[0]?.count,
|
|
529
|
-
badCalorie: v.checks[1]?.count,
|
|
530
|
-
future: v.checks[2]?.count,
|
|
531
|
-
duplicate: v.checks[3]?.count,
|
|
532
|
-
});
|
|
533
|
-
return { data: { metrics }, html: buildLintHealthDoc(v) };
|
|
534
|
-
}
|
|
535
|
-
case 'calorie.view.batch-import-preview': {
|
|
536
|
-
const v = buildBatchImportPreviewView(db, params['items']);
|
|
537
|
-
const metrics = nums({
|
|
538
|
-
total: v.total, matched: v.matched, missing: v.missing, totalCalorie: v.totalCalorie,
|
|
539
|
-
});
|
|
540
|
-
return { data: { metrics }, html: buildBatchImportPreviewDoc(v) };
|
|
541
|
-
}
|
|
542
|
-
case 'calorie.view.process-progress': {
|
|
543
|
-
const end = optStr(params, 'end') ?? latestFoodDate(db) ?? todayISO();
|
|
544
|
-
assertISO(end, 'end');
|
|
545
|
-
const v = buildProcessProgressView(db, end);
|
|
546
|
-
const metrics = nums({
|
|
547
|
-
hasPlan: v.hasPlan ? 1 : 0, plannedDays: v.plannedDays,
|
|
548
|
-
sessions7d: v.sessions7d, minutes7d: v.minutes7d,
|
|
549
|
-
});
|
|
550
|
-
return { data: { metrics }, html: buildProcessProgressDoc(v) };
|
|
551
|
-
}
|
|
552
|
-
case 'calorie.view.review-template': {
|
|
553
|
-
const { start, end } = defaultRange(db, params);
|
|
554
|
-
const v = buildReviewTemplateView(db, start, end);
|
|
555
|
-
const metrics = nums({
|
|
556
|
-
days: v.days, meals: v.meals, avgCalorie: v.avgCalorie,
|
|
557
|
-
sessions: v.sessions, minutes: v.minutes, weightChange: v.weightChange,
|
|
558
|
-
points: v.points.length,
|
|
559
|
-
});
|
|
560
|
-
return { data: { metrics }, html: buildReviewTemplateDoc(v) };
|
|
561
|
-
}
|
|
562
|
-
case 'calorie.view.goal': {
|
|
563
|
-
const { start, end } = defaultRange(db, params);
|
|
564
|
-
const v = buildGoalView(db, start, end);
|
|
565
|
-
const metrics = nums({
|
|
566
|
-
calorie_goal: v.nutrition.calorie_goal, protein_goal: v.nutrition.protein_goal,
|
|
567
|
-
carbs_goal: v.nutrition.carbs_goal, fat_goal: v.nutrition.fat_goal, water_goal: v.nutrition.water_goal,
|
|
568
|
-
completionPct: v.completionPct, weeklyDeficit: v.deficit.summary.weeklyDeficit,
|
|
569
|
-
predictedLossKg: v.deficit.summary.predictedLossKg, avgDeficit: v.deficit.summary.avgDeficit,
|
|
570
|
-
avgIntake: v.deficit.summary.avgIntake, trendAvg: v.trend.summary.avg,
|
|
571
|
-
completedCount: v.history.completedCount, incompleteCount: v.history.incompleteCount,
|
|
572
|
-
});
|
|
573
|
-
return { data: { metrics }, html: renderGoalHtml(v) };
|
|
574
|
-
}
|
|
575
|
-
case 'calorie.view.goal-config': {
|
|
576
|
-
const g = buildGoalConfig(db);
|
|
577
|
-
const metrics = nums({
|
|
578
|
-
calorie_goal: g.nutrition.calorie_goal, protein_goal: g.nutrition.protein_goal,
|
|
579
|
-
carbs_goal: g.nutrition.carbs_goal, fat_goal: g.nutrition.fat_goal, water_goal: g.nutrition.water_goal,
|
|
580
|
-
diffKcal: g.diffKcal, consistent: g.consistent ? 1 : 0, paused: g.paused ? 1 : 0,
|
|
581
|
-
});
|
|
582
|
-
return { data: { metrics }, html: renderGoalConfigHtml(g) };
|
|
583
|
-
}
|
|
584
|
-
case 'calorie.view.goal-recommend': {
|
|
585
|
-
const profile = optStr(params, 'profile') ?? 'cut';
|
|
586
|
-
if (!['cut', 'maintain', 'bulk'].includes(profile))
|
|
587
|
-
fail(2, 'profile 非法(cut/maintain/bulk):' + profile);
|
|
588
|
-
const g = buildGoalRecommend(db, profile);
|
|
589
|
-
const metrics = nums({
|
|
590
|
-
calorieGoal: g.recommend.calorieGoal, proteinGoal: g.recommend.proteinGoal, carbsGoal: g.recommend.carbsGoal,
|
|
591
|
-
fatGoal: g.recommend.fatGoal, waterGoal: g.recommend.waterGoal, tdee: g.recommend.tdee, bmr: g.recommend.bmr,
|
|
592
|
-
weeklyRateKg: g.recommend.weeklyRateKg, weightKg: g.recommend.basis.weightKg,
|
|
593
|
-
recommendedWaterMl: g.water.recommendedWaterMl, mlPerKg: g.water.mlPerKg,
|
|
594
|
-
});
|
|
595
|
-
return { data: { metrics }, html: renderGoalRecommendHtml(g) };
|
|
596
|
-
}
|
|
597
|
-
case 'calorie.view.goal-weight': {
|
|
598
|
-
const { start, end } = defaultRange(db, params);
|
|
599
|
-
const g = buildGoalWeight(db, start, end);
|
|
600
|
-
const metrics = nums({ weightGoal: g.weightGoal, latestKg: g.latestKg, deltaKg: g.deltaKg, loggedDays: g.loggedDays });
|
|
601
|
-
return { data: { metrics }, html: renderGoalWeightHtml(g) };
|
|
602
|
-
}
|
|
603
|
-
case 'calorie.view.goal-progress': {
|
|
604
|
-
const { start, end } = defaultRange(db, params);
|
|
605
|
-
const historyDays = optNum(params, 'historyDays') ?? 30;
|
|
606
|
-
if (!Number.isInteger(historyDays) || historyDays < 1 || historyDays > 365)
|
|
607
|
-
fail(2, 'historyDays 须为 1..365 整数');
|
|
608
|
-
const g = buildGoalProgress(db, start, end, historyDays);
|
|
609
|
-
const metrics = nums({
|
|
610
|
-
calorie_goal: g.nutrition.calorie_goal, completionPct: g.completionPct,
|
|
611
|
-
weeklyDeficit: g.deficit.summary.weeklyDeficit, predictedLossKg: g.deficit.summary.predictedLossKg,
|
|
612
|
-
avgDeficit: g.deficit.summary.avgDeficit, trendAvg: g.trend.summary.avg,
|
|
613
|
-
completedCount: g.history.completedCount, incompleteCount: g.history.incompleteCount,
|
|
614
|
-
});
|
|
615
|
-
return { data: { metrics }, html: renderGoalProgressHtml(g) };
|
|
616
|
-
}
|
|
617
|
-
case 'calorie.view.goal-status': {
|
|
618
|
-
const g = buildGoalStatus(db);
|
|
619
|
-
const metrics = nums({ paused: g.paused ? 1 : 0, calorie_goal: g.nutrition.calorie_goal, water_goal: g.nutrition.water_goal });
|
|
620
|
-
return { data: { metrics }, html: renderGoalStatusHtml(g) };
|
|
621
|
-
}
|
|
622
|
-
case 'calorie.view.combined': {
|
|
623
|
-
const pair = optStr(params, 'pair') ?? 'weight_calorie';
|
|
624
|
-
const window = optStr(params, 'window') ?? '7d';
|
|
625
|
-
const start = optStr(params, 'start') ?? null;
|
|
626
|
-
const end = optStr(params, 'end') ?? null;
|
|
627
|
-
const today = optStr(params, 'today') ?? latestFoodDate(db) ?? todayISO();
|
|
628
|
-
const c = buildCombinedAnalysis(db, pair, window, start, end, today);
|
|
629
|
-
const metrics = nums({
|
|
630
|
-
aAvg: c.analysis.aAvg, bAvg: c.analysis.bAvg, aDelta: c.analysis.aDelta, bDelta: c.analysis.bDelta,
|
|
631
|
-
aCount: c.analysis.aCount, bCount: c.analysis.bCount,
|
|
632
|
-
correlationR: c.analysis.correlation.r, correlationN: c.analysis.correlation.n, days: c.analysis.days,
|
|
633
|
-
seriesDays: c.series.length,
|
|
634
|
-
});
|
|
635
|
-
return { data: { metrics }, html: buildCombinedDoc(c) };
|
|
636
|
-
}
|
|
637
|
-
case 'calorie.view.deficit': {
|
|
638
|
-
const { start, end } = defaultRange(db, params);
|
|
639
|
-
const d = buildDeficitPlate(db, start, end);
|
|
640
|
-
const metrics = nums({
|
|
641
|
-
avgIntake: d.summary.avgIntake, avgBurn: d.summary.avgBurn, avgExerciseBurn: d.summary.avgExerciseBurn,
|
|
642
|
-
avgDeficit: d.summary.avgDeficit, weeklyDeficit: d.summary.weeklyDeficit, predictedLossKg: d.summary.predictedLossKg,
|
|
643
|
-
days: d.meta.days, weekdayCount: d.meta.weekdayCount, weekendCount: d.meta.weekendCount,
|
|
644
|
-
targetIntake: d.target.intake, targetTdee: d.target.tdee,
|
|
645
|
-
});
|
|
646
|
-
return { data: { metrics }, html: buildDeficitDoc(d) };
|
|
647
|
-
}
|
|
648
|
-
case 'calorie.view.diet-review': {
|
|
649
|
-
const { start, end } = defaultRange(db, params);
|
|
650
|
-
const r = buildDietReview(db, start, end);
|
|
651
|
-
const metrics = nums({
|
|
652
|
-
loggedDays: r.loggedDays,
|
|
653
|
-
'meal.早餐': r.byMeal.find((s) => s.meal === '早餐')?.totalCalories,
|
|
654
|
-
'meal.午餐': r.byMeal.find((s) => s.meal === '午餐')?.totalCalories,
|
|
655
|
-
'meal.晚餐': r.byMeal.find((s) => s.meal === '晚餐')?.totalCalories,
|
|
656
|
-
'meal.加餐': r.byMeal.find((s) => s.meal === '加餐')?.totalCalories,
|
|
657
|
-
});
|
|
658
|
-
// #108 · 复盘全文档(趋势折线+配比环+高频 TOP5+按餐汇总;TOP5 取数失败即空态,不编数)。
|
|
659
|
-
const fr = dietFoodRanking(db, start, end, 'frequent', 5);
|
|
660
|
-
return { data: { metrics }, html: buildDietReviewDoc(r, fr.status === 'ok' ? (fr.data ?? null) : null) };
|
|
661
|
-
}
|
|
662
|
-
case 'calorie.view.health': {
|
|
663
|
-
const { start, end } = defaultRange(db, params);
|
|
664
|
-
const h = buildHealthPlate(db, start, end);
|
|
665
|
-
const metrics = nums({ loggedDays: h.loggedDays, avgIntake: h.avgIntake, avgDeficit: h.avgDeficit });
|
|
666
|
-
return { data: { metrics }, html: buildHealthDoc(h) };
|
|
667
|
-
}
|
|
668
|
-
case 'calorie.view.ranking': {
|
|
669
|
-
const { start, end } = defaultRange(db, params);
|
|
670
|
-
const category = optStr(params, 'category');
|
|
671
|
-
const topN = optNum(params, 'topN') ?? 5;
|
|
672
|
-
if (!Number.isInteger(topN) || topN < 1 || topN > 50)
|
|
673
|
-
fail(2, 'topN 须为 1..50 整数');
|
|
674
|
-
if (category) {
|
|
675
|
-
const one = buildFoodRankingPlate(db, start, end, category, topN);
|
|
676
|
-
const top = one.items[0];
|
|
677
|
-
const metrics = nums({ total: one.items.length, topN: one.topN, topCal: top?.totalCal, topCnt: top?.cnt, topRank: top?.rank });
|
|
678
|
-
return { data: { metrics }, html: buildRankingDoc(one) };
|
|
679
|
-
}
|
|
680
|
-
const all = buildAllRankings(db, start, end, topN);
|
|
681
|
-
const metrics = nums({ okCount: all.okCount, topN: all.topN });
|
|
682
|
-
return { data: { metrics }, html: buildAllRankingsDoc(all) };
|
|
683
|
-
}
|
|
684
|
-
case 'calorie.view.library': {
|
|
685
|
-
const category = optStr(params, 'category') ?? null;
|
|
686
|
-
const limit = optNum(params, 'limit') ?? 50;
|
|
687
|
-
if (!Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
688
|
-
fail(2, 'limit 须为 1..100 整数');
|
|
689
|
-
const lib = buildProductLibrary(db, category, limit);
|
|
690
|
-
const stats = buildProductStats(db);
|
|
691
|
-
const metrics = nums({ total: lib.total, statsTotal: stats.total });
|
|
692
|
-
return { data: { metrics }, html: buildLibraryDoc(lib, stats.total) };
|
|
693
|
-
}
|
|
694
|
-
case 'calorie.view.search': {
|
|
695
|
-
const keyword = needStr(params, 'keyword');
|
|
696
|
-
const limit = optNum(params, 'limit') ?? 20;
|
|
697
|
-
if (!Number.isInteger(limit) || limit < 1 || limit > 100)
|
|
698
|
-
fail(2, 'limit 须为 1..100 整数');
|
|
699
|
-
const s = buildProductSearch(db, keyword, limit);
|
|
700
|
-
const metrics = nums({ total: s.total, limit: limit });
|
|
701
|
-
return { data: { metrics }, html: buildSearchDoc(s) };
|
|
702
|
-
}
|
|
703
|
-
case 'calorie.photo.list': {
|
|
704
|
-
const dir = photosDirOf(params);
|
|
705
|
-
const filter = {};
|
|
706
|
-
for (const k of ['tag', 'dateFrom', 'dateTo', 'days', 'limit', 'today']) {
|
|
707
|
-
if (params[k] !== undefined)
|
|
708
|
-
filter[k] = params[k];
|
|
709
|
-
}
|
|
710
|
-
const g = buildGalleryData(db, filter, dir ?? null);
|
|
711
|
-
const items = g.photos.map((p) => ({ id: p.id, date: p.date, photoPath: p.photoPath, tagList: p.tagList, fileExists: p.fileExists }));
|
|
712
|
-
return { data: { items, total: g.totalCount }, html: renderGalleryHtml(g) };
|
|
713
|
-
}
|
|
714
|
-
case 'calorie.photo.detail': {
|
|
715
|
-
const id = params['id'];
|
|
716
|
-
if (typeof id !== 'number' || !Number.isInteger(id))
|
|
717
|
-
fail(2, '缺参数 id(整数照片 id)');
|
|
718
|
-
const dir = photosDirOf(params);
|
|
719
|
-
const v = buildViewerData(db, id, dir ?? null);
|
|
720
|
-
return { data: { item: { id: v.photo.id, date: v.photo.date, photoPath: v.photo.photoPath, tagList: v.photo.tagList } }, html: renderViewerHtml(v) };
|
|
721
|
-
}
|
|
722
|
-
case 'calorie.photo.compare': {
|
|
723
|
-
const id1 = params['id1'];
|
|
724
|
-
const id2 = params['id2'];
|
|
725
|
-
if (typeof id1 !== 'number' || !Number.isInteger(id1))
|
|
726
|
-
fail(2, '缺参数 id1(整数)');
|
|
727
|
-
if (typeof id2 !== 'number' || !Number.isInteger(id2))
|
|
728
|
-
fail(2, '缺参数 id2(整数)');
|
|
729
|
-
const dir = photosDirOf(params);
|
|
730
|
-
const c = buildCompareData(db, id1, id2, dir ?? null);
|
|
731
|
-
const items = [c.photo1, c.photo2].map((p) => ({ id: p.id, date: p.date, photoPath: p.photoPath, tagList: p.tagList }));
|
|
732
|
-
return { data: { items, total: 2 }, html: renderCompareHtml(c) };
|
|
733
|
-
}
|
|
734
|
-
case 'calorie.photo.gif': {
|
|
735
|
-
const tag = needStr(params, 'tag');
|
|
736
|
-
const gif = buildGifTask(db, {
|
|
737
|
-
tag, dateFrom: (optStr(params, 'dateFrom') ?? null),
|
|
738
|
-
dateTo: (optStr(params, 'dateTo') ?? null),
|
|
739
|
-
days: (optNum(params, 'days') ?? 90),
|
|
740
|
-
});
|
|
741
|
-
return { data: { summary: 'GIF 任务:标签 ' + gif.tag + ' 共 ' + gif.photoCount + ' 张(' + (gif.firstDate ?? '—') + ' ~ ' + (gif.lastDate ?? '—') + ')· ' + gif.note }, html: renderGifHtml(gif) };
|
|
742
|
-
}
|
|
743
|
-
case 'calorie.help.center': {
|
|
744
|
-
// #139 · 本键出**两种产物**,靠 `mode` 分流(旧地图口径「缺省=速查台」已被 #131 新图准则覆盖:
|
|
745
|
-
// Q2「整个卡路里只有一个 HELP」+ Q17「比对以老实物为准」):
|
|
746
|
-
// 缺省(不给 `mode`)=「卡路里help」的交付物:老实物同款 V4 三级目录 HELP 文件
|
|
747
|
-
// (`卡路里_HELP_<TS>.html`,与老技能同名同视觉——地图目的地①②就落在这一支);
|
|
748
|
-
// 显式 `mode`=#88 全量速查台三态(`file`/`inline`/`text`,内容与语义逐字不变),
|
|
749
|
-
// 落 `卡路里_速查台_<TS>.html`(与 HELP 文件分名,两份产物不撞车)。
|
|
750
|
-
// D6:`mode` 不靠猜、不从别的参数推,非法值即 exit 2;`q`=照片 10 键现找(既有语义逐字不变)。
|
|
751
|
-
const q = optStr(params, 'q') ?? optStr(params, 'keyword') ?? undefined;
|
|
752
|
-
const modeRaw = optStr(params, 'mode');
|
|
753
|
-
const photoLookup = q !== undefined && q !== '';
|
|
754
|
-
if (photoLookup && modeRaw !== undefined) {
|
|
755
|
-
fail(2, '参数 q 与 mode 互斥:q=照片 HELP 现找(10 键),mode=全量速查台交付形态('
|
|
756
|
-
+ HELP_CENTER_MODES.join('/') + ')');
|
|
757
|
-
}
|
|
758
|
-
if (q !== undefined && modeRaw === undefined) {
|
|
759
|
-
// 照片路径(原样保留):非空 q = 现找(无命中 exit 4);`q:""` = 全量 10 键。
|
|
760
|
-
const hits = photoLookup ? lookupPhotoHelp(q) : buildPhotoHelp();
|
|
761
|
-
if (photoLookup && hits.length === 0)
|
|
762
|
-
throw new CalorieRenderError('missing-data', 'HELP 无命中:' + q);
|
|
763
|
-
const items = hits.map((h) => ({ wakeWord: h.wakeWord, key: h.key, desc: h.desc, exec: h.exec }));
|
|
764
|
-
return { data: { items, total: items.length }, html: renderPhotoHelpHtml(hits, q) };
|
|
765
|
-
}
|
|
766
|
-
const now = new Date();
|
|
767
|
-
if (modeRaw === undefined) {
|
|
768
|
-
// 缺省:老实物同款 HELP 文件(5 键 JSON → V4 三级目录壳)。落点走 `target`——本键的
|
|
769
|
-
// <中文command>(注册表 title)另有其物,不能拿来命名这份产物。
|
|
770
|
-
const html = renderHelpFileHtml(buildHelpFileData(now));
|
|
771
|
-
const data = {
|
|
772
|
-
...helpCenterIndex(buildHelpSceneData()),
|
|
773
|
-
mode: 'file',
|
|
774
|
-
bytes: Buffer.byteLength(html, 'utf8'),
|
|
775
|
-
};
|
|
776
|
-
return {
|
|
777
|
-
data, html,
|
|
778
|
-
target: { dir: join(resolveDbDir(), HELP_HTML_DIR_NAME), stem: HELP_FILE_STEM },
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
// 全量速查台:须显式 `mode`;`text` 态把文本一并回传(file/inline 只回落点,不塞 1 MB)。
|
|
782
|
-
const mode = modeRaw;
|
|
783
|
-
if (!HELP_CENTER_MODES.includes(mode)) {
|
|
784
|
-
fail(2, '参数 mode 非法(' + String(mode) + '):须为 ' + HELP_CENTER_MODES.join('/'));
|
|
785
|
-
}
|
|
786
|
-
const sceneData = buildHelpSceneData();
|
|
787
|
-
const rendered = renderHelpCenterHtml({ mode, sceneData });
|
|
788
|
-
const data = {
|
|
789
|
-
...helpCenterIndex(sceneData),
|
|
790
|
-
mode,
|
|
791
|
-
bytes: Buffer.byteLength(rendered.html, 'utf8'),
|
|
792
|
-
};
|
|
793
|
-
if (mode === 'text')
|
|
794
|
-
data['text'] = rendered.html;
|
|
795
|
-
// #83 · 渲染层已定文本交付:产物即文本(③ 文本态之一),交付装配层据此走文本通道。
|
|
796
|
-
return {
|
|
797
|
-
data, html: rendered.html, deliveryKind: mode === 'text' ? 'text' : 'html',
|
|
798
|
-
target: { dir: join(resolveDbDir(), HELP_HTML_DIR_NAME), stem: SHEET_FILE_STEM },
|
|
799
|
-
};
|
|
800
|
-
}
|
|
801
|
-
case 'calorie.help.lookup': {
|
|
802
|
-
const q = needStr(params, 'q');
|
|
803
|
-
// C2/C3 #43 · 唯一搜索入口 searchHelp:别名感知 + 可执行排前 + 高频词合成首条(去legacy首命中)。
|
|
804
|
-
const found = searchHelp(TRIGGERS, q);
|
|
805
|
-
if (found.length === 0)
|
|
806
|
-
throw new CalorieRenderError('missing-data', '唤醒词无命中:' + q);
|
|
807
|
-
const sceneToCategory = { '01': '主页', '02': '饮食', '03': '体重', '04': '运动', '05': '健身计划', '06': '目标管理', '07': '基础信息', '08': '身体细节', '09': '身材照片', '10': '分析' };
|
|
808
|
-
const hits = found.map((h) => {
|
|
809
|
-
const src = TRIGGERS.find((t) => t.wake_word === h.wake_word && ('key' in t ? String(t.key ?? '') : '') === String(h.key ?? ''));
|
|
810
|
-
const category = src ? src.category : (sceneToCategory[h.scene] ?? h.scene);
|
|
811
|
-
return { wake_word: h.wake_word, category, key: String(h.key ?? ''), cli: h.cli, desc: h.desc };
|
|
812
|
-
});
|
|
813
|
-
// #90 · 渲染收敛到 render/html.ts 的 renderHelpLookupHtml(每行复制按钮 + 页尾注入双通道运行时)。
|
|
814
|
-
const html = renderHelpLookupHtml(hits, q);
|
|
815
|
-
return { data: { items: hits, total: hits.length }, html };
|
|
816
|
-
}
|
|
817
|
-
case 'calorie.history': {
|
|
818
|
-
const days = optNum(params, 'days') ?? 7;
|
|
819
|
-
if (!Number.isInteger(days) || days < 1 || days > 365)
|
|
820
|
-
fail(2, 'days 须为 1..365 整数');
|
|
821
|
-
const h = getCalorieHistory(db, days);
|
|
822
|
-
if (h.rows.length === 0)
|
|
823
|
-
throw new CalorieRenderError('missing-data', '最近' + String(days) + '天无记录');
|
|
824
|
-
const items = h.rows.map((r) => ({ date: r.date, calories: r.calories, protein: r.protein, status: r.status }));
|
|
825
|
-
const html = '<section class="ilife-page" data-skill="calorie" data-slot="ilife:calorie:history"><h1>热量历史(最近' + h.days + '天)</h1>' +
|
|
826
|
-
items.map((r) => '<div class="ilife-item"><b>' + r.date + '</b> ' + r.calories + ' 卡 · ' + String(r.status).replace(/&/g, '&') + '</div>').join('') + '</section>';
|
|
827
|
-
return { data: { items, total: items.length }, html };
|
|
828
|
-
}
|
|
829
|
-
case 'calorie.view.weight': {
|
|
830
|
-
const { start, end } = defaultRange(db, params);
|
|
831
|
-
const w = buildWeightDashboard(db, start, end);
|
|
832
|
-
const metrics = nums({
|
|
833
|
-
recordCount: w.trend.recordCount, avgWeight: w.trend.avgWeight,
|
|
834
|
-
maxWeight: w.trend.maxWeight, minWeight: w.trend.minWeight,
|
|
835
|
-
firstWeight: w.trend.firstWeight, lastWeight: w.trend.lastWeight,
|
|
836
|
-
changeKg: w.trend.changeKg, dailyChangeG: w.trend.dailyChangeG,
|
|
837
|
-
weightGoal: w.weightGoal, gapKg: w.gapKg,
|
|
838
|
-
});
|
|
839
|
-
return { data: { metrics }, html: buildWeightDoc(w) };
|
|
840
|
-
}
|
|
841
|
-
case 'calorie.view.weight-history': {
|
|
842
|
-
const startDate = optStr(params, 'startDate') ?? optStr(params, 'start');
|
|
843
|
-
const endDate = optStr(params, 'endDate') ?? optStr(params, 'end');
|
|
844
|
-
const days = optNum(params, 'days');
|
|
845
|
-
let h;
|
|
846
|
-
if (startDate && endDate)
|
|
847
|
-
h = buildWeightHistoryView(db, { startDate, endDate });
|
|
848
|
-
else if (startDate && !endDate)
|
|
849
|
-
h = buildWeightHistoryView(db, { startDate });
|
|
850
|
-
else if (days !== undefined)
|
|
851
|
-
h = buildWeightHistoryView(db, { days });
|
|
852
|
-
else
|
|
853
|
-
h = buildWeightHistoryView(db, {});
|
|
854
|
-
const metrics = nums({
|
|
855
|
-
rows: h.rows.length,
|
|
856
|
-
spanDays: h.change?.spanDays, first: h.change?.first, last: h.change?.last,
|
|
857
|
-
delta: h.change?.delta, dailyAvg: h.change?.dailyAvg,
|
|
858
|
-
});
|
|
859
|
-
return { data: { metrics }, html: buildWeightHistoryDoc(h) };
|
|
860
|
-
}
|
|
861
|
-
case 'calorie.view.weight-compare': {
|
|
862
|
-
const start = needStr(params, 'start');
|
|
863
|
-
const end = needStr(params, 'end');
|
|
864
|
-
const compareStart = needStr(params, 'compareStart');
|
|
865
|
-
const compareEnd = needStr(params, 'compareEnd');
|
|
866
|
-
const v = buildWeightCompareView(db, start, end, compareStart, compareEnd);
|
|
867
|
-
const metrics = nums({
|
|
868
|
-
avgDiff: v.compare.avgDiff,
|
|
869
|
-
currentAvg: v.compare.currentPeriod.avgWeight, compareAvg: v.compare.comparePeriod.avgWeight,
|
|
870
|
-
currentChange: v.compare.currentPeriod.changeKg, compareChange: v.compare.comparePeriod.changeKg,
|
|
871
|
-
});
|
|
872
|
-
return { data: { metrics }, html: buildWeightCompareDoc(v) };
|
|
873
|
-
}
|
|
874
|
-
case 'calorie.view.weight-review': {
|
|
875
|
-
const today = optStr(params, 'today') ?? optStr(params, 'date');
|
|
876
|
-
const v = buildWeightReviewView(db, today ?? undefined);
|
|
877
|
-
const metrics = nums({
|
|
878
|
-
currentWeight: v.milestone.currentWeight, weightGoal: v.milestone.weightGoal,
|
|
879
|
-
gapKg: v.milestone.gapKg, actualDailyChangeKg: v.milestone.actualDailyChangeKg,
|
|
880
|
-
estDays: v.milestone.estDays, calorieAdjustment: v.milestone.calorieAdjustment,
|
|
881
|
-
});
|
|
882
|
-
return { data: { metrics }, html: buildWeightReviewDoc(v) };
|
|
883
|
-
}
|
|
884
|
-
case 'calorie.view.volatility': {
|
|
885
|
-
const { start, end } = defaultRange(db, params);
|
|
886
|
-
const mode = (optStr(params, 'baselineMode') ?? optStr(params, 'mode') ?? 'rolling');
|
|
887
|
-
const v = buildVolatilityView(db, start, end, mode);
|
|
888
|
-
const metrics = nums({
|
|
889
|
-
baselineValue: v.volatility.baselineValue, baselineSigma: v.volatility.baselineSigma,
|
|
890
|
-
yellow: v.volatility.thresholds.yellow, red: v.volatility.thresholds.red,
|
|
891
|
-
points: v.volatility.points.length, anomalies: v.volatility.recentAnomalies.length,
|
|
892
|
-
deviationKg: v.volatility.earlyWarning.deviationKg,
|
|
893
|
-
});
|
|
894
|
-
return { data: { metrics }, html: buildVolatilityDoc(v) };
|
|
895
|
-
}
|
|
896
|
-
case 'calorie.view.body-composition': {
|
|
897
|
-
const days = optNum(params, 'days') ?? 90;
|
|
898
|
-
const source = optStr(params, 'source');
|
|
899
|
-
const limit = optNum(params, 'limit') ?? 20;
|
|
900
|
-
const v = buildBodyCompositionView(db, { days: days, source: source ?? undefined, limit: limit });
|
|
901
|
-
const metrics = nums({ total: v.total, latestPct: v.latestPct, trendDays: v.trend.length });
|
|
902
|
-
return { data: { metrics }, html: buildBodyCompositionDoc(v) };
|
|
903
|
-
}
|
|
904
|
-
case 'calorie.view.body-measure': {
|
|
905
|
-
const metric = optStr(params, 'metric');
|
|
906
|
-
const days = optNum(params, 'days') ?? 90;
|
|
907
|
-
const limit = optNum(params, 'limit') ?? 20;
|
|
908
|
-
const dateFrom = optStr(params, 'dateFrom');
|
|
909
|
-
const dateTo = optStr(params, 'dateTo');
|
|
910
|
-
const v = buildBodyMeasureView(db, { metric: metric ?? undefined, days: days, limit: limit, dateFrom: dateFrom ?? undefined, dateTo: dateTo ?? undefined });
|
|
911
|
-
const metrics = nums({ total: v.total, latestVal: v.latestVal, trendDays: v.trend.length });
|
|
912
|
-
return { data: { metrics }, html: buildBodyMeasureDoc(v) };
|
|
913
|
-
}
|
|
914
|
-
case 'calorie.view.plan': {
|
|
915
|
-
const v = buildPlanView(db);
|
|
916
|
-
const metrics = nums({ totalSessions: v.totalSessions, totalMovements: v.totalMovements, totalWeeks: v.totalWeeks });
|
|
917
|
-
return { data: { metrics }, html: renderPlanHtml(v) };
|
|
918
|
-
}
|
|
919
|
-
case 'calorie.view.plan-wizard': {
|
|
920
|
-
const plan = params['plan'];
|
|
921
|
-
if (typeof plan !== 'object' || plan === null || Array.isArray(plan))
|
|
922
|
-
fail(2, '缺参数 plan(PlanInput 对象)');
|
|
923
|
-
const catalog = params['catalog'];
|
|
924
|
-
const v = buildPlanWizardView(plan, catalog ?? undefined);
|
|
925
|
-
const metrics = nums({ errorCount: v.errorCount, warningCount: v.warningCount, checkedSessions: v.checkedSessions });
|
|
926
|
-
return { data: { metrics }, html: renderPlanWizardHtml(v) };
|
|
927
|
-
}
|
|
928
|
-
case 'calorie.view.exercise-goal': {
|
|
929
|
-
const { start, end } = defaultRange(db, params);
|
|
930
|
-
const v = buildExerciseGoalView(db, start, end);
|
|
931
|
-
const metrics = nums({ dailyGoal: v.dailyGoal, goalTotal: v.goalTotal, actual: v.actual, pct: v.pct, gap: v.gap, achieved: v.achieved ? 1 : 0, days: v.days });
|
|
932
|
-
return { data: { metrics }, html: buildExerciseGoalDoc(v) };
|
|
933
|
-
}
|
|
934
|
-
case 'calorie.view.goal-expiring': {
|
|
935
|
-
const withinDays = optNum(params, 'withinDays') ?? optNum(params, 'days') ?? 14;
|
|
936
|
-
const today = optStr(params, 'today');
|
|
937
|
-
const v = buildGoalExpiringView(db, withinDays, today ?? undefined);
|
|
938
|
-
const metrics = nums({ daysLeft: v.daysLeft, withinDays: v.withinDays, expiring: v.expiring ? 1 : 0, weightGoal: v.weightGoal, calorieGoal: v.calorieGoal });
|
|
939
|
-
return { data: { metrics }, html: renderGoalExpiringHtml(v) };
|
|
940
|
-
}
|
|
941
|
-
case 'calorie.view.goal-predict': {
|
|
942
|
-
// #103 G2 · 目标预测需 ≥14 条体重记录(simulate SIM_MIN_DAYS=14),7 天默认窗结构性不可达 → 默认 14 天。
|
|
943
|
-
const { start, end } = defaultRange(db, params, 14);
|
|
944
|
-
const v = buildGoalPredictView(db, start, end);
|
|
945
|
-
const metrics = nums({ targetKg: v.targetKg, current: v.current, daysLeft: v.daysLeft, ratePerWeek: v.ratePerWeek, feasible: v.feasible ? 1 : 0 });
|
|
946
|
-
return { data: { metrics }, html: buildGoalPredictDoc(v) };
|
|
947
|
-
}
|
|
948
|
-
case 'calorie.view.goal-vs-actual': {
|
|
949
|
-
const { start, end } = defaultRange(db, params);
|
|
950
|
-
const historyDays = optNum(params, 'historyDays') ?? 30;
|
|
951
|
-
const v = buildGoalVsActualView(db, start, end, historyDays);
|
|
952
|
-
const metrics = nums({
|
|
953
|
-
completedCount: v.completedCount, incompleteCount: v.incompleteCount,
|
|
954
|
-
completionPct: v.completionPct, trendAvg: v.trendAvg, calorieGoal: v.calorieGoal,
|
|
955
|
-
});
|
|
956
|
-
return { data: { metrics }, html: renderGoalVsActualHtml(v) };
|
|
957
|
-
}
|
|
958
|
-
case 'calorie.view.predict': {
|
|
959
|
-
// #103 G2 · 同 goal-predict:默认 14 天,否则缺省调用恒走 missing-data。
|
|
960
|
-
const { start, end } = defaultRange(db, params, 14);
|
|
961
|
-
const horizonDays = optNum(params, 'horizonDays') ?? optNum(params, 'days') ?? 30;
|
|
962
|
-
const v = buildPredictView(db, start, end, horizonDays);
|
|
963
|
-
const metrics = nums({ current: v.current, ratePerWeek: v.ratePerWeek, forecastValue: v.forecastValue, forecastLo: v.forecastLo, forecastHi: v.forecastHi, horizonDays: v.horizonDays });
|
|
964
|
-
return { data: { metrics }, html: buildPredictDoc(v) };
|
|
965
|
-
}
|
|
966
|
-
case 'calorie.view.anomaly': {
|
|
967
|
-
const kind = needStr(params, 'kind');
|
|
968
|
-
const { start, end } = defaultRange(db, params);
|
|
969
|
-
const v = buildAnomalyView(db, kind, start, end);
|
|
970
|
-
const metrics = nums({ findingCount: v.findingCount, days: v.diagnosis.days, degraded: v.diagnosis.degraded ? 1 : 0 });
|
|
971
|
-
return { data: { metrics }, html: buildAnomalyDoc(v) };
|
|
972
|
-
}
|
|
973
|
-
case 'calorie.view.contraindication': {
|
|
974
|
-
const part = optStr(params, 'part') ?? 'all';
|
|
975
|
-
const v = buildContraView(db, part);
|
|
976
|
-
const metrics = nums({ scannedSessions: v.scannedSessions, scannedMovements: v.scannedMovements, errorCount: v.errorCount, warnCount: v.warnCount, infoCount: v.infoCount });
|
|
977
|
-
return { data: { metrics }, html: buildContraDoc(v) };
|
|
978
|
-
}
|
|
979
|
-
case 'calorie.view.dedupe': {
|
|
980
|
-
const v = buildDedupeView(db);
|
|
981
|
-
const metrics = nums({ groupCount: v.groupCount, rowCount: v.rowCount, totalProducts: v.totalProducts });
|
|
982
|
-
return { data: { metrics }, html: buildDedupeDoc(v) };
|
|
983
|
-
}
|
|
984
|
-
case 'calorie.view.profile': {
|
|
985
|
-
const v = buildProfileView(db);
|
|
986
|
-
const metrics = nums({
|
|
987
|
-
age: v.profile.age, heightCm: v.profile.height_cm,
|
|
988
|
-
hasGoal: v.hasGoal ? 1 : 0, latestWeightKg: v.latestWeightKg,
|
|
989
|
-
calorieGoal: v.nutrition?.calorie_goal,
|
|
990
|
-
});
|
|
991
|
-
// #179 · 结果页换整页装配(原 `renderProfileHtml` 只出 `<section>` 片段,双击打不开)。
|
|
992
|
-
return { data: { metrics }, html: buildProfileViewDoc(v) };
|
|
993
|
-
}
|
|
994
|
-
default:
|
|
995
|
-
fail(3, '未知 calorie key:' + key);
|
|
996
|
-
throw new Error('unreachable');
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
/* ── #83 · 三态交付装配(M4 HTML-First + 渲染失败回执) ───────────────────────────────── */
|
|
1000
|
-
/** 交付落点的可读描述(回执文案用;默认目录名必须出现在文案里,便于用户定位)。 */
|
|
1001
|
-
function describeDeliveryTarget(explicit) {
|
|
1002
|
-
return explicit !== undefined ? '显式落点 ' + explicit : '默认目录 <SKILLS_DB_PATH>/' + HTML_DIR_NAME;
|
|
1003
|
-
}
|
|
1004
|
-
/** ③ 文本态的结构化文本:**同源**取 `buildDataText`(#77 契约,五 shape 投影)。
|
|
1005
|
-
* `fallback` 形不在 `SERIALIZABLE_SHAPES` 内(#93 登记:无 CLI 出口)——此时退化为缩进 JSON,
|
|
1006
|
-
* 仍是「结构化文本」且零编造;本退化分支由 `delivery-83.test.mjs` 直接钉住。 */
|
|
1007
|
-
function dataTextOf(shape, key, data) {
|
|
1008
|
-
try {
|
|
1009
|
-
return buildDataText({
|
|
1010
|
-
envelope: { version: ENVELOPE_VERSION, skill: CALORIE_SKILL, shape, key, data },
|
|
1011
|
-
format: 'text',
|
|
1012
|
-
});
|
|
1013
|
-
}
|
|
1014
|
-
catch {
|
|
1015
|
-
return JSON.stringify(data, null, 2);
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
/** 三态判定 + envelope 装配(**唯一交付落点**:同一 key、同一份 `data`,绝不各自取数):
|
|
1019
|
-
* ③ 文本态:用户**明确**要文本(通用 `--params '{"delivery":"text"}'`)/渲染层已产出文本
|
|
1020
|
-
* (#91 `help.center` 的 `mode:'text'`)/**无 HTML 产物**(结构缝:`html` 为空 ⇒ 无对应模板,允许文字答);
|
|
1021
|
-
* ② 内联态:有 HTML 产物但写不进去(只读/沙箱 `EACCES|EPERM|EROFS|EBUSY`)⇒ 产物随 envelope 回传;
|
|
1022
|
-
* ① 文件态(默认):落盘 `calorie_html/*.html`,`data.output` 与 `delivery.path` 同值同源。
|
|
1023
|
-
* `delivery` 为 envelope 的**顶层追加字段**(既有五字段一字不改);P9「stdout 一行 JSON」不变。 */
|
|
1024
|
-
export function buildDeliveredEnvelope(input) {
|
|
1025
|
-
const { key, shape, params, out } = input;
|
|
1026
|
-
const html = typeof out.html === 'string' ? out.html : '';
|
|
1027
|
-
const askedText = params['delivery'] === 'text';
|
|
1028
|
-
const kind = askedText ? 'text' : (out.deliveryKind ?? (html.trim() === '' ? 'text' : 'html'));
|
|
1029
|
-
if (kind === 'text') {
|
|
1030
|
-
// 三态同源:文本由**同一份** envelope data 经 #77 `buildDataText` 投影(技能侧不自产第二套序列化)。
|
|
1031
|
-
const text = typeof out.data['text'] === 'string' ? out.data['text'] : dataTextOf(shape, key, out.data);
|
|
1032
|
-
const data = { ...out.data, text };
|
|
1033
|
-
// 渲染层已定文本交付的键(#91 `help.center` text 态)**保留既有落盘**(`data.output` 指向该文本文件);
|
|
1034
|
-
// 其余键的文本态只走 envelope(③ 产物=结构化文本,不落 HTML 文件)。
|
|
1035
|
-
if (out.deliveryKind === 'text') {
|
|
1036
|
-
const d = deliverHtml({ key, params, explicit: input.explicit, target: out.target, html: text });
|
|
1037
|
-
if (d.mode === 'file')
|
|
1038
|
-
data['output'] = d.path;
|
|
1039
|
-
return withDelivery(buildEnvelope(key, shape, data), buildDelivery({
|
|
1040
|
-
mode: 'text', path: d.mode === 'file' ? d.path : undefined, shape, html: text, bytes: d.bytes, template: 'text',
|
|
1041
|
-
}));
|
|
1042
|
-
}
|
|
1043
|
-
return withDelivery(buildEnvelope(key, shape, data), buildDelivery({
|
|
1044
|
-
mode: 'text', shape, html: text, bytes: Buffer.byteLength(text, 'utf8'), template: 'text',
|
|
1045
|
-
}));
|
|
1046
|
-
}
|
|
1047
|
-
const d = deliverHtml({ key, params, explicit: input.explicit, target: out.target, html });
|
|
1048
|
-
const data = d.mode === 'file'
|
|
1049
|
-
? { ...out.data, output: d.path }
|
|
1050
|
-
: { ...out.data, html };
|
|
1051
|
-
return withDelivery(buildEnvelope(key, shape, data), buildDelivery({
|
|
1052
|
-
mode: d.mode, path: d.mode === 'file' ? d.path : undefined, shape, html, bytes: d.bytes,
|
|
1053
|
-
}));
|
|
1054
|
-
}
|
|
1055
|
-
/** #83 · M4「渲染失败回执」:**模板化**回执(`buildErrorReceipt` + `renderErrorHtml`,旧
|
|
1056
|
-
* `render_error_receipt.py` 的等价物)——**严禁手写 HTML 兜底**。回执自身也走三态:默认目录可写即落盘,
|
|
1057
|
-
* 否则内联随 stderr 回传。机器可读回执以一行 `RECEIPT {…}` 落 **stderr**(P9:stdout 保持纯净,
|
|
1058
|
-
* 不吐半截 envelope),exit 5 与既有「渲染/落盘失败」口径一致。 */
|
|
1059
|
-
function failWithReceipt(reason, key) {
|
|
1060
|
-
console.error('ERR 5: ' + reason);
|
|
1061
|
-
try {
|
|
1062
|
-
const receipt = buildErrorReceipt({
|
|
1063
|
-
sceneName: '渲染',
|
|
1064
|
-
wakeWord: key ?? '渲染失败',
|
|
1065
|
-
op: '渲染/落盘未完成',
|
|
1066
|
-
reason,
|
|
1067
|
-
suggestions: [
|
|
1068
|
-
'检查 SKILLS_DB_PATH 与 ' + HTML_DIR_NAME + ' 目录权限(只读/沙箱会自动转内联交付)',
|
|
1069
|
-
'用 --output <可写绝对路径> 显式指定落点后重试',
|
|
1070
|
-
'确认 ' + HTML_DIR_NAME + ' 未被同名文件占位(占位会挡住落点解析)',
|
|
1071
|
-
],
|
|
1072
|
-
fixPrompt: 'calorie-cmd-read ' + (key ?? '<key>') + " --params '{…}' --output <可写绝对路径>",
|
|
1073
|
-
});
|
|
1074
|
-
const receiptHtml = renderErrorHtml(receipt);
|
|
1075
|
-
let delivery;
|
|
1076
|
-
try {
|
|
1077
|
-
const d = deliverHtml({
|
|
1078
|
-
key: key ?? 'calorie.help.center', params: {}, target: resolveReceiptHtmlPath(), html: receiptHtml,
|
|
1079
|
-
});
|
|
1080
|
-
delivery = buildDelivery({
|
|
1081
|
-
mode: d.mode, path: d.mode === 'file' ? d.path : undefined, shape: 'receipt', html: receiptHtml, bytes: d.bytes,
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
catch {
|
|
1085
|
-
delivery = buildDelivery({
|
|
1086
|
-
mode: 'inline', shape: 'receipt', html: receiptHtml, bytes: Buffer.byteLength(receiptHtml, 'utf8'),
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
// 内联回执把模板化回执页面一并回传(否则调用方拿不到回执正文);落盘态只回路径。
|
|
1090
|
-
console.error('RECEIPT ' + JSON.stringify({
|
|
1091
|
-
ok: false, ...receipt, delivery, html: delivery.mode === 'inline' ? receiptHtml : undefined,
|
|
1092
|
-
}));
|
|
1093
|
-
}
|
|
1094
|
-
catch (e) {
|
|
1095
|
-
console.error('TOAST: 回执生成失败(' + (e.message || String(e)) + ')');
|
|
1096
|
-
}
|
|
1097
|
-
process.exit(5);
|
|
1098
|
-
}
|
|
1099
|
-
function parseReadArgs(a) {
|
|
1100
|
-
return parseArgs(a);
|
|
43
|
+
// #294 · 注册表先行:命中即走能力目录那道门(新增能力/新增命令都不必碰这个文件)。
|
|
44
|
+
// #320 · 未搬迁清单归零 ⇒ 老路那口按键分派的 switch 已成死代码,整口删除;
|
|
45
|
+
// 未命中即「这个键不存在」,直接 fail——往分派层加分支这件事已经被棘轮挡在门外。
|
|
46
|
+
const spec = REGISTRY[key];
|
|
47
|
+
if (spec) {
|
|
48
|
+
if (spec.kind !== 'read')
|
|
49
|
+
fail(3, '写键不走读分派:' + key);
|
|
50
|
+
return spec.run(params, db);
|
|
51
|
+
}
|
|
52
|
+
fail(3, '未知 calorie key:' + key);
|
|
53
|
+
throw new Error('unreachable');
|
|
1101
54
|
}
|
|
1102
55
|
async function main() {
|
|
1103
56
|
const o = parseReadArgs(process.argv.slice(2));
|
|
@@ -1140,18 +93,19 @@ async function main() {
|
|
|
1140
93
|
? dispatchWrite(o.key, params, db)
|
|
1141
94
|
: dispatch(o.key, params, db);
|
|
1142
95
|
// #83 · 三态交付(M4 HTML-First):① 文件态(默认)/② 内联态(只读·沙箱回退)/③ 文本态。
|
|
1143
|
-
// 落点:--
|
|
96
|
+
// 落点:--html(显式覆盖)> 默认 calorie_html/<中文command>_<TS>[_N].html(#87/#119)。
|
|
97
|
+
// ⚠️ 老技能的 `--output` 别名**已删**(#245 收口,与其余五家同形:只认 `--html`;给 `--output` 即 exit 2)。
|
|
1144
98
|
// 只读类写失败 → 内联交付(产物随 envelope 回传,绝不因写不进去而文字答);
|
|
1145
99
|
// 结构错/渲染错 → 渲染失败回执(模板化回执,exit 5;严禁手写 HTML 兜底)。
|
|
1146
100
|
try {
|
|
1147
101
|
env = buildDeliveredEnvelope({
|
|
1148
|
-
key: o.key, shape: shape, out, params, explicit: o.
|
|
102
|
+
key: o.key, shape: shape, out, params, explicit: o.html,
|
|
1149
103
|
});
|
|
1150
104
|
}
|
|
1151
105
|
catch (e) {
|
|
1152
106
|
if (e instanceof CalorieRenderError)
|
|
1153
107
|
throw e;
|
|
1154
|
-
failWithReceipt('渲染失败:' + describeDeliveryTarget(o.
|
|
108
|
+
failWithReceipt('渲染失败:' + describeDeliveryTarget(o.html) + ':'
|
|
1155
109
|
+ (e.message || String(e)), o.key);
|
|
1156
110
|
}
|
|
1157
111
|
}
|
|
@@ -1161,14 +115,25 @@ async function main() {
|
|
|
1161
115
|
}
|
|
1162
116
|
catch (e) {
|
|
1163
117
|
if (e instanceof CalorieRenderError) {
|
|
1164
|
-
|
|
118
|
+
// #500 · 身体域缺数据/缺参数走失败回执整页(exit 保持 4/2,按 #365 实测);
|
|
119
|
+
// 非身体键走原纯文本(其它域不动)。接线位是框架调用方(声明外最小 wiring,见证据)。
|
|
120
|
+
if (e.code === 'missing-data') {
|
|
121
|
+
if (bodySceneFor(o.key) !== null)
|
|
122
|
+
failWithBodyReceipt('取数失败(缺失阻断):' + e.message, o.key, 4);
|
|
1165
123
|
fail(4, '取数失败(缺失阻断):' + e.message);
|
|
1166
|
-
|
|
124
|
+
}
|
|
125
|
+
if (e.code === 'bad-input') {
|
|
126
|
+
if (bodySceneFor(o.key) !== null)
|
|
127
|
+
failWithBodyReceipt('参数失败:' + e.message, o.key, 2);
|
|
1167
128
|
fail(2, '参数失败:' + e.message);
|
|
129
|
+
}
|
|
1168
130
|
failWithReceipt('渲染失败:' + e.message, o.key);
|
|
1169
131
|
}
|
|
1170
|
-
if (e instanceof FetchError)
|
|
132
|
+
if (e instanceof FetchError) {
|
|
133
|
+
if (bodySceneFor(o.key) !== null)
|
|
134
|
+
failWithBodyReceipt('取数失败:' + e.message, o.key, 4);
|
|
1171
135
|
fail(4, '取数失败:' + e.message);
|
|
136
|
+
}
|
|
1172
137
|
fail(4, '未知失败:' + (e.message || String(e)));
|
|
1173
138
|
}
|
|
1174
139
|
finally {
|