@supersuit/session-player 0.6.0 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0 (2026-10-11)
4
+
5
+ - A recast spec may state `device` (`iphone` or `macbook`) when the source could not tell where the real session ran. A Remote Control or SDK session reads the same from a Mac and a phone, so the converter leaves `device` unset and Auto drew an iPhone for a session that really ran on a MacBook (Callum's case study). The spec wins over the source; without it the source's device is kept, as before.
6
+ - `@supersuit/session-player/playback` exports `summarize` and `duration`, so a host page can print the measured who-did-what beside the player without importing the converter.
7
+
3
8
  ## 0.6.0 (2026-10-11)
4
9
 
5
10
  - **Transparent by default** (Gary, 2026-10-11: "render with NO background colour ... so it sits on any site"). Nothing is painted outside the device frame; the frame and the screen keep their own backgrounds. A host that wants one passes `background` (prop or tag attribute) or `?bg=` on the embed URL: any CSS colour, or `theme` for the player's cream. A value that is not a colour is ignored.
package/README.md CHANGED
@@ -60,7 +60,7 @@ simulator serve album.json # watch it at http://127.0.0.1:4460/
60
60
  | `artifacts[]` | `{ id, kind: file \| link \| other, title, path \| url, turn, at }` |
61
61
  | `cuts[]` | `{ turn, what, reason }`: every edit, so nothing is changed silently |
62
62
 
63
- `device` (optional) is where the real session ran: `iphone` or `macbook`. The converter sets `macbook` when the person typed into a terminal (or the desktop app) on a Mac, and leaves it out when it cannot tell (Remote Control and SDK sessions); a scenario without it is shown as an iPhone.
63
+ `device` (optional) is where the real session ran: `iphone` or `macbook`. The converter sets `macbook` when the person typed into a terminal (or the desktop app) on a Mac, and leaves it out when it cannot tell (Remote Control and SDK sessions); a scenario without it is shown as an iPhone. Because unset can mean either, whoever ran the session should state it: `convert --device`, or `device` in a recast spec (0.7.0), which overrides the source.
64
64
 
65
65
  `intervention` is one of `null`, `redirect`, `correct`, `approve`, `decide`. The converter sets only `redirect`; the rest are set by the person reviewing the draft.
66
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersuit/session-player",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Plays recorded agent sessions (case studies) on a simulated phone or MacBook: a scenario format, a converter from Claude Code transcripts, and a React player anyone can step into.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,8 @@
12
12
  "./player": "./src/player.mjs",
13
13
  "./embed": "./src/embed.mjs",
14
14
  "./package.json": "./package.json",
15
- "./loader.js": "./src/loader.js"
15
+ "./loader.js": "./src/loader.js",
16
+ "./playback": "./src/playback.mjs"
16
17
  },
17
18
  "files": [
18
19
  "bin/",
package/src/recast.mjs CHANGED
@@ -27,8 +27,14 @@ const where = (sc, obj) => sc.turns.find((t) => t.human === obj || t.steps.some(
27
27
 
28
28
  import { allImages } from './scenario.mjs';
29
29
 
30
- export function recast(source, { id, title, persona, keep, replace = [], forbid = [], images = {}, close, highlight = {} }) {
30
+ export function recast(source, { id, title, persona, keep, replace = [], forbid = [], images = {}, close, highlight = {}, device }) {
31
31
  const sc = structuredClone(source);
32
+ // Where the real session ran, when the source could not say (0.7.0): a Remote Control or SDK
33
+ // session reads the same from a Mac and from a phone, so the person who ran it states it here.
34
+ if (device != null) {
35
+ if (!['iphone', 'macbook'].includes(device)) throw new Error(`device must be iphone or macbook, got ${JSON.stringify(device)}`);
36
+ sc.device = device;
37
+ }
32
38
  const cuts = [];
33
39
  if (keep) {
34
40
  const kept = new Set(keep);