tapline-host 1.1.0 → 1.3.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/dist/tools.d.ts CHANGED
@@ -178,6 +178,21 @@ export declare const toolShapes: {
178
178
  readonly name: z.ZodString;
179
179
  readonly update: z.ZodOptional<z.ZodBoolean>;
180
180
  readonly width: z.ZodOptional<z.ZodNumber>;
181
+ readonly threshold: z.ZodOptional<z.ZodNumber>;
182
+ readonly ignore: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
183
+ x: z.ZodNumber;
184
+ y: z.ZodNumber;
185
+ width: z.ZodNumber;
186
+ height: z.ZodNumber;
187
+ }, z.core.$strict>, z.ZodObject<{
188
+ ref: z.ZodOptional<z.ZodString>;
189
+ id: z.ZodOptional<z.ZodString>;
190
+ label: z.ZodOptional<z.ZodString>;
191
+ text: z.ZodOptional<z.ZodString>;
192
+ index: z.ZodOptional<z.ZodNumber>;
193
+ x: z.ZodOptional<z.ZodNumber>;
194
+ y: z.ZodOptional<z.ZodNumber>;
195
+ }, z.core.$strict>]>>>;
181
196
  };
182
197
  readonly filmstrip: {
183
198
  readonly frames: z.ZodOptional<z.ZodNumber>;
@@ -224,10 +239,33 @@ export declare const toolShapes: {
224
239
  };
225
240
  readonly logs: {
226
241
  readonly since: z.ZodOptional<z.ZodNumber>;
242
+ readonly level: z.ZodOptional<z.ZodEnum<{
243
+ error: "error";
244
+ warning: "warning";
245
+ info: "info";
246
+ }>>;
247
+ readonly grep: z.ZodOptional<z.ZodString>;
248
+ readonly limit: z.ZodOptional<z.ZodNumber>;
249
+ };
250
+ readonly crash: {
251
+ readonly all: z.ZodOptional<z.ZodBoolean>;
227
252
  };
228
253
  readonly reload: {
229
254
  readonly look: z.ZodOptional<z.ZodBoolean>;
230
255
  };
256
+ readonly performance: {
257
+ readonly launch: z.ZodOptional<z.ZodBoolean>;
258
+ readonly seconds: z.ZodOptional<z.ZodNumber>;
259
+ readonly tap: z.ZodOptional<z.ZodObject<{
260
+ ref: z.ZodOptional<z.ZodString>;
261
+ id: z.ZodOptional<z.ZodString>;
262
+ label: z.ZodOptional<z.ZodString>;
263
+ text: z.ZodOptional<z.ZodString>;
264
+ index: z.ZodOptional<z.ZodNumber>;
265
+ x: z.ZodOptional<z.ZodNumber>;
266
+ y: z.ZodOptional<z.ZodNumber>;
267
+ }, z.core.$strict>>;
268
+ };
231
269
  readonly wait: {
232
270
  readonly seconds: z.ZodNumber;
233
271
  readonly screenshot: z.ZodOptional<z.ZodBoolean>;
@@ -241,7 +279,11 @@ export declare const toolShapes: {
241
279
  label: z.ZodOptional<z.ZodString>;
242
280
  gone: z.ZodOptional<z.ZodBoolean>;
243
281
  value: z.ZodOptional<z.ZodString>;
282
+ matches: z.ZodOptional<z.ZodString>;
283
+ threshold: z.ZodOptional<z.ZodNumber>;
284
+ ignore: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
244
285
  timeout: z.ZodOptional<z.ZodNumber>;
286
+ under: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
245
287
  }, z.core.$strip>>;
246
288
  }, z.core.$loose>>;
247
289
  readonly trace: z.ZodOptional<z.ZodBoolean>;
@@ -360,11 +402,40 @@ export declare class TaplineTools {
360
402
  private personNotePending;
361
403
  private recording;
362
404
  private replaying;
405
+ /**
406
+ * While a script replays (AGENT-TOOLS 1.9 §14.3): the references folder next to it (looked in first), where a
407
+ * failed check puts its red picture, and whether the checks save instead of compare (`--update-references`).
408
+ */
409
+ private replayContext;
410
+ /** Where the latest failed check of the running batch saved its picture. */
411
+ private diffSaved;
412
+ /** What the last `performance` call measured, for the `under` limits of a `run` step. */
413
+ private lastPerf;
414
+ /** The elements the latest comparison painted its ignore list from: a recording saves its mask from the same list. */
415
+ private lastMaskElements;
363
416
  /** The screen size in points from the latest list or overlay, for the live viewer's 0..1 positions. */
364
417
  private lastScreen;
365
418
  private shotCount;
366
419
  private pairWrites;
420
+ /** Per app (by identity): crash events up to this one have been told to the agent. */
421
+ private readonly notedCrashSeqs;
422
+ /** Crash events up to this one happened before this agent's session: an app with no entry above starts here. */
423
+ private readonly crashBaseline;
424
+ /** Set inside a tool call (and everything it awaits), so a call within a call (`run`'s steps) adds no notes. */
425
+ private readonly noteScope;
367
426
  constructor(host: TaplineHost, options: ToolsOptions);
427
+ /**
428
+ * Runs a tool call and ends its answer with a note when the app stopped (AGENT-TOOLS 15.2): during this
429
+ * call, or earlier, with its time, once. Calls inside a call (`run`'s steps) add nothing of their own.
430
+ */
431
+ private noting;
432
+ /** What was told about this app's crashes so far: the crash events up to this number. */
433
+ private notedSeqOf;
434
+ /**
435
+ * The notes for the app this call used (the one at its start, the one at its end, or, with none connected, the
436
+ * one that dropped last). Other apps' events stay pending until that app is the one being driven.
437
+ */
438
+ private withCrashNotes;
368
439
  /** A person used the app: the next answer says so once, and `{ref}` targets are stale until the next full list. */
369
440
  private markPersonUsedApp;
370
441
  private notConnected;
@@ -381,6 +452,15 @@ export declare class TaplineTools {
381
452
  openApp(args: Shape<"open_app">): CallToolResult;
382
453
  look(args?: Shape<"look">): Promise<CallToolResult>;
383
454
  run(args: Shape<"run">): Promise<CallToolResult>;
455
+ /** The newest log time of a session (or of the app's current session), undefined without lines. */
456
+ private newestLogTs;
457
+ /**
458
+ * A session's buffered lines, also when it has ended. When the same app on the same phone came back as a new
459
+ * session, that session's lines follow. Another app's lines never stand in for it (Codex review of 1.3.0).
460
+ */
461
+ private sessionLogs;
462
+ /** AGENT-TOOLS §15.4: `Logs (since step <n>):` and up to 20 lines at warning or above since the step began. */
463
+ private failureLogs;
384
464
  /** `run` with dry_run (§11.4): the steps are checked already; step 1 is resolved, nothing is touched. */
385
465
  private dryRunBatch;
386
466
  /** One step of `run`, as its own tool call without a list. */
@@ -389,6 +469,7 @@ export declare class TaplineTools {
389
469
  private currentRoute;
390
470
  /** Null when the expectation holds within its time; else how it failed. */
391
471
  private expectMissed;
472
+ private textExpectMissed;
392
473
  inspect(args: Shape<"inspect">): Promise<CallToolResult>;
393
474
  audit(args?: Shape<"audit">): Promise<CallToolResult>;
394
475
  checkLayout(_args?: Shape<"check_layout">): Promise<CallToolResult>;
@@ -430,12 +511,52 @@ export declare class TaplineTools {
430
511
  private takeShot;
431
512
  /** Adds an image to a result: inline, or saved with its path in file mode. */
432
513
  private deliver;
514
+ /** Where this app's reference pictures are kept, or an error answer. */
515
+ private referenceFolder;
516
+ /** The element list for naming regions and masking, read as a peek: the agent's refs and baseline must stay as they are. */
517
+ private peekElements;
518
+ /**
519
+ * Takes the screen and compares it with the saved reference called `name`, never saving. `referencesDirs` are the
520
+ * folders to look in, in order. A missing reference hands back the screenshot, so the caller may save it.
521
+ */
522
+ private checkAgainstReference;
523
+ /** Why a check does not hold (for `run`, as a step or as `matches`), or null when it matches. */
524
+ private referenceReason;
525
+ /** Whether the screen matches the reference `name` now (`expect.matches`): null when it does, else the reason. */
526
+ private matchMissed;
527
+ /** Where a check looks for `<name>.jpg`: the folder next to a replayed script first, then the app's own store. */
528
+ private referencesDirs;
529
+ /** In a replay, a failed check leaves its red picture at `<script>.diff/<name>.jpg`. */
530
+ private keepDiff;
531
+ /** Takes the screen and saves it as the reference `name` in `dir`. */
532
+ private saveReferenceHere;
533
+ private writeReference;
534
+ /** A `compare_screen` step of `run`: it never saves; it holds on a match and stops the batch otherwise. */
535
+ private compareStep;
536
+ /**
537
+ * Saves a visual check that held as a `compareScreen` step of the recording, when one is running: the name, and the
538
+ * threshold, the ignore list (refs made stable) and the width when given. `update` is never written. Answers an
539
+ * error line when an ignore ref can't be kept in a script, else null (also when nothing is recording).
540
+ */
541
+ private recordCompare;
542
+ /**
543
+ * `ignore` as a script keeps it (AGENT-TOOLS 1.9 §14.2): a ref becomes the element's id, else label, else text,
544
+ * read from the list now. A string is the error answer when a ref can't be kept.
545
+ */
546
+ private stableIgnore;
433
547
  compareScreen(args: Shape<"compare_screen">): Promise<CallToolResult>;
548
+ private compareScreenNow;
434
549
  filmstrip(args: Shape<"filmstrip">): Promise<CallToolResult>;
435
550
  private scriptPath;
436
551
  record(args: Shape<"record">): Promise<CallToolResult>;
552
+ /** `<script dir>/<script name>.references` and `.diff` for a script file. */
553
+ private scriptSideFolder;
554
+ /** Copies each reference the steps use from the app's store next to the script; null when there are none. */
555
+ private copyReferences;
437
556
  private scriptList;
438
- replay(args: Shape<"replay">): Promise<CallToolResult>;
557
+ replay(args: Shape<"replay">, options?: {
558
+ updateReferences?: boolean;
559
+ }): Promise<CallToolResult>;
439
560
  private withLook;
440
561
  /**
441
562
  * The element a result carries under `key`, for an answer's first line: without its actions, position or
@@ -486,7 +607,17 @@ export declare class TaplineTools {
486
607
  back(args: Shape<"back">): Promise<CallToolResult>;
487
608
  openUrl(args: Shape<"open_url">): Promise<CallToolResult>;
488
609
  logs(args: Shape<"logs">): Promise<CallToolResult>;
610
+ /** The newest fatal JS error of the app (`all`: the last 5). Reading them tells the agent what the notes did. */
611
+ crash(args?: Shape<"crash">): CallToolResult;
489
612
  reload(args: Shape<"reload">): Promise<CallToolResult>;
613
+ /**
614
+ * `launch`: a JavaScript reload (development builds), timed from the request to the new session's first
615
+ * settled screen. Stops with the answer when the reload can't be made or the app doesn't come back.
616
+ */
617
+ private timedReload;
618
+ /** One measuring window in the app: start, (the tap,) wait out `seconds`, stop. */
619
+ private measureWindow;
620
+ performance(args?: Shape<"performance">): Promise<CallToolResult>;
490
621
  wait(args: Shape<"wait">): Promise<CallToolResult>;
491
622
  }
492
623
  export {};