@aarwitz/tapp 0.24.1 → 0.24.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tapp",
3
3
  "description": "Give Claude hands and eyes on iOS, Android, and web apps, with exploration, replayable flows, evidence, and deterministic CI gates.",
4
- "version": "0.24.1",
4
+ "version": "0.24.2",
5
5
  "author": {
6
6
  "name": "Aaron Horowitz",
7
7
  "url": "https://github.com/aarwitz"
@@ -24,7 +24,7 @@
24
24
  "command": "npx",
25
25
  "args": [
26
26
  "-y",
27
- "@aarwitz/tapp@0.24.1",
27
+ "@aarwitz/tapp@0.24.2",
28
28
  "mcp"
29
29
  ],
30
30
  "cwd": "${CLAUDE_PROJECT_DIR}"
@@ -259,6 +259,16 @@ function markPromptStarted(structured) {
259
259
  } catch { /* listing is a convenience; the capture is the evidence */ }
260
260
  }
261
261
 
262
+ // How a journey gets inside. A journey either types the credentials (it has a `login` step, so it
263
+ // was kept from a run that met the sign-in form and must start signed OUT) or it resumes the
264
+ // actor's saved session (no `login` step: the run it came from already began inside). Doing both
265
+ // breaks the first kind — the browser starts inside and the journey's own first step, waiting for
266
+ // the sign-in screen, never matches.
267
+ export function journeySignInPlan(flow = {}) {
268
+ const signsIn = (flow.steps || []).some((step) => step && typeof step === "object" && "login" in step);
269
+ return { signsIn, usesSession: !!flow.actor && !signsIn };
270
+ }
271
+
262
272
  // Replay one web journey and record how it went. Shared by the Studio's Run button and the
263
273
  // daily check, so both leave the same status and the same evidence behind.
264
274
  async function replayJourney({ store, slug, flow, actorRoot = "", ownerKey = null, progress = () => {} }) {
@@ -266,13 +276,24 @@ async function replayJourney({ store, slug, flow, actorRoot = "", ownerKey = nul
266
276
  // values come from the encrypted actor store at replay and never from the file.
267
277
  const variables = {};
268
278
  let storageStatePath = "";
269
- if (flow.url && (flow.actor || (flow.steps || []).some((step) => step && typeof step === "object" && "login" in step))) {
279
+ // A journey signs in one of two ways, and they are mutually exclusive:
280
+ // it has a `login` step → it was kept from a run that met the sign-in form, so it must START
281
+ // SIGNED OUT and type the credentials. Handing it a saved session
282
+ // would drop it inside the app, where its own first step ("wait for
283
+ // the sign-in screen") can never match.
284
+ // it has no `login` step → it was kept from a run that already began inside, so the saved
285
+ // session is the only way back in.
286
+ const { signsIn, usesSession } = journeySignInPlan(flow);
287
+ if (flow.url && (flow.actor || signsIn)) {
270
288
  const actors = new ActorStore(actorRoot ? { root: actorRoot } : {});
271
289
  const record = actors.read(flow.url, flow.actor || "default");
272
290
  if (record?.credentials?.email) variables.TEST_EMAIL = record.credentials.email;
273
291
  if (record?.credentials?.password) variables.TEST_PASSWORD = record.credentials.password;
274
- // A journey that began inside replays from the actor's saved session, like the run did.
275
- if (flow.actor) storageStatePath = actors.sessionFile(flow.url, flow.actor) || "";
292
+ if (usesSession) {
293
+ storageStatePath = actors.sessionFile(flow.url, flow.actor) || "";
294
+ // Say why plainly, rather than letting every step time out looking for a signed-in screen.
295
+ if (!storageStatePath) throw new Error(`This journey starts already signed in, but tapp no longer has a session for '${flow.actor}' on this site. Explore it again and sign in, and the journey will work from the new session.`);
296
+ }
276
297
  }
277
298
  const captureId = `flow-web-${Date.now().toString(36)}-${crypto.randomBytes(4).toString("hex")}`;
278
299
  const evidenceDir = path.join(captureRoot(), captureId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarwitz/tapp",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
4
4
  "mcpName": "io.github.aarwitz/tapp",
5
5
  "description": "Let coding agents verify UI changes on real iOS, Android, and web surfaces, then enforce reviewed proof in deterministic CI.",
6
6
  "license": "MIT",