shortcuts-playground 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/agents/shortcut-builder.md +172 -0
- package/agents/shortcut-remixer.md +239 -0
- package/commands/build-shortcut.md +32 -0
- package/commands/remix-shortcut.md +34 -0
- package/opencode.json +30 -0
- package/package.json +47 -0
- package/plugin/validator.ts +179 -0
- package/skills/shortcuts-playground/ACTIONS.md +713 -0
- package/skills/shortcuts-playground/APPINTENTS.md +2760 -0
- package/skills/shortcuts-playground/AUTOMATION_TRIGGERS.md +133 -0
- package/skills/shortcuts-playground/BEST_PRACTICES.md +357 -0
- package/skills/shortcuts-playground/CHANGELOG.md +585 -0
- package/skills/shortcuts-playground/CONTROL_FLOW.md +777 -0
- package/skills/shortcuts-playground/DATE_TIME.md +75 -0
- package/skills/shortcuts-playground/EXAMPLES.md +738 -0
- package/skills/shortcuts-playground/FILTERS.md +697 -0
- package/skills/shortcuts-playground/HEALTHKIT.md +317 -0
- package/skills/shortcuts-playground/ICONS_AND_COLORS.md +89 -0
- package/skills/shortcuts-playground/JAVASCRIPT_WEBPAGE.md +51 -0
- package/skills/shortcuts-playground/PARAMETER_TYPES.md +1117 -0
- package/skills/shortcuts-playground/PLIST_FORMAT.md +296 -0
- package/skills/shortcuts-playground/README.md +77 -0
- package/skills/shortcuts-playground/SKILL.md +459 -0
- package/skills/shortcuts-playground/THIRD_PARTY_ACTIONS.md +77 -0
- package/skills/shortcuts-playground/TOOLKIT_SNAPSHOT.md +62 -0
- package/skills/shortcuts-playground/URL_SCHEMES.md +59 -0
- package/skills/shortcuts-playground/VARIABLES.md +569 -0
- package/skills/shortcuts-playground/assets/shortcuts-small.svg +14 -0
- package/skills/shortcuts-playground/assets/shortcuts.png +0 -0
- package/skills/shortcuts-playground/data/healthkit-ios26.2-reference.json +2603 -0
- package/skills/shortcuts-playground/data/macos27-shortpy-grounding.json +4085 -0
- package/skills/shortcuts-playground/data/macos27-workflow-trigger-samples.json +1 -0
- package/skills/shortcuts-playground/data/shortcuts-glyph-synonyms.json +5102 -0
- package/skills/shortcuts-playground/data/shortcuts-icon-colors.json +107 -0
- package/skills/shortcuts-playground/data/shortcuts-official-glyph-mapping.json +509 -0
- package/skills/shortcuts-playground/data/toolkit-v63-tool-ids.json +1806 -0
- package/skills/shortcuts-playground/data/toolkit-v78-first-party-enum-cases.json +1 -0
- package/skills/shortcuts-playground/data/toolkit-v78-first-party-parameter-keys.json +1 -0
- package/skills/shortcuts-playground/data/toolkit-v78-ios27-tool-ids.json +1222 -0
- package/skills/shortcuts-playground/data/toolkit-v78-tool-ids.json +2745 -0
- package/skills/shortcuts-playground/data/toolkit-v78-trigger-parameter-keys.json +1051 -0
- package/skills/shortcuts-playground/golden-shortcuts/index.jsonl +19 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/1be4dde95b794253bf82438e201b33e7.xml +174 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/2e0fb675e45948aaacee7e534f910492.xml +1016 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/332c12a0060043b388b22b806be7ab58.xml +1924 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/3dd4ee24e43f464f92adaa70a0311eaa.xml +1177 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/4d102301c6e646faa7a8a221f4f4ec98.xml +321 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/51cc4e26d1044893a0c3f2f3630cf2d2.xml +1933 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/623e7f1ca5f948e2bd53811fec63e544.xml +136 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/6a18b76843ac45c384ac3400f3740997.xml +1791 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/71f0cacb0f604b399b76c5dcb7286e7c.xml +2228 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/807525ed9f974829bc8494defac923a8.xml +259 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/8ab0d39826ab4249be58672763caa3ba.xml +420 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/91c45fd3fd3b427897d9ba485efb1227.xml +800 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/97be626bb25c41709d175646a7f6d8f2.xml +424 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/ae59e10d409348f9bd33894f03f9beb4.xml +568 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/afa83b6be811483b9c32189c41eb9312.xml +391 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/cfdb083b857e4ac189629fa386d27cdc.xml +193 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/e01cebe192d64b2fbca80204d03d92ab.xml +111 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/ef669bcf8bad489d9ef4b88bfaf5772f.xml +780 -0
- package/skills/shortcuts-playground/golden-shortcuts/xml/f44f5caf5e3e48d4817e73af450c4404.xml +570 -0
- package/skills/shortcuts-playground/scripts/generate_healthkit_reference.py +394 -0
- package/skills/shortcuts-playground/scripts/lookup_action_grounding.py +1164 -0
- package/skills/shortcuts-playground/scripts/select_shortcut_icon_color.py +597 -0
- package/skills/shortcuts-playground/scripts/test_random_mixed_shortcuts.py +1067 -0
- package/skills/shortcuts-playground/scripts/test_wiring_regressions.py +2247 -0
- package/skills/shortcuts-playground/scripts/validate_shortcut.py +4526 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# HealthKit Shortcuts Reference
|
|
2
|
+
|
|
3
|
+
Health actions are iOS/iPadOS-first. macOS Shortcuts syncs their XML but cannot fully configure the Health UI. Prefer this file and the bundled reference data over guesses.
|
|
4
|
+
|
|
5
|
+
## Evidence
|
|
6
|
+
|
|
7
|
+
Primary syntax source: bundled anonymized iOS Shortcuts XML examples captured while building this reference. User-specific shortcut names, source paths, and iCloud locations are intentionally omitted from the distributed skill.
|
|
8
|
+
|
|
9
|
+
- Find Health Samples XML example: `WFContentItemFilter` with a locked `Type is ...` predicate row, date filter row, and sample output wiring.
|
|
10
|
+
- Log Health Sample quantity XML example: Caffeine quantity log.
|
|
11
|
+
- Log Health Sample category XML example: category sample with no visible Value row in the editor.
|
|
12
|
+
- Log Health Sample category-value XML example: category sample with an explicit enum value picker.
|
|
13
|
+
- Get Details of Health Sample XML example: `WFContentItemPropertyName`, `WFInput`.
|
|
14
|
+
- Log Workout XML evidence: action identifier sync/export evidence only; the available export was UUID-only before a full workout configuration was captured.
|
|
15
|
+
|
|
16
|
+
Exhaustive value source: iPhoneOS 26.2 HealthKit headers plus ActionKit `WFHealthKitConstants.plist`, generated into `data/healthkit-ios26.2-reference.json`.
|
|
17
|
+
|
|
18
|
+
## Actions
|
|
19
|
+
|
|
20
|
+
### Find Health Samples
|
|
21
|
+
|
|
22
|
+
Identifier: `is.workflow.actions.filter.health.quantity`
|
|
23
|
+
|
|
24
|
+
Required parameters:
|
|
25
|
+
|
|
26
|
+
- `UUID`
|
|
27
|
+
- `WFContentItemFilter`: `WFContentPredicateTableTemplate` containing a non-removable `Type` predicate row. Use `Values.Enumeration` with `WFSerializationType = WFStringSubstitutableState` and the Find Health Samples picker label, for example `Caffeine`, `Steps`, `Sleep`, `Walking + Running Distance`, or `Exercise Minutes`.
|
|
28
|
+
|
|
29
|
+
Optional:
|
|
30
|
+
|
|
31
|
+
- `WFContentItemLimitEnabled`: boolean.
|
|
32
|
+
- `WFContentItemLimitNumber`: required when limit is enabled.
|
|
33
|
+
|
|
34
|
+
Do not use `WFHealthQuantityType`. That top-level key was previously documented here, but current iOS Shortcuts imports it as an inert plist field. Do not use a `Value` predicate row with `Values.String` either: that imports as an editable text filter (`Value is Step Count`) instead of the Health type picker (`Type is Steps`).
|
|
35
|
+
|
|
36
|
+
Observed filter shape:
|
|
37
|
+
|
|
38
|
+
```xml
|
|
39
|
+
<key>WFContentItemFilter</key>
|
|
40
|
+
<dict>
|
|
41
|
+
<key>Value</key>
|
|
42
|
+
<dict>
|
|
43
|
+
<key>WFActionParameterFilterPrefix</key>
|
|
44
|
+
<integer>1</integer>
|
|
45
|
+
<key>WFContentPredicateBoundedDate</key>
|
|
46
|
+
<false/>
|
|
47
|
+
<key>WFActionParameterFilterTemplates</key>
|
|
48
|
+
<array>
|
|
49
|
+
<dict>
|
|
50
|
+
<key>Bounded</key>
|
|
51
|
+
<true/>
|
|
52
|
+
<key>Operator</key>
|
|
53
|
+
<integer>4</integer>
|
|
54
|
+
<key>Property</key>
|
|
55
|
+
<string>Type</string>
|
|
56
|
+
<key>Removable</key>
|
|
57
|
+
<false/>
|
|
58
|
+
<key>Values</key>
|
|
59
|
+
<dict>
|
|
60
|
+
<key>Enumeration</key>
|
|
61
|
+
<dict>
|
|
62
|
+
<key>Value</key>
|
|
63
|
+
<string>Steps</string>
|
|
64
|
+
<key>WFSerializationType</key>
|
|
65
|
+
<string>WFStringSubstitutableState</string>
|
|
66
|
+
</dict>
|
|
67
|
+
</dict>
|
|
68
|
+
</dict>
|
|
69
|
+
<dict>
|
|
70
|
+
<key>Bounded</key>
|
|
71
|
+
<true/>
|
|
72
|
+
<key>Operator</key>
|
|
73
|
+
<integer>1002</integer>
|
|
74
|
+
<key>Property</key>
|
|
75
|
+
<string>Start Date</string>
|
|
76
|
+
<key>Removable</key>
|
|
77
|
+
<false/>
|
|
78
|
+
<key>Values</key>
|
|
79
|
+
<dict>
|
|
80
|
+
<key>Number</key>
|
|
81
|
+
<string>7</string>
|
|
82
|
+
<key>Unit</key>
|
|
83
|
+
<integer>16</integer>
|
|
84
|
+
</dict>
|
|
85
|
+
</dict>
|
|
86
|
+
</array>
|
|
87
|
+
</dict>
|
|
88
|
+
<key>WFSerializationType</key>
|
|
89
|
+
<string>WFContentPredicateTableTemplate</string>
|
|
90
|
+
</dict>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`Operator` `4` is `is` for the `Type` row. `Operator` `1002` is the observed `Start Date is today` row; manual iOS exports include `Values.Number = "7"` and `Values.Unit = 16` on that row. Use `WFActionParameterFilterPrefix = 1` for All when combining sample-kind and date rows.
|
|
94
|
+
|
|
95
|
+
Output name observed in downstream wiring: `Health Samples`.
|
|
96
|
+
|
|
97
|
+
### Health Summary Math
|
|
98
|
+
|
|
99
|
+
When building dashboards that sum Health samples, do not infer units from HealthKit SDK names. Use the Shortcuts picker labels and the details returned by Shortcuts:
|
|
100
|
+
|
|
101
|
+
- **Exercise**: the Find Health Samples picker label is `Exercise Minutes`, not `Apple Exercise Time` or `Exercise Time`.
|
|
102
|
+
- **Sleep**: the Find Health Samples picker label is `Sleep`, not `Sleep Analysis`. Sleep is a category sample, and `Duration` values may display as clock-style durations such as `28:09`, `3:31`, or `1:06:52`.
|
|
103
|
+
- **Sleep duration math**: `Get Details of Health Sample` → `Duration` should be treated as a duration. When that value is coerced through Math, treat it as seconds. Divide by `3600` for decimal hours, or divide by `60` and label the result as minutes. Never divide sleep duration by `60` and label the result as hours.
|
|
104
|
+
- **Sleep date ranges**: for "last night" summaries, do not use only `Start Date is today`; sleep often starts before midnight. Prefer an explicit last-night range (for example, yesterday evening through this morning) or tell the user the range needs confirmation.
|
|
105
|
+
- **Walking + Running Distance**: do not assume `Value` is meters and divide by `1000`. Shortcuts returns `Value` in the action's displayed Health unit. Sum values directly, or use Convert Measurement with an explicit source unit and target unit.
|
|
106
|
+
|
|
107
|
+
### Get Details of Health Sample
|
|
108
|
+
|
|
109
|
+
Identifier: `is.workflow.actions.properties.health.quantity`
|
|
110
|
+
|
|
111
|
+
Required parameters:
|
|
112
|
+
|
|
113
|
+
- `UUID`
|
|
114
|
+
- `WFContentItemPropertyName`
|
|
115
|
+
- `WFInput`
|
|
116
|
+
|
|
117
|
+
Detail names exposed by the iOS picker:
|
|
118
|
+
|
|
119
|
+
`Type`, `Value`, `Unit`, `Start Date`, `End Date`, `Duration`, `Source`, `Name`.
|
|
120
|
+
|
|
121
|
+
Observed wiring:
|
|
122
|
+
|
|
123
|
+
```xml
|
|
124
|
+
<key>WFContentItemPropertyName</key>
|
|
125
|
+
<string>Value</string>
|
|
126
|
+
<key>WFInput</key>
|
|
127
|
+
<dict>
|
|
128
|
+
<key>Value</key>
|
|
129
|
+
<dict>
|
|
130
|
+
<key>OutputName</key>
|
|
131
|
+
<string>Health Samples</string>
|
|
132
|
+
<key>OutputUUID</key>
|
|
133
|
+
<string>FIND-HEALTH-SAMPLES-UUID-HERE</string>
|
|
134
|
+
<key>Type</key>
|
|
135
|
+
<string>ActionOutput</string>
|
|
136
|
+
</dict>
|
|
137
|
+
<key>WFSerializationType</key>
|
|
138
|
+
<string>WFTextTokenAttachment</string>
|
|
139
|
+
</dict>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`WFInput` must reference Find Health Samples or a variable sourced from Find Health Samples. Log Health Sample output is also a Health sample source.
|
|
143
|
+
|
|
144
|
+
### Log Health Sample
|
|
145
|
+
|
|
146
|
+
Identifier: `is.workflow.actions.health.quantity.log`
|
|
147
|
+
|
|
148
|
+
Required parameters:
|
|
149
|
+
|
|
150
|
+
- `UUID`
|
|
151
|
+
- `WFQuantitySampleType`
|
|
152
|
+
- A value field: usually `WFQuantitySampleQuantity`; enum category samples can also include `WFCategorySampleEnumeration`.
|
|
153
|
+
|
|
154
|
+
Quantity sample, Caffeine:
|
|
155
|
+
|
|
156
|
+
```xml
|
|
157
|
+
<key>WFQuantitySampleType</key>
|
|
158
|
+
<string>Caffeine</string>
|
|
159
|
+
<key>WFQuantitySampleQuantity</key>
|
|
160
|
+
<dict>
|
|
161
|
+
<key>Value</key>
|
|
162
|
+
<dict>
|
|
163
|
+
<key>Magnitude</key>
|
|
164
|
+
<string>120</string>
|
|
165
|
+
<key>Unit</key>
|
|
166
|
+
<string>mg</string>
|
|
167
|
+
</dict>
|
|
168
|
+
<key>WFSerializationType</key>
|
|
169
|
+
<string>WFQuantityFieldValue</string>
|
|
170
|
+
</dict>
|
|
171
|
+
<key>WFQuantitySampleAdditionalQuantity</key>
|
|
172
|
+
<dict>
|
|
173
|
+
<key>Value</key>
|
|
174
|
+
<dict>
|
|
175
|
+
<key>Unit</key>
|
|
176
|
+
<string>mg</string>
|
|
177
|
+
</dict>
|
|
178
|
+
<key>WFSerializationType</key>
|
|
179
|
+
<string>WFQuantityFieldValue</string>
|
|
180
|
+
</dict>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Category sample with no visible value row, Bloating:
|
|
184
|
+
|
|
185
|
+
```xml
|
|
186
|
+
<key>WFQuantitySampleType</key>
|
|
187
|
+
<string>Bloating</string>
|
|
188
|
+
<key>WFQuantitySampleQuantity</key>
|
|
189
|
+
<dict>
|
|
190
|
+
<key>Value</key>
|
|
191
|
+
<dict>
|
|
192
|
+
<key>Magnitude</key>
|
|
193
|
+
<string>10</string>
|
|
194
|
+
<key>Unit</key>
|
|
195
|
+
<string>count</string>
|
|
196
|
+
</dict>
|
|
197
|
+
<key>WFSerializationType</key>
|
|
198
|
+
<string>WFQuantityFieldValue</string>
|
|
199
|
+
</dict>
|
|
200
|
+
<key>WFQuantitySampleAdditionalQuantity</key>
|
|
201
|
+
<dict>
|
|
202
|
+
<key>Value</key>
|
|
203
|
+
<dict>
|
|
204
|
+
<key>Unit</key>
|
|
205
|
+
<string>count</string>
|
|
206
|
+
</dict>
|
|
207
|
+
<key>WFSerializationType</key>
|
|
208
|
+
<string>WFQuantityFieldValue</string>
|
|
209
|
+
</dict>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Category sample with enum value, Cervical Mucus Quality:
|
|
213
|
+
|
|
214
|
+
```xml
|
|
215
|
+
<key>WFQuantitySampleType</key>
|
|
216
|
+
<string>Cervical Mucus Quality</string>
|
|
217
|
+
<key>WFCategorySampleEnumeration</key>
|
|
218
|
+
<string>Dry</string>
|
|
219
|
+
<key>WFQuantitySampleQuantity</key>
|
|
220
|
+
<dict>
|
|
221
|
+
<key>Value</key>
|
|
222
|
+
<dict>
|
|
223
|
+
<key>Magnitude</key>
|
|
224
|
+
<string>10</string>
|
|
225
|
+
<key>Unit</key>
|
|
226
|
+
<string>count</string>
|
|
227
|
+
</dict>
|
|
228
|
+
<key>WFSerializationType</key>
|
|
229
|
+
<string>WFQuantityFieldValue</string>
|
|
230
|
+
</dict>
|
|
231
|
+
<key>WFQuantitySampleAdditionalQuantity</key>
|
|
232
|
+
<dict>
|
|
233
|
+
<key>Value</key>
|
|
234
|
+
<dict>
|
|
235
|
+
<key>Unit</key>
|
|
236
|
+
<string>count</string>
|
|
237
|
+
</dict>
|
|
238
|
+
<key>WFSerializationType</key>
|
|
239
|
+
<string>WFQuantityFieldValue</string>
|
|
240
|
+
</dict>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Optional date fields:
|
|
244
|
+
|
|
245
|
+
- `WFQuantitySampleDate`
|
|
246
|
+
- `WFSampleEndDate`
|
|
247
|
+
|
|
248
|
+
These can use `WFTextTokenAttachment` with `{Type: CurrentDate}`.
|
|
249
|
+
|
|
250
|
+
### Log Workout
|
|
251
|
+
|
|
252
|
+
Identifier: `is.workflow.actions.health.workout.log`
|
|
253
|
+
|
|
254
|
+
The currently available XML evidence proves the identifier but not a fully configured parameter dictionary. The generator and validator support the schema below from action metadata conventions and HealthKit workout values; treat a future full iOS export as higher priority if it conflicts.
|
|
255
|
+
|
|
256
|
+
Required:
|
|
257
|
+
|
|
258
|
+
- `UUID`
|
|
259
|
+
- `WFWorkoutReadableActivityType`: Shortcuts UI label, for example `Running`, `Walking`, `Cycling`.
|
|
260
|
+
|
|
261
|
+
Optional:
|
|
262
|
+
|
|
263
|
+
- `WFWorkoutDate`
|
|
264
|
+
- `WFWorkoutDuration`: `WFQuantityFieldValue`, normally `min`.
|
|
265
|
+
- `WFWorkoutCaloriesQuantity`: `WFQuantityFieldValue`, normally `kcal`.
|
|
266
|
+
- `WFWorkoutDistanceQuantity`: `WFQuantityFieldValue`, normally `m`, `km`, `mi`, etc.
|
|
267
|
+
|
|
268
|
+
Generated shape:
|
|
269
|
+
|
|
270
|
+
```xml
|
|
271
|
+
<key>WFWorkoutReadableActivityType</key>
|
|
272
|
+
<string>Running</string>
|
|
273
|
+
<key>WFWorkoutDate</key>
|
|
274
|
+
<dict>
|
|
275
|
+
<key>Value</key>
|
|
276
|
+
<dict>
|
|
277
|
+
<key>Type</key>
|
|
278
|
+
<string>CurrentDate</string>
|
|
279
|
+
</dict>
|
|
280
|
+
<key>WFSerializationType</key>
|
|
281
|
+
<string>WFTextTokenAttachment</string>
|
|
282
|
+
</dict>
|
|
283
|
+
<key>WFWorkoutDuration</key>
|
|
284
|
+
<dict>
|
|
285
|
+
<key>Value</key>
|
|
286
|
+
<dict>
|
|
287
|
+
<key>Magnitude</key>
|
|
288
|
+
<string>30</string>
|
|
289
|
+
<key>Unit</key>
|
|
290
|
+
<string>min</string>
|
|
291
|
+
</dict>
|
|
292
|
+
<key>WFSerializationType</key>
|
|
293
|
+
<string>WFQuantityFieldValue</string>
|
|
294
|
+
</dict>
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Values
|
|
298
|
+
|
|
299
|
+
`data/healthkit-ios26.2-reference.json` contains:
|
|
300
|
+
|
|
301
|
+
- 120 quantity types.
|
|
302
|
+
- 70 category types.
|
|
303
|
+
- 17 category value enum families, covering 61 explicit enum values.
|
|
304
|
+
- 84 workout activity types.
|
|
305
|
+
- 46 ActionKit Health unit strings.
|
|
306
|
+
|
|
307
|
+
Use `shortcut_label_guess` as a fallback, but prefer action-specific observed labels when present. For Find Health Samples, prefer `observed_find_samples_labels`; for example, `HKQuantityTypeIdentifierStepCount` is `Steps`, `HKCategoryTypeIdentifierSleepAnalysis` is `Sleep`, `HKQuantityTypeIdentifierActiveEnergyBurned` is `Active Calories`, and `HKQuantityTypeIdentifierAppleExerciseTime` is `Exercise Minutes` in the Find Health Samples picker. Other Health action contexts may use labels such as `Step Count`; for active energy burned, use `Active Calories`, not `Active Energy` or `Active Energy Burned`.
|
|
308
|
+
|
|
309
|
+
Known bundled label override:
|
|
310
|
+
|
|
311
|
+
- `HKCategoryTypeIdentifierGeneralizedBodyAche`: Shortcuts picker label is `Body and Muscle Ache`, not the SDK-derived `Generalized Body Ache`.
|
|
312
|
+
|
|
313
|
+
The validator checks Health sample types, Find Health Samples `Type` filter values, workout activity types, category enum values, and units against this bundled reference when it is available.
|
|
314
|
+
|
|
315
|
+
## Safety
|
|
316
|
+
|
|
317
|
+
Do not run Health-writing shortcuts only to test syntax. Build, inspect, validate, export, and import them; leave actual Health writes to the user unless they explicitly ask to run the shortcut.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Icons and Colors
|
|
2
|
+
|
|
3
|
+
Use this guide whenever you need to set `WFWorkflowIconGlyphNumber` and `WFWorkflowIconStartColor`.
|
|
4
|
+
|
|
5
|
+
## Data Sources
|
|
6
|
+
|
|
7
|
+
This skill now includes local icon/color data:
|
|
8
|
+
|
|
9
|
+
- `data/shortcuts-official-glyph-mapping.json` - official 507 glyph number -> symbol name mapping.
|
|
10
|
+
- `data/shortcuts-glyph-synonyms.json` - natural-language synonym map for all 507 glyphs.
|
|
11
|
+
- `data/shortcuts-icon-colors.json` - 15 Shortcuts icon colors (name, hex, integer values, aliases).
|
|
12
|
+
|
|
13
|
+
## Resolver Script
|
|
14
|
+
|
|
15
|
+
Use the resolver for every shortcut unless the user explicitly gives both icon and color integers:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python3 scripts/select_shortcut_icon_color.py --prompt "${USER_PROMPT}"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Optional overrides:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
python3 scripts/select_shortcut_icon_color.py \
|
|
25
|
+
--prompt "Create a shortcut for logging expenses" \
|
|
26
|
+
--icon "dollar sign" \
|
|
27
|
+
--color "gold"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Resolver output includes:
|
|
31
|
+
|
|
32
|
+
- `icon.glyph_number`
|
|
33
|
+
- `icon.symbol_name`
|
|
34
|
+
- `color.value`
|
|
35
|
+
- `color.name`
|
|
36
|
+
- `wf_workflow_icon.WFWorkflowIconGlyphNumber`
|
|
37
|
+
- `wf_workflow_icon.WFWorkflowIconStartColor`
|
|
38
|
+
|
|
39
|
+
Use those values directly in the root plist.
|
|
40
|
+
|
|
41
|
+
## Explicit Icon Selection
|
|
42
|
+
|
|
43
|
+
The resolver supports explicit icon requests in natural language, including:
|
|
44
|
+
|
|
45
|
+
- Glyph numbers: `icon 59819`, `glyph #61566`
|
|
46
|
+
- Symbol names: `use paperAirplane icon`
|
|
47
|
+
- Synonyms: `use robot icon`, `use terminal icon`, `use expense icon`
|
|
48
|
+
|
|
49
|
+
## Automatic Icon Selection
|
|
50
|
+
|
|
51
|
+
If no icon is specified, the resolver infers one from the full prompt using:
|
|
52
|
+
|
|
53
|
+
- Official symbol names
|
|
54
|
+
- Synonym matching
|
|
55
|
+
- Intent-focused boosts (weather, finance, translation, developer, messaging, etc.)
|
|
56
|
+
- Deterministic fallback to `61440` (`shortcuts`) for generic prompts
|
|
57
|
+
|
|
58
|
+
## Explicit Color Selection
|
|
59
|
+
|
|
60
|
+
Color can be selected with:
|
|
61
|
+
|
|
62
|
+
- Color names (`blue`, `purple`, `gold`, etc.)
|
|
63
|
+
- Synonyms (`gray`/`grey`, `turquoise`, etc.)
|
|
64
|
+
- Integer values (`463140863`, `-3831826433`)
|
|
65
|
+
- Hex values (`#24BAF7`) mapped to nearest palette color
|
|
66
|
+
|
|
67
|
+
## Automatic Color Selection
|
|
68
|
+
|
|
69
|
+
If no color is specified, color is inferred from prompt themes and falls back to Teal (`431817727`) when ambiguous.
|
|
70
|
+
|
|
71
|
+
## Supported Color Palette
|
|
72
|
+
|
|
73
|
+
| Name | Hex | Canonical value |
|
|
74
|
+
|---|---|---:|
|
|
75
|
+
| Red | `#F36F74` | `4282601983` |
|
|
76
|
+
| Orange | `#FF8E73` | `4251333119` |
|
|
77
|
+
| Yellow | `#F8AE5F` | `4271458815` |
|
|
78
|
+
| Gold | `#E8CA45` | `4274264319` |
|
|
79
|
+
| Green | `#53CD6B` | `4292093695` |
|
|
80
|
+
| Teal | `#57CFB4` | `431817727` |
|
|
81
|
+
| Cyan | `#5ACCDE` | `1440408063` |
|
|
82
|
+
| Blue | `#24BAF7` | `463140863` |
|
|
83
|
+
| Navy | `#5874CA` | `946986751` |
|
|
84
|
+
| Purple | `#9164C7` | `2071128575` |
|
|
85
|
+
| Lavender | `#C085E6` | `3679049983` |
|
|
86
|
+
| Pink | `#F694D8` | `3980825855` |
|
|
87
|
+
| Gray | `#9099A3` | `255` |
|
|
88
|
+
| Sage | `#9DA79D` | `3031607807` |
|
|
89
|
+
| Tan | `#A49995` | `2846468607` |
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Run JavaScript on Webpage
|
|
2
|
+
|
|
3
|
+
`is.workflow.actions.runjavascriptonwebpage` is only appropriate for shortcuts that run from Safari or Safari-backed web views. It is not a general JavaScript runtime.
|
|
4
|
+
|
|
5
|
+
## Runtime Requirements
|
|
6
|
+
|
|
7
|
+
- The user must enable **Allow Running Scripts** in Shortcuts privacy/security settings. This is a user setting and cannot be encoded in the plist.
|
|
8
|
+
- The shortcut must be available from the share sheet: include `ActionExtension` in `WFWorkflowTypes`.
|
|
9
|
+
- Scope shortcut input to Safari webpages: include `WFSafariWebPageContentItem` in `WFWorkflowInputContentItemClasses`.
|
|
10
|
+
- To keep the shortcut from appearing in unrelated share sheets, do not include other input classes unless the shortcut has a separate non-JavaScript path for those inputs.
|
|
11
|
+
- The action input must be an active Safari webpage from Safari, SFSafariViewController, or ASWebAuthenticationSession.
|
|
12
|
+
- If a shortcut contains multiple Run JavaScript on Webpage actions, each one must receive the Safari webpage as input.
|
|
13
|
+
|
|
14
|
+
## Script Rules
|
|
15
|
+
|
|
16
|
+
- The script must call `completion(result)` or `completion()`; returning from the JavaScript function is not enough.
|
|
17
|
+
- Asynchronous completion is supported. Call `completion(...)` from the async callback or promise resolution path.
|
|
18
|
+
- The output must be JSON-compatible: string, number, boolean, array, dictionary/object, `null`, or `undefined`.
|
|
19
|
+
- Do not call `JSON.stringify` just to return data to Shortcuts; Shortcuts handles JSON encoding/decoding for supported values.
|
|
20
|
+
- Convert DOM nodes, functions, Maps/Sets, and other non-JSON values into arrays or dictionaries of plain values before calling `completion(...)`.
|
|
21
|
+
|
|
22
|
+
## Timeout and Error Rules
|
|
23
|
+
|
|
24
|
+
- Keep scripts short and fast. Safari JavaScript extension execution has a time limit.
|
|
25
|
+
- Avoid `window.alert()`, `window.prompt()`, and `window.confirm()`; synchronous UI functions can prevent the action from completing in time.
|
|
26
|
+
- Avoid multi-second timers and blocking loops. A long `setTimeout` can cause a JavaScript Timeout failure.
|
|
27
|
+
- Runtime exceptions are surfaced by Shortcuts. Do not reference `shortcuts.completion()` or any non-Apple completion API.
|
|
28
|
+
|
|
29
|
+
## Minimal Pattern
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
const title = document.title;
|
|
33
|
+
const links = Array.from(document.querySelectorAll("a")).map((link) => ({
|
|
34
|
+
text: link.textContent.trim(),
|
|
35
|
+
href: link.href
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
completion({ title, links });
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
For no output:
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
document.body.style.fontSize = "120%";
|
|
45
|
+
completion();
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Sources
|
|
49
|
+
|
|
50
|
+
- Apple Shortcuts User Guide: Intro to the Run JavaScript on Webpage action
|
|
51
|
+
- Apple Shortcuts User Guide: Use the Run JavaScript on Webpage action
|