activitysmith 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -504,15 +504,20 @@ Choose from these colors for the Live Activity accent, including progress bars a
504
504
 
505
505
  Live Activities can include an action button.
506
506
 
507
- - `open_url`: Open a web page or run an iOS Shortcut
507
+ - `open_url`: Open a web page, run an iOS Shortcut, or open an app
508
508
  - `webhook`: Trigger a backend GET/POST workflow
509
509
 
510
510
  #### Open URL action
511
511
 
512
- Open a web page or run an iOS Shortcut when someone taps the button. Supported links:
512
+ Open a web page, run an iOS Shortcut, or open an app when someone taps the button. Supported links:
513
513
 
514
514
  - **HTTP/HTTPS:** Web pages, e.g. `https://example.com`
515
515
  - **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` <!-- full-width -->
516
+ - **App deep links:** Installed apps or specific content within them
517
+ - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6`
518
+ - **Termius:** `termius://` to open the app
519
+ - **Claude:** `claude://code` to open the Code tab
520
+ - **ChatGPT:** `chatgpt://` to open the app <!-- Verify ChatGPT URL scheme on iOS before publishing -->
516
521
 
517
522
  ```ts
518
523
  await activitysmith.liveActivities.stream("prod-web-1", {
@@ -554,6 +559,27 @@ await activitysmith.liveActivities.stream("prod-web-1", {
554
559
  });
555
560
  ```
556
561
 
562
+ #### End after the tap
563
+
564
+ 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.
565
+
566
+ ```ts
567
+ await activitysmith.liveActivities.stream("agent-review", {
568
+ content_state: {
569
+ title: "Review Ready",
570
+ message: "Claude finished the checkout refactor.",
571
+ type: "alert",
572
+ color: "green",
573
+ },
574
+ action: {
575
+ title: "Open Claude",
576
+ type: "open_url",
577
+ url: "claude://code",
578
+ dismiss_after_action: true,
579
+ },
580
+ });
581
+ ```
582
+
557
583
  #### Webhook action
558
584
 
559
585
  ```ts
@@ -627,7 +653,7 @@ await activitysmith.liveActivities.stream("agent-approval", {
627
653
 
628
654
  ### Live Activity Sounds
629
655
 
630
- 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.
656
+ 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.
631
657
 
632
658
  ```ts
