@homie-rocks/studio 0.58.11 → 0.58.12

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
@@ -17,6 +17,17 @@ To bring a studio up to date, tell Claude: "Upgrade my studio to the newest Homi
17
17
  `npx -y @homie-rocks/studio@latest upgrade`, which shows what's new since the version your studio pins (from this
18
18
  file) and what the upgrade would change, and changes nothing until you agree.
19
19
 
20
+ ## [0.58.12] - 2026-10-20
21
+
22
+ **Plugin 0.58.6**
23
+
24
+ Every browser the toolkit opens can be a cloud browser, and a studio worked on away from the person's screen previews on its own private preview.
25
+
26
+ ### Added
27
+
28
+ - Every command and skill that opens a browser (check, playtest, look, perf, shoot, lab check, port check, crowd load, 3D renders, art captures and video takes) can use a browser in the cloud (in 0.58.11 only check and the playtest script could): with `HOMIE_BROWSER_WS_ENDPOINT` set to a CDP WebSocket address (Cloudflare Browser Run, for example), they connect to it instead of starting Chrome on this computer. A platform target leaves queues and cron triggers to the platform.
29
+ - A host that runs the toolkit away from the person's screen (Homie Managed's studio workspace, a cloud dev box) can name the address of the studio's private preview in `HOMIE_PREVIEW_URL`. For a studio whose studio.json has a preview target (`cloudflare.preview`), the local MCP server's `preview_run` then puts the build there (`deploy --preview`) and gives that address, `check` and `playtest` put the current build there and open it, and `preview_stop` has nothing to stop. Without it, the site runs on this computer as before.
30
+
20
31
  ## [0.58.11] - 2026-10-19
21
32
 
22
33
  **Plugin 0.58.5**
@@ -26,7 +37,7 @@ Host a studio on Workers for Platforms with a private preview, check it with a b
26
37
  ### Added
27
38
 
28
39
  - A studio can deploy to a Workers for Platforms dispatch namespace: `cloudflare.dispatchNamespace`, `worker`, `d1Id` and `domain` in studio.json name the preprovisioned Worker, and `homie-studio deploy` sends the build there with Wrangler's own `--dispatch-namespace`. `cloudflare.preview` names a second Worker and database, and `homie-studio deploy --preview` sends the same build to it. A platform that hosts studios this way (Homie Managed) enforces the target at its API boundary.
29
- - Every command and skill that opens a browser (check, playtest, look, perf, shoot, lab check, port check, crowd load, 3D renders, art captures and video takes) can use a browser in the cloud: with `HOMIE_BROWSER_WS_ENDPOINT` set to a CDP WebSocket address (Cloudflare Browser Run, for example), they connect to it instead of starting Chrome on this computer. A platform target leaves queues and cron triggers to the platform.
40
+ - `homie-studio check` and the playtest script can use a browser in the cloud: with `HOMIE_BROWSER_WS_ENDPOINT` set to a CDP WebSocket address (Cloudflare Browser Run, for example), they connect to it instead of starting Chrome on this computer.
30
41
  - `homie-studio drain on|off|status` pauses new room admissions without deploying or closing existing sockets. A move waits for empty rooms and delivered records before freezing the source.
31
42
  - Managed media bindings preserve streamed media, range requests and large player saves.
32
43
  - A read-only switch for a studio: `homie-studio read-only on|off|status` (and the local MCP tool `studio_read_only`) freezes the live studio for a few minutes, for a move to another host or maintenance, without losing anything. It sets the Worker secret `STUDIO_READ_ONLY` with the studio's own Cloudflare sign-in, as a new Worker version. While on, changes answer 503 with `Retry-After` and `x-studio-read-only: 1`; pages, games, live rooms and the Stripe webhook keep working, D1 takes no other write, room records wait in each room, scheduled and queued work waits, and `/api/games` reports `readOnly`.
package/lib/mcp-tools.mjs CHANGED
@@ -32,6 +32,7 @@ import { newStudio, slugify } from './scaffold.mjs';
32
32
  import { repoFromUrl, studioRepo } from './repo.mjs';
