activitysmith-cli 1.21.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +28 -3
  2. package/package.json +1 -1
  3. package/src/cli.js +13 -23
package/README.md CHANGED
@@ -572,15 +572,20 @@ Choose from these colors for the Live Activity accent, including progress bars a
572
572
 
573
573
  Live Activities can include an action button.
574
574
 
575
- - `open_url`: Open a web page or run an iOS Shortcut
575
+ - `open_url`: Open a web page, run an iOS Shortcut, or open an app
576
576
  - `webhook`: Trigger a backend GET/POST workflow
577
577
 
578
578
  #### Open URL action
579
579
 
580
- Open a web page or run an iOS Shortcut when someone taps the button. Supported links:
580
+ Open a web page, run an iOS Shortcut, or open an app when someone taps the button. Supported links:
581
581
 
582
582
  - **HTTP/HTTPS:** Web pages, e.g. `https://example.com`
583
583
  - **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` <!-- full-width -->
584
+ - **App deep links:** Installed apps or specific content within them
585
+ - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6`
586
+ - **Termius:** `termius://` to open the app
587
+ - **Claude:** `claude://code` to open the Code tab
588
+ - **ChatGPT:** `chatgpt://` to open the app <!-- Verify ChatGPT URL scheme on iOS before publishing -->
584
589
 
585
590
  ```bash
586
591
  activitysmith activity stream prod-web-1 \
@@ -620,6 +625,26 @@ activitysmith activity stream prod-web-1 \
620
625
  }'
621
626
  ```
622
627
 
628
+ #### End after the tap
629
+
630
+ Set `dismiss_after_action` on an `open_url` button to end the Live Activity when someone taps it. The button opens its link, then the Live Activity ends.
631
+
632
+ ```bash
633
+ activitysmith activity stream agent-review \
634
+ --content-state '{
635
+ "title": "Review Ready",
636
+ "message": "Claude finished the checkout refactor.",
637
+ "type": "alert",
638
+ "color": "green"
639
+ }' \
640
+ --action '{
641
+ "title": "Open Claude",
642
+ "type": "open_url",
643
+ "url": "claude://code",
644
+ "dismiss_after_action": true
645
+ }'
646
+ ```
647
+
623
648
  #### Webhook action
624
649
 
625
650
  ```bash
@@ -685,7 +710,7 @@ activitysmith activity stream agent-approval \
685
710
 
686
711
  ### Live Activity Sounds
687
712
 
688
- Starting a Live Activity plays the Live Activities sound picked in the ActivitySmith app. Updates and ends are silent. Set `--sound` on a start, update, or end to choose its sound, with the same values as [Push Notification Sounds](#push-notification-sounds). A sound on an update or end also expands the Live Activity on the Lock Screen, so use it for moments that need attention, such as a failed step.
713
+ Starting a Live Activity plays the Live Activities sound picked in the ActivitySmith app. Updates and ends are silent. Set `--sound` on a start, update, or end to choose its sound, with the same values as [Push Notification Sounds](#push-notification-sounds). A sound on an update or end plays only while the screen is on. Use it for moments that need attention, such as a failed step.
689
714
 
690
715
  ```bash
691
716
  activitysmith activity stream deploy-api \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith-cli",
3
- "version": "1.21.0",
3
+ "version": "1.22.0",
4
4
  "description": "Command-line interface for ActivitySmith. Send Push Notifications, start, update, and end Live Activities, and set App Icon Badge Counts from your terminal.",
5
5
  "keywords": [
6
6
  "activitysmith",
package/src/cli.js CHANGED
@@ -139,7 +139,7 @@ const parseSoundOption = (value) => {
139
139
  };
140
140
 
141
141
  const SOUND_HELP = "Sound to play: a bundled sound name, default, or none";
142
- const LIVE_ACTIVITY_CHANGE_SOUND_HELP = `${SOUND_HELP}. Silent by default; a sound also expands the Live Activity on the Lock Screen`;
142
+ const LIVE_ACTIVITY_CHANGE_SOUND_HELP = `${SOUND_HELP}. Silent by default; iOS plays the sound only while the screen is on`;
143
143
 
144
144
  const withSound = (request, sound) => (sound === undefined ? request : { ...request, sound });
145
145
 
@@ -186,31 +186,11 @@ const normalizeHttpsUrl = (value, label) => {
186
186
  return parsed.toString();
187
187
  };
188
188
 
189
- const normalizeUrlWithSchemes = (value, label, schemes) => {
190
- if (typeof value !== "string" || value.trim().length === 0) {
191
- throw new Error(`${label} must be a non-empty string`);
192
- }
193
-
194
- let parsed;
195
- try {
196
- parsed = new URL(value.trim());
197
- } catch {
198
- throw new Error(`${label} must be a valid URL`);
199
- }
200
-
201
- const allowedProtocols = schemes.map((scheme) => `${scheme}:`);
202
- if (!allowedProtocols.includes(parsed.protocol)) {
203
- throw new Error(`${label} must use ${schemes.join(" or ")}`);
204
- }
205
-
206
- return parsed.toString();
207
- };
208
-
209
189
  const normalizeActionUrl = (value, label, type, push = false) => {
210
190
  if (type === "open_url") {
211
191
  if (push) return normalizeOpenUrl(value, label);
212
192
  const normalized = typeof value === "string" ? value.trim().replace(/^x-safari-https:\/\//i, "https://") : value;
213
- return normalizeUrlWithSchemes(normalized, label, ["http", "https", "shortcuts"]);
193
+ return normalizeOpenUrl(normalized, label);
214
194
  }
215
195
 
216
196
  return normalizeHttpsUrl(value, label);
@@ -807,6 +787,16 @@ const parseAction = (value, label, push = false) => {
807
787
  throw new Error(`${label} with type=open_url cannot include method or body`);
808
788
  }
809
789
 
790
+ if (!push && value.dismiss_after_action !== undefined) {
791
+ if (typeof value.dismiss_after_action !== "boolean") {
792
+ throw new Error(`${label}.dismiss_after_action must be a boolean`);
793
+ }
794
+ if (normalizedType !== "open_url") {
795
+ throw new Error(`${label}.dismiss_after_action is only supported for open_url`);
796
+ }
797
+ action.dismiss_after_action = value.dismiss_after_action;
798
+ }
799
+
810
800
  return action;
811
801
  };
812
802
 
@@ -1644,7 +1634,7 @@ addLiveActivityActionOptions(addContentStateOptions(
1644
1634
  .option("--clear-tags", "Remove all Tags from this stream")
1645
1635
  .option(
1646
1636
  "--sound <name>",
1647
- `${SOUND_HELP}. A new stream defaults to your Live Activities sound; updates are silent by default, and a sound also expands the Live Activity on the Lock Screen`,
1637
+ `${SOUND_HELP}. A new stream defaults to your Live Activities sound; updates are silent by default, and iOS plays an update sound only while the screen is on`,
1648
1638
  parseSoundOption
1649
1639
  )
1650
1640
  .option("--metadata <json>", "Metadata JSON object shown in ActivitySmith details")