633
659
  await activitysmith.liveActivities.stream("deploy-api", {
@@ -1059,11 +1059,17 @@ export interface LiveActivityAction {
1059
1059
  */
1060
1060
  type: LiveActivityActionType;
1061
1061
  /**
1062
- * Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
1062
+ * Action URL. For open_url, use an HTTP or HTTPS URL, a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut, or an installed app's custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes need the target app installed and have no web fallback. Unsafe schemes and ActivitySmith's own scheme are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend.
1063
1063
  * @type {string}
1064
1064
  * @memberof LiveActivityAction
1065
1065
  */
1066
1066
  url: string;
1067
+ /**
1068
+ * Ends the Live Activity after the button opens its URL. Used only when type=open_url. Defaults to false.
1069
+ * @type {boolean}
1070
+ * @memberof LiveActivityAction
1071
+ */
1072
+ dismiss_after_action?: boolean;
1067
1073
  /**
1068
1074
  * Webhook HTTP method. Used only when type=webhook.
1069
1075
  * @type {LiveActivityWebhookMethod}
@@ -1180,13 +1186,13 @@ export interface LiveActivityEndRequest {
1180
1186
  */
1181
1187
  action?: LiveActivityAction;
1182
1188
  /**
1183
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1189
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1184
1190
  * @type {LiveActivityAction}
1185
1191
  * @memberof LiveActivityEndRequest
1186
1192
  */
1187
1193
  secondary_action?: LiveActivityAction;
1188
1194
  /**
1189
- * Optional sound for the end. Ends are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1195
+ * Optional sound for the end. Ends are silent unless you set one. iOS plays the sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1190
1196
  * @type {string}
1191
1197
  * @memberof LiveActivityEndRequest
1192
1198
  */
@@ -1335,7 +1341,7 @@ export interface LiveActivityStartRequest {
1335
1341
  */
1336
1342
  action?: LiveActivityAction;
1337
1343
  /**
1338
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1344
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1339
1345
  * @type {LiveActivityAction}
1340
1346
  * @memberof LiveActivityStartRequest
1341
1347
  */
@@ -1364,6 +1370,12 @@ export interface LiveActivityStartRequest {
1364
1370
  * @memberof LiveActivityStartRequest
1365
1371
  */
1366
1372
  sound?: string;
1373
+ /**
1374
+ * Optional order when several Live Activities run at once, from 0 to 100. iOS shows the Live Activity with the highest score in the Dynamic Island and first on the Lock Screen. It changes only the order, never delivery. Omit it to use the iOS default order. Later updates keep this score unless they send a new one.
1375
+ * @type {number}
1376
+ * @memberof LiveActivityStartRequest
1377
+ */
1378
+ relevance_score?: number;
1367
1379
  }
1368
1380
  /**
1369
1381
  * Returned after a Live Activity starts. Save activity_id and use it for all later updates and for the final end call.
@@ -1465,7 +1477,7 @@ export interface LiveActivityStreamDeleteRequest {
1465
1477
  */
1466
1478
  action?: LiveActivityAction;
1467
1479
  /**
1468
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1480
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1469
1481
  * @type {LiveActivityAction}
1470
1482
  * @memberof LiveActivityStreamDeleteRequest
1471
1483
  */
@@ -1477,7 +1489,7 @@ export interface LiveActivityStreamDeleteRequest {
1477
1489
  */
1478
1490
  alert?: AlertPayload;
1479
1491
  /**
1480
- * Optional sound for the end. Ends are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1492
+ * Optional sound for the end. Ends are silent unless you set one. iOS plays the sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1481
1493
  * @type {string}
1482
1494
  * @memberof LiveActivityStreamDeleteRequest
1483
1495
  */
@@ -1716,7 +1728,7 @@ export interface LiveActivityStreamRequest {
1716
1728
  */
1717
1729
  action?: LiveActivityAction;
1718
1730
  /**
1719
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1731
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1720
1732
  * @type {LiveActivityAction}
1721
1733
  * @memberof LiveActivityStreamRequest
1722
1734
  */
@@ -1746,11 +1758,17 @@ export interface LiveActivityStreamRequest {
1746
1758
  */
1747
1759
  tags?: Array<string>;
1748
1760
  /**
1749
- * Optional sound for this call. A call that starts a Live Activity plays the Live Activities sound picked on the device unless you set one. Updates are silent unless you set one. A sound on an update also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1761
+ * Optional sound for this call. A call that starts a Live Activity plays the Live Activities sound picked on the device unless you set one. Updates are silent unless you set one. iOS plays an update sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1750
1762
  * @type {string}
1751
1763
  * @memberof LiveActivityStreamRequest
1752
1764
  */
1753
1765
  sound?: string;
1766
+ /**
1767
+ * Optional order when several Live Activities run at once, from 0 to 100. iOS shows the Live Activity with the highest score in the Dynamic Island and first on the Lock Screen. It changes only the order, never delivery. Omit it to keep the stream's current score; a stream without one uses the iOS default order. The score carries over when the stream starts a new Live Activity.
1768
+ * @type {number}
1769
+ * @memberof LiveActivityStreamRequest
1770
+ */
1771
+ relevance_score?: number;
1754
1772
  }
1755
1773
  /**
1756
1774
  * Update an existing Live Activity by activity_id.
@@ -1791,17 +1809,23 @@ export interface LiveActivityUpdateRequest {
1791
1809
  */
1792
1810
  action?: LiveActivityAction;
1793
1811
  /**
1794
- * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action.
1812
+ * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url and webhook shapes as action, including app URL schemes and dismiss_after_action.
1795
1813
  * @type {LiveActivityAction}
1796
1814
  * @memberof LiveActivityUpdateRequest
1797
1815
  */
1798
1816
  secondary_action?: LiveActivityAction;
1799
1817
  /**
1800
- * Optional sound for this update. Updates are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1818
+ * Optional sound for this update. Updates are silent unless you set one. iOS plays the sound only while the screen is on. Sounds bundled with the ActivitySmith app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
1801
1819
  * @type {string}
1802
1820
  * @memberof LiveActivityUpdateRequest
1803
1821
  */
1804
1822
  sound?: string;
1823
+ /**
1824
+ * Optional new order for this Live Activity, from 0 to 100. Higher scores show first in the Dynamic Island and on the Lock Screen. Omit it to keep the current score.
1825
+ * @type {number}
1826
+ * @memberof LiveActivityUpdateRequest
1827
+ */
1828
+ relevance_score?: number;
1805
1829
  }
1806
1830
  /**
1807
1831
  * Returned after a Live Activity update is sent or queued.
@@ -2287,7 +2311,7 @@ export interface PushNotificationReplaceRequest {
2287
2311
  */
2288
2312
  title: string;
2289
2313
  /**
2290
- *
2314
+ * Optional message body. Apple limits a notification to 4 KB, so a longer message is shortened on the device. Notification history keeps up to 16 KB.
2291
2315
  * @type {string}
2292
2316
  * @memberof PushNotificationReplaceRequest
2293
2317
  */
@@ -2323,7 +2347,7 @@ export interface PushNotificationReplaceRequest {
2323
2347
  */
2324
2348
  actions?: Array<PushNotificationAction>;
2325
2349
  /**
2326
- *
2350
+ * Optional custom JSON delivered with the notification. It counts toward Apple's 4 KB limit. Use `metadata` for details that only need to appear in the app.
2327
2351
  * @type {object}
2328
2352
  * @memberof PushNotificationReplaceRequest
2329
2353
  */
@@ -2412,7 +2436,7 @@ export interface PushNotificationRequest {
2412
2436
  */
2413
2437
  title: string;
2414
2438
  /**
2415
- *
2439
+ * Optional message body. Apple limits a notification to 4 KB, so a longer message is shortened on the device. Notification history keeps up to 16 KB.
2416
2440
  * @type {string}
2417
2441
  * @memberof PushNotificationRequest
2418
2442
  */
@@ -2454,7 +2478,7 @@ export interface PushNotificationRequest {
2454
2478
  */
2455
2479
  actions?: Array<PushNotificationAction>;
2456
2480
  /**
2457
- *
2481
+ * Optional custom JSON delivered with the notification. It counts toward Apple's 4 KB limit. Use `metadata` for details that only need to appear in the app.
2458
2482
  * @type {object}
2459
2483
  * @memberof PushNotificationRequest
2460
2484
  */
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActivitySmith = exports.DevicesResource = exports.MetricsResource = exports.LiveActivitiesResource = exports.NotificationsResource = void 0;
4
4
  const index_1 = require("../generated/index");
5
- const SDK_VERSION = "1.16.0";
5
+ const SDK_VERSION = "1.18.0";
6
6
  const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
7
7
  const DEFAULT_SDK_NAME = "node";
8
8
  const SDK_HEADER_VALUE = `${DEFAULT_SDK_NAME}-v${SDK_VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "Official ActivitySmith Node.js SDK",
5
5
  "keywords": [
6
6
  "activitysmith",