33
33
  import { GAME_ID, PACKAGE_ROOT, findStudio, isRulesGame, listExperiences as listGames, readLocal, readStudio, siteUrl } from './studio.mjs';
34
34
  import { runningDev } from './dev.mjs';
35
+ import { dispatchTarget } from './dispatch-target.mjs';
35
36
  import { deployWords } from './deploy-state.mjs';
36
37
  import { partsForListing, publishBefore, publishesSoFar } from './directory.mjs';
37
38
  import { STUDIO_VERSION } from './version.mjs';
@@ -443,7 +444,7 @@ async function startRun(ctx, root, { kind, game, title, steps }) {
443
444
  const run = { kind, title, state: 'running', ...(await feedForRun(ctx, root, { id: game ?? null, title })), jobs: [] };
444
445
  ctx.runs.set(run.build, run);
445
446
  const next = (i) => {
446
- if (i >= steps.length) { run.state = 'passed'; endRun(root, run, 'passed', `${title}: done.`); if (kind !== 'deploy') ctx.note(root).checked = true; return; }
447
+ if (i >= steps.length) { run.state = 'passed'; endRun(root, run, 'passed', `${title}: done.`); if (kind === 'check' || kind === 'playtest') ctx.note(root).checked = true; return; }
447
448
  const step = steps[i];
448
449
  const job = cliJob(root, step.label, step.args, {
449
450
  onEnd: (j) => {
@@ -459,7 +460,30 @@ async function startRun(ctx, root, { kind, game, title, steps }) {
459
460
  return buildCard(ctx, root, feedFor(root, run.build));
460
461
  }
461
462
 
463
+ /**
464
+ * WHERE "HERE" IS, FOR A HOST AWAY FROM THE PERSON'S SCREEN. A platform that runs this toolkit for the person in a
465
+ * workspace of its own (Homie Managed's studio workspace, a cloud dev box) has no browser beside it that can open
466
+ * this computer's addresses. It names the address its studio's private preview is reachable at, HOMIE_PREVIEW_URL,
467
+ * and the studio's studio.json names that preview's Workers for Platforms target (cloudflare.preview). Then the
468
+ * studio's site "here" is that preview: preview_run puts the build there (deploy --preview), and check and playtest
469
+ * open it after doing the same. Without both, nothing changes: the site runs on this computer.
470
+ */
471
+ export function hostedPreview(root, env = process.env) {
472
+ const raw = String(env.HOMIE_PREVIEW_URL ?? '').trim();
473
+ if (!raw) return null;
474
+ let url;
475
+ try { url = new URL(raw); } catch { return null; }
476
+ if (url.protocol !== 'https:' || url.username || url.password || url.search || url.hash) return null;
477
+ try { if (!dispatchTarget(readStudio(root), { preview: true })) return null; } catch { return null; }
478
+ return url.href.replace(/\/+$/, '');
479
+ }
480
+
481
+ /** The step that puts the studio's current build on its hosted preview (a deploy --preview builds first). */
482
+ const PREVIEW_STEP = { label: 'the build on the private preview', args: ['deploy', '--preview'] };
483
+
462
484
  async function devUrl(ctx, root, port) {
485
+ const hosted = hostedPreview(root);
486
+ if (hosted) return hosted;
463
487
  const dev = devOf(root);
464
488
  if (dev) return dev.url;
465
489
  const r = await startDev(ctx, root, port);
@@ -1062,6 +1086,18 @@ export function toolDefs(ctx, avail = {}) {
1062
1086
  run: async (a) => {
1063
1087
  const root = ctx.root(a.studio);
1064
1088
  const need = needsInstall(ctx, root); if (need) return need;
1089
+ const hosted = hostedPreview(root);
1090
+ if (hosted) {
1091
+ const games = listGames(root);
1092
+ const g = a.game ? games.find((x) => x.id === a.game) : games[0];
1093
+ const card = await startRun(ctx, root, { kind: 'preview', game: g?.id ?? null, title: `${readStudio(root).name ?? 'The studio'}: private preview`, steps: [PREVIEW_STEP] });
1094
+ const lines = [
1095
+ `The studio's site runs on its private preview, not on this computer: the build is going there now (the card follows it). When it is done: ${hosted}/${games.length ? '' : ' (the home page: "First game coming soon")'}`,
1096
+ ...games.map((x) => ` ${x.name ?? x.id}: ${hosted}/${x.id}/play`),
1097
+ g ? `The person opens ${hosted}/${g.id}/play on two screens (a computer and a phone): two players, one room. Give them the address; do not open a browser for them.` : 'Give the person the address; do not open a browser for them.',
1098
+ ];
1099
+ return { ...card, content: [{ type: 'text', text: lines.join('\n') }, ...(card.content ?? [])] };
1100
+ }
1065
1101
  let url = devOf(root)?.url ?? null;
1066
1102
  let slow = false;
1067
1103
  if (!url) { const r = await startDev(ctx, root, a.port); if (r.error) return fail(r.error); url = r.url; slow = Boolean(r.slow); }
@@ -1081,6 +1117,8 @@ export function toolDefs(ctx, avail = {}) {
1081
1117
  annotations: { title: 'Stop the site here', ...RW },
1082
1118
  run: async (a) => {
1083
1119
  const root = ctx.root(a.studio);
1120
+ const hosted = hostedPreview(root);
1121
+ if (hosted) return ok(`Nothing runs on this computer to stop: the studio's private preview (${hosted}/) stays as it is until the next build is put there.`, { kind: 'preview', stopped: [], hosted });
1084
1122
  const r = await cli(ctx, root, 'dev --stop', ['dev', '--stop'], { wait: 20_000 });
1085
1123
  // What a server stopped another way left behind is cleaned up and said (lib/dev.mjs).
1086
1124
  const note = r.result?.why && (r.result?.stale || r.result?.stopped?.length) ? ` ${r.result.why[0].toUpperCase()}${r.result.why.slice(1)}.` : '';
@@ -1099,8 +1137,10 @@ export function toolDefs(ctx, avail = {}) {
1099
1137
  const game = a.game ?? (games.length === 1 ? games[0].id : null);
1100
1138
  if (!game) return fail(games.length ? `which game? ${games.map((g) => g.id).join(', ')}` : 'there is no game to check yet');
1101
1139
  const url = a.url ? String(a.url) : await devUrl(ctx, root);
1140
+ const hosted = !a.url && hostedPreview(root);
1102
1141
  return startRun(ctx, root, { kind: 'check', game, title: `${games.find((g) => g.id === game)?.name ?? game}: ${games.find((g) => g.id === game)?.kind === 'app' ? 'multi-screen' : 'two-browser'} check`, steps: [
1103
1142
  ...(games.some((g) => g.id === game && isRulesGame(g)) ? [{ label: 'rules build check', args: ['build', game] }] : []),
1143
+ ...(hosted ? [PREVIEW_STEP] : []),
1104
1144
  { label: 'two-browser check', args: ['check', game, '--url', url, '--shots', join('.checks', game)] },
1105
1145
  ] });
1106
1146
  },
@@ -1117,9 +1157,11 @@ export function toolDefs(ctx, avail = {}) {
1117
1157
  const game = a.game ?? (games.length === 1 ? games[0].id : null);
1118
1158
  if (!game) return fail(games.length ? `which game? ${games.map((g) => g.id).join(', ')}` : 'there is no game to playtest yet');
1119
1159
  const url = a.url ? String(a.url) : await devUrl(ctx, root);
1160
+ const hosted = !a.url && hostedPreview(root);
1120
1161
  const shots = join('.checks', `${game}-look`);
1121
1162
  return startRun(ctx, root, { kind: 'playtest', game, title: `${games.find((g) => g.id === game)?.name ?? game}: playtest`, steps: [
1122
1163
  ...(games.some((g) => g.id === game && isRulesGame(g)) ? [{ label: 'rules build check', args: ['build', game] }] : []),
1164
+ ...(hosted ? [PREVIEW_STEP] : []),
1123
1165
  { label: 'two-browser check', args: ['check', game, '--url', url, '--shots', join('.checks', game)] },
1124
1166
  { label: 'pictures on a computer and a phone', soft: true, args: ['look', `/${game}/`, `/${game}/${games.find((g) => g.id === game)?.kind === 'app' ? 'open' : 'play'}`, '--url', url, '--only', 'computer,phone', '--shots', shots],
1125
1167
  // The first screen of each page first (a whole page is a tall picture): what a person sees on arrival.
@@ -4554,6 +4554,48 @@
4554
4554
  }
4555
4555
  }
4556
4556
  }
4557
+ },
4558
+ "0.58.12": {
4559
+ "files": {
4560
+ "CLAUDE.md": "ddf2b2a0376202f6",
4561
+ "README.md": "684b3cca8001673c",
4562
+ "HANDOFF.md": "29337e2ace95b2e7",
4563
+ "games/README.md": "5ad32fe80c61f117",
4564
+ "music/README.md": "a3dc042dadd39df8",
4565
+ "videos/README.md": "16babc3437d5545b",
4566
+ "posts/README.md": "37841aae476bd540",
4567
+ "site/README.md": "1dbdf22c03a1e505",
4568
+ "site/src/worker.mjs": "6cc5c6131eaf6fd0"
4569
+ },
4570
+ "sections": {
4571
+ "AGENTS.md": {
4572
+ "(intro)": "af7f2f732505d379",
4573
+ "## Version-matched authoring guides": "f6261a0e5801b96b",
4574
+ "## Layout": "f3a280b8c96cd068",
4575
+ "## Apps: one screen, roles and parts": "c10aa0441ea89702",
4576
+ "## Commands (all through the pinned CLI in node_modules)": "c20d90de21cde0c7",
4577
+ "## The site": "0cb8dd9a6f8a0096",
4578
+ "## Making games": "bb715272fd1a615b",
4579
+ "## The Game Codex and progress": "0738ef719cef3a4c",
4580
+ "## Art direction and models": "a48fff7bf0a5f2fc",
4581
+ "## Running live games (the back office)": "51ebf2ab756f6e4d",
4582
+ "## Servers and AI seats": "1ccfd549d2369a60",
4583
+ "## Selling things (the shop)": "0df5a5fe1833c624",
4584
+ "## Continuing a build from the Claude app": "0d68081e924ca419",
4585
+ "## Rules": "b2234d80f6cbe71d",
4586
+ "## Telling Homie": "80b46fdd9e578db8",
4587
+ "## Beta": "9d02638207a26e73"
4588
+ }
4589
+ },
4590
+ "named": {
4591
+ "Homie Arcade": {
4592
+ "sections": {
4593
+ "AGENTS.md": {
4594
+ "## Commands (all through the pinned CLI in node_modules)": "8364e05cebefcba4"
4595
+ }
4596
+ }
4597
+ }
4598
+ }
4557
4599
  }
4558
4600
  }
4559
4601
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homie-rocks/studio",
3
- "version": "0.58.11",
3
+ "version": "0.58.12",
4
4
  "description": "A studio for games, music and video on its own Cloudflare: scaffold, multiplayer starters on the netplay contract, a port toolkit that makes existing single-player web games multiplayer, the site Worker with public rooms (Table/Lobby Durable Objects and D1, all on the free Workers plan, no payment method), a site with the hub's sections (Home, Games, Music, Videos, Rooms, Posts with feeds) in the studio's own look, an epic landing page for every game, big songs and videos in the studio's own R2 once it has storage (uploaded, checked by SHA-256, served at the same addresses), deploy, and the homie.rocks directory.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1,2 +1,2 @@
1
1
  // Generated by lib/build-identity.mjs; identifies the bundled runtime sources.
2
- export const STUDIO_BUILD = Object.freeze({"version":"0.58.11","sha256":"4b6a276c704c1647234dfdbef1628bff5ade43b918653552b493965a2db72f9b"});
2
+ export const STUDIO_BUILD = Object.freeze({"version":"0.58.12","sha256":"c4b8a5e3b41289d47fc410729449c3ba63c921bae04042e8c2c09c15053c11e9"});
@@ -1,2 +1,2 @@
1
1
  /** The @homie-rocks/studio version this Worker code is (package.json's; a test keeps them equal). Cache-busts /_homie/site.js. */
2
- export const STUDIO_VERSION_TAG = '0.58.11';
2
+ export const STUDIO_VERSION_TAG = '0.58.12';