Add Health action support#192
Conversation
5cb6ae7 to
fb04a0b
Compare
fb04a0b to
cc442fe
Compare
cc442fe to
5e98d78
Compare
|
@electrikmilk PTAL |
|
There are some other changes here; please state the rationale for these changes |
bda44b8 to
2414105
Compare
The fileRequest() body parameter change is unrelated to Health support; it has been moved to its own PR to keep this PR scoped to Health. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Xvr9ByAkYxnM3SJjBw9T9
|
Thanks for the review — I've scoped this PR down to Health only and split the unrelated work out:
Everything still outside
On tests: these are Cherri-first — |
This adds a standard Health action include with support for the Health actions exposed through Shortcuts.
It covers logging quantity samples, category samples, blood pressure, and workouts, plus finding samples, reading sample details, Health app navigation, Health search, sleep schedule, tabs, records, and physical activity. The general sample logging helpers are named
logHealthQuantitySampleandlogHealthCategorySampleto make it clear they create Health samples.For example, importing a Shortcut that logs blood pressure now produces standard syntax like this:
A demo Shortcut with several Health actions decompiles into standard calls as well:
This also keeps support for
WFQuantityFieldValueinrawAction(...)so custom Health workflows can round-trip through import without losing the quantity value structure.Health sample types and units were filled out using the local HealthKit SDK headers, and the action identifiers were cross-checked against local Shortcuts and App Intents metadata. While testing imports, I also fixed a decompilation issue where non-Latin output names could sanitize to an empty identifier and produce invalid code like
const = ...; those now fall back tooutput.