waygraph 0.15.45 → 0.15.46

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.
@@ -188,7 +188,7 @@ export async function showPilotFixtures(page, fixtures) {
188
188
  };
189
189
  w.__wgPilotFxZoomOutOnHide = zoomOut;
190
190
  const clearFx = () => {
191
- __wgQA(".wg-pilot-fx-ring, .wg-pilot-fx-label").forEach((el) => el.remove());
191
+ __wgQA('[id^="wg-fx-ring-"]').forEach((el) => el.remove());
192
192
  __wgById("wg-pilot-fx-todos")?.remove();
193
193
  clearFocus();
194
194
  if (w.__wgPilotFxZoomOutOnHide !== false || clearAll)
@@ -205,59 +205,34 @@ export async function showPilotFixtures(page, fixtures) {
205
205
  const missing = [];
206
206
  let painted = 0;
207
207
  let focusBox = null;
208
- for (const ring of rings) {
208
+ // Paint through the SAME shared ring primitive the demo/auto singleton ring uses
209
+ // (window.__wgPaintRingAt, installed by runner/inpage/core.js's installCore - see
210
+ // ensureInstalled) - one ring implementation, not a separate DOM-building copy here.
211
+ rings.forEach((ring, i) => {
209
212
  const el = document.querySelector(ring.selector);
210
213
  if (!el) {
211
214
  missing.push(ring.selector);
212
- continue;
215
+ return;
213
216
  }
214
217
  const rect = el.getBoundingClientRect();
215
218
  if (rect.width === 0 && rect.height === 0) {
216
219
  missing.push(ring.selector);
217
- continue;
218
- }
219
- const pad = ring.size === "sm" ? 3 : ring.size === "lg" ? 10 : 6;
220
- const ringEl = document.createElement("div");
221
- ringEl.className = "wg-pilot-fx-ring";
222
- ringEl.dataset.tone = ring.tone;
223
- ringEl.dataset.size = ring.size;
224
- ringEl.style.left = `${rect.left - pad}px`;
225
- ringEl.style.top = `${rect.top - pad}px`;
226
- ringEl.style.width = `${Math.max(4, rect.width + pad * 2)}px`;
227
- ringEl.style.height = `${Math.max(4, rect.height + pad * 2)}px`;
228
- ringEl.style.opacity = "1";
229
- const labelEl = document.createElement("div");
230
- labelEl.className = "wg-pilot-fx-label";
231
- labelEl.dataset.tone = ring.tone;
232
- labelEl.dataset.size = ring.size;
233
- labelEl.dataset.weight = ring.weight;
234
- labelEl.textContent = ring.label;
235
- labelEl.style.opacity = "1";
236
- if (ring.color) {
237
- labelEl.style.color = ring.color;
220
+ return;
238
221
  }
239
- __wgAdd(ringEl);
240
- __wgAdd(labelEl);
241
- const lw = labelEl.offsetWidth;
242
- const lh = labelEl.offsetHeight;
243
- let labelLeft = rect.left - pad;
244
- let labelTop = rect.top - pad + rect.height + pad * 2 + 8;
245
- if (labelTop + lh > window.innerHeight - 6)
246
- labelTop = rect.top - pad - lh - 8;
247
- if (labelTop < 6)
248
- labelTop = 6;
249
- if (labelLeft + lw > window.innerWidth - 6) {
250
- labelLeft = Math.max(6, window.innerWidth - 6 - lw);
222
+ const box = { x: rect.left, y: rect.top, width: rect.width, height: rect.height };
223
+ const ringId = `wg-fx-ring-${i}`;
224
+ const labelId = `wg-fx-ring-${i}-label`;
225
+ if (window.__wgPaintRingAt) {
226
+ window.__wgPaintRingAt(ringId, labelId, box, ring.label, ring.tone, {
227
+ size: ring.size,
228
+ weight: ring.weight,
229
+ color: ring.color,
230
+ });
251
231
  }
252
- if (labelLeft < 6)
253
- labelLeft = 6;
254
- labelEl.style.left = `${labelLeft}px`;
255
- labelEl.style.top = `${labelTop}px`;
256
232
  painted += 1;
257
- if (ring.focus) {
258
- focusBox = { x: rect.left, y: rect.top, width: rect.width, height: rect.height };
259
- }
260
- }
233
+ if (ring.focus)
234
+ focusBox = box;
235
+ });
261
236
  // Real TodoDockState groups (same shape/builder the demo runner uses) - a group's own
262
237
  // style (sequential/checklist/bullets) and its own done/current flags drive rendering here,
263
238
  // not a re-derived index over a flattened string list.
@@ -324,7 +299,7 @@ export async function showPilotFixtures(page, fixtures) {
324
299
  }
325
300
  // Collision flip: if a painted ring intersects the dock, flip side once.
326
301
  if (dockEl && todoUi.collision !== false && painted > 0) {
327
- const firstRing = __wgQ(".wg-pilot-fx-ring");
302
+ const firstRing = __wgQ('[id^="wg-fx-ring-"]:not([id$="-label"])');
328
303
  if (firstRing) {
329
304
  const rr = firstRing.getBoundingClientRect();
330
305
  const dr = dockEl.getBoundingClientRect();
@@ -62,7 +62,8 @@ const OVERLAY_CSS = `
62
62
  opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s;
63
63
  }
64
64
  #wg-pilot-activity.wg-pilot-toast-show { opacity: 1; transform: translateY(0); }
65
- /* Agent fixture rings (.wg-pilot-fx-ring/label), #wg-pilot-fx-todos, #wg-ring/#wg-ring-label and
65
+ /* Agent fixture rings (painted via the shared .wg-ring-el primitive, see ui/css/ring.css and
66
+ runner/inpage/core.js's __wgPaintRingAt), #wg-pilot-fx-todos, #wg-ring/#wg-ring-label and
66
67
  #wg-banner all come from the ONE shared bundle ensureShadowRoot installs (ui/css/*.css) - not
67
68
  redefined here. */
68
69
  /* Spotlight (demo focus:true) - dim page, cutout around target. */
@@ -149,6 +150,11 @@ export async function installPersistentPilotOverlay(context) {
149
150
  export async function ensureInstalled(page) {
150
151
  await ensureShadowRoot(page);
151
152
  await page.evaluate(installPilotOverlayShell, OVERLAY_CSS).catch(() => { });
153
+ // The shared ring primitive (__wgEnsureRingEl/__wgPaintRingAt) - so Pilot's fixture rings paint
154
+ // through the SAME implementation the demo/auto singleton ring uses (see ui/css/ring.css / this
155
+ // file's own header comment on redundancy), not a separate DOM-building copy.
156
+ const { installCore } = await import("../runner/inpage/core.js");
157
+ await page.evaluate(installCore, {}).catch(() => { });
152
158
  // Device toast/chip CSS (runner/overlay-css.js's RUNNER_EXTRA_CSS) - same rules the demo runner
153
159
  // uses, reused here (not re-authored) so a device fixture looks identical on Pilot.
154
160
  const { RUNNER_EXTRA_CSS } = await import("../runner/overlay-css.js");
@@ -0,0 +1,4 @@
1
+ /** In-page installer (page.evaluate target) - see core.js's own header. Installs the shared ring
2
+ * primitive (__wgEnsureRingEl/__wgPaintRingAt/__wgHideRingAt), cursor, click-pulse, focus veil,
3
+ * and the #wg-ring singleton every surface's "current action" ring uses. */
4
+ export function installCore(args: Record<string, unknown>): void;
@@ -19,65 +19,37 @@ export function installCore({ title, favicon, bannerPos, todoPos, envAutoplay, t
19
19
  } catch {
20
20
  /* private mode / blocked storage - falls back to manual gating */
21
21
  }
22
- if (!__wgById("wg-ring")) {
23
- const ring = document.createElement("div");
24
- ring.id = "wg-ring";
25
- __wgAdd(ring);
26
- }
27
- if (!__wgById("wg-ring-label")) {
28
- const ringLabel = document.createElement("div");
29
- ringLabel.id = "wg-ring-label";
30
- __wgAdd(ringLabel);
31
- }
32
- if (!__wgById("wg-cursor")) {
33
- const cursor = document.createElement("div");
34
- cursor.id = "wg-cursor";
35
- // Dark fill + white stroke, same as help-center-clip-engine's own
36
- // #clip-cursor - visible against any page background, light or
37
- // dark, unlike a plain solid-white shape.
38
- cursor.innerHTML =
39
- "<svg viewBox='0 0 32 32' width='24' height='24'>" +
40
- "<path fill='#0C0C1A' stroke='#fff' stroke-width='1.4' stroke-linejoin='round' " +
41
- "d='M6 3.5l1.4 22.5 5.8-5.4 4.2 9.4 3.6-1.6-4.2-9.2H26z'/></svg>";
42
- __wgAdd(cursor);
43
- }
44
- if (!__wgById("wg-click-pulse")) {
45
- const pulse = document.createElement("div");
46
- pulse.id = "wg-click-pulse";
47
- __wgAdd(pulse);
48
- }
49
- window.__wgMoveCursorTo = (x, y, ms, instant) => {
50
- const cursor = __wgById("wg-cursor");
51
- if (!cursor) return;
52
- cursor.style.setProperty("--wg-cursor-ms", (ms || 600) + "ms");
53
- if (instant) {
54
- const prev = cursor.style.transition;
55
- cursor.style.transition = "none";
56
- cursor.style.transform = "translate(" + x + "px," + y + "px)";
57
- void cursor.offsetWidth;
58
- cursor.style.transition = prev || "";
59
- } else {
60
- cursor.style.transform = "translate(" + x + "px," + y + "px)";
22
+ // The one shared ring primitive (ui/css/ring.css) - #wg-ring/#wg-ring-label is just this
23
+ // surface's OWN ring instance, found by id like any other (see __wgEnsureRingEl below).
24
+ window.__wgEnsureRingEl = (ringId, labelId) => {
25
+ let ring = __wgById(ringId);
26
+ if (!ring) {
27
+ ring = document.createElement("div");
28
+ ring.id = ringId;
29
+ ring.className = "wg-ring-el";
30
+ __wgAdd(ring);
61
31
  }
62
- cursor.style.opacity = "1";
63
- };
64
- window.__wgHideCursor = () => {
65
- const cursor = __wgById("wg-cursor");
66
- if (cursor) cursor.style.opacity = "0";
32
+ let label = __wgById(labelId);
33
+ if (!label) {
34
+ label = document.createElement("div");
35
+ label.id = labelId;
36
+ label.className = "wg-ring-el-label";
37
+ __wgAdd(label);
38
+ }
39
+ return [ring, label];
67
40
  };
68
- window.__wgPositionRing = (box, label, tone, style) => {
69
- const ring = __wgById("wg-ring");
70
- const ringLabel = __wgById("wg-ring-label");
71
- if (!ring || !ringLabel || !box) return;
41
+ /** Bare positioning only - no collision/follow/focus-veil (those are #wg-ring's own extras, see __wgPositionRing). */
42
+ window.__wgPaintRingAt = (ringId, labelId, box, label, tone, style) => {
43
+ const [ring, ringLabel] = window.__wgEnsureRingEl(ringId, labelId);
44
+ if (!box) return null;
72
45
  const raw = (tone || "planned") + "";
73
46
  const t =
74
- raw === "auto" || raw === "info" || raw === "warning" || raw === "danger" || raw === "success"
47
+ raw === "auto" || raw === "info" || raw === "warning" || raw === "danger" || raw === "success" || raw === "orange"
75
48
  ? raw
76
49
  : "planned";
77
50
  const st = style && typeof style === "object" ? style : {};
78
51
  const sizeRaw = (st.size || "md") + "";
79
- const size =
80
- sizeRaw === "sm" || sizeRaw === "lg" ? sizeRaw : "md";
52
+ const size = sizeRaw === "sm" || sizeRaw === "lg" ? sizeRaw : "md";
81
53
  const weightRaw = (st.weight || "normal") + "";
82
54
  const weight = weightRaw === "bold" ? "bold" : "normal";
83
55
  ring.dataset.tone = t;
@@ -85,12 +57,12 @@ export function installCore({ title, favicon, bannerPos, todoPos, envAutoplay, t
85
57
  ring.dataset.size = size;
86
58
  ringLabel.dataset.size = size;
87
59
  ringLabel.dataset.weight = weight;
60
+ if (st.color) ringLabel.style.color = st.color;
61
+ else ringLabel.style.removeProperty("color");
88
62
  const pad = size === "sm" ? 3 : size === "lg" ? 10 : 6;
89
63
  const margin = 6;
90
64
  const vw = window.innerWidth;
91
65
  const vh = window.innerHeight;
92
- // Pin ring EXACTLY to the element - never clamp the ring away from
93
- // the target (that looked "strapped on" the viewport).
94
66
  const left = box.x - pad;
95
67
  const top = box.y - pad;
96
68
  const width = Math.max(4, box.width + pad * 2);
@@ -112,6 +84,57 @@ export function installCore({ title, favicon, bannerPos, todoPos, envAutoplay, t
112
84
  if (labelLeft < margin) labelLeft = margin;
113
85
  ringLabel.style.left = labelLeft + "px";
114
86
  ringLabel.style.top = labelTop + "px";
87
+ return [ring, ringLabel];
88
+ };
89
+ window.__wgHideRingAt = (ringId, labelId) => {
90
+ const ring = __wgById(ringId);
91
+ const label = __wgById(labelId);
92
+ if (ring) ring.style.opacity = "0";
93
+ if (label) label.style.opacity = "0";
94
+ };
95
+ window.__wgEnsureRingEl("wg-ring", "wg-ring-label");
96
+ if (!__wgById("wg-cursor")) {
97
+ const cursor = document.createElement("div");
98
+ cursor.id = "wg-cursor";
99
+ // Dark fill + white stroke, same as help-center-clip-engine's own
100
+ // #clip-cursor - visible against any page background, light or
101
+ // dark, unlike a plain solid-white shape.
102
+ cursor.innerHTML =
103
+ "<svg viewBox='0 0 32 32' width='24' height='24'>" +
104
+ "<path fill='#0C0C1A' stroke='#fff' stroke-width='1.4' stroke-linejoin='round' " +
105
+ "d='M6 3.5l1.4 22.5 5.8-5.4 4.2 9.4 3.6-1.6-4.2-9.2H26z'/></svg>";
106
+ __wgAdd(cursor);
107
+ }
108
+ if (!__wgById("wg-click-pulse")) {
109
+ const pulse = document.createElement("div");
110
+ pulse.id = "wg-click-pulse";
111
+ __wgAdd(pulse);
112
+ }
113
+ window.__wgMoveCursorTo = (x, y, ms, instant) => {
114
+ const cursor = __wgById("wg-cursor");
115
+ if (!cursor) return;
116
+ cursor.style.setProperty("--wg-cursor-ms", (ms || 600) + "ms");
117
+ if (instant) {
118
+ const prev = cursor.style.transition;
119
+ cursor.style.transition = "none";
120
+ cursor.style.transform = "translate(" + x + "px," + y + "px)";
121
+ void cursor.offsetWidth;
122
+ cursor.style.transition = prev || "";
123
+ } else {
124
+ cursor.style.transform = "translate(" + x + "px," + y + "px)";
125
+ }
126
+ cursor.style.opacity = "1";
127
+ };
128
+ window.__wgHideCursor = () => {
129
+ const cursor = __wgById("wg-cursor");
130
+ if (cursor) cursor.style.opacity = "0";
131
+ };
132
+ // #wg-ring's own extras on top of the shared __wgPaintRingAt primitive: todo/banner
133
+ // collision avoidance only makes sense for the ONE "current action" ring, not Pilot's
134
+ // several independent fixture rings - kept here, not pushed down into the shared painter.
135
+ window.__wgPositionRing = (box, label, tone, style) => {
136
+ if (!box) return;
137
+ window.__wgPaintRingAt("wg-ring", "wg-ring-label", box, label, tone, style);
115
138
  if (window.__wgTodosSetBehind) window.__wgTodosSetBehind(true);
116
139
  if (window.__wgTodosAvoidRingCollision) window.__wgTodosAvoidRingCollision(box);
117
140
  if (window.__wgBannerAvoidRing) window.__wgBannerAvoidRing(box);
@@ -363,6 +363,55 @@ export async function cycleHighlightRings(page, highlights, gatesFast, opts) {
363
363
  }
364
364
 
365
365
 
366
+ /**
367
+ * Paint a NAMED ring instance (ui/css/ring.css's shared `.wg-ring-el`/`.wg-ring-el-label`) at a
368
+ * known viewport box - the primitive both the demo/auto singleton (`showRing`, always "wg-ring")
369
+ * and Pilot's several simultaneous fixture rings (their own ids) paint through, so there is one
370
+ * ring-rendering implementation, not two. No collision/follow/focus - those are `#wg-ring`'s own
371
+ * extras (see `showRing`/`inpage/core.js`'s `__wgPositionRing`), meaningless for an independent
372
+ * fixture ring that isn't "the current action."
373
+ */
374
+ export async function showRingAt(page, ringId, labelId, box, label, tone, style) {
375
+ const size = normalizeHighlightSize(style && style.size);
376
+ const weight = normalizeHighlightWeight(style && style.weight);
377
+ const color = style && style.color ? String(style.color) : "";
378
+ await page
379
+ .evaluate(
380
+ ({ ringId, labelId, box, label, tone, size, weight, color }) => {
381
+ if (window.__wgPaintRingAt) {
382
+ window.__wgPaintRingAt(ringId, labelId, box, label, tone, { size, weight, color });
383
+ }
384
+ },
385
+ { ringId, labelId, box, label, tone: tone || "planned", size, weight, color },
386
+ )
387
+ .catch(() => {});
388
+ }
389
+
390
+ /** Hide (not remove) a named ring instance painted via {@link showRingAt}. */
391
+ export async function hideRingAt(page, ringId, labelId) {
392
+ await page
393
+ .evaluate(
394
+ ({ ringId, labelId }) => {
395
+ if (window.__wgHideRingAt) window.__wgHideRingAt(ringId, labelId);
396
+ },
397
+ { ringId, labelId },
398
+ )
399
+ .catch(() => {});
400
+ }
401
+
402
+ /** Remove a named ring instance entirely (Pilot's fixture rings are short-lived, not reused). */
403
+ export async function removeRingAt(page, ringId, labelId) {
404
+ await page
405
+ .evaluate(
406
+ ({ ringId, labelId }) => {
407
+ __wgById(ringId)?.remove();
408
+ __wgById(labelId)?.remove();
409
+ },
410
+ { ringId, labelId },
411
+ )
412
+ .catch(() => {});
413
+ }
414
+
366
415
  export async function showRing(page, box, label, tone, style) {
367
416
  const size = normalizeHighlightSize(style && style.size);
368
417
  const weight = normalizeHighlightWeight(style && style.weight);
@@ -1,4 +1,2 @@
1
1
  /** The highlight ring + its label (`#wg-ring`, `#wg-ring-label`): tone / size / weight variants. */
2
2
  export declare function ringCss(): string;
3
- /** Agent-sent pilot fixture rings/labels (`.wg-pilot-fx-ring|label`), same tones as the demo ring. */
4
- export declare function pilotFxRingCss(): string;
@@ -28,22 +28,7 @@ export function ringCss() {
28
28
  "#wg-ring-label[data-weight=bold]{font-weight:800;}" +
29
29
  "#wg-ring-label[data-weight=normal]{font-weight:600;}");
30
30
  }
31
- /** Agent-sent pilot fixture rings/labels (`.wg-pilot-fx-ring|label`), same tones as the demo ring. */
32
- export function pilotFxRingCss() {
33
- const p = TONES.planned;
34
- return (".wg-pilot-fx-ring{position:fixed;z-index:2147483645;pointer-events:none;opacity:0;" +
35
- `border:3px solid ${p.ring};border-radius:10px;box-sizing:border-box;` +
36
- "transition:opacity .12s ease,left .12s,top .12s,width .12s,height .12s;}" +
37
- toneRules(".wg-pilot-fx-ring", (t) => `border-color:${t.ring};box-shadow:0 0 0 4px ${t.glow};`) +
38
- ".wg-pilot-fx-label{position:fixed;z-index:2147483645;pointer-events:none;opacity:0;" +
39
- "font:600 12px/1.3 ui-sans-serif,system-ui,sans-serif;padding:5px 9px;border-radius:6px;" +
40
- "max-width:min(360px,80vw);box-shadow:0 2px 8px rgba(0,0,0,.25);white-space:nowrap;" +
41
- "overflow:hidden;text-overflow:ellipsis;transition:opacity .12s ease;}" +
42
- toneRules(".wg-pilot-fx-label", (t) => `background:${t.labelBg};color:${t.labelFg};`) +
43
- `.wg-pilot-fx-label[data-tone=auto]::before{${ROBOT}}` +
44
- ".wg-pilot-fx-ring[data-size=sm]{border-width:1.5px;border-radius:8px;}" +
45
- ".wg-pilot-fx-ring[data-size=lg]{border-width:4px;border-radius:12px;}" +
46
- ".wg-pilot-fx-label[data-size=sm]{font-size:10px;padding:4px 7px;}" +
47
- ".wg-pilot-fx-label[data-size=lg]{font-size:16px;padding:8px 14px;}" +
48
- ".wg-pilot-fx-label[data-weight=bold]{font-weight:800;}");
49
- }
31
+ // A former `pilotFxRingCss()` used to live here, generating a SECOND, byte-identical copy of
32
+ // ringCss()'s own rules under `.wg-pilot-fx-ring`/`.wg-pilot-fx-label`. Pilot's fixture rings now
33
+ // paint through the same shared primitive (`ui/css/ring.css`'s `.wg-ring-el`, `runner/inpage/core.js`'s
34
+ // `__wgPaintRingAt`) as the demo/auto singleton ring - see src/ui/css/ring.css's own header.
@@ -50,81 +50,55 @@
50
50
  }
51
51
 
52
52
 
53
- /* The highlight ring + its label (#wg-ring, #wg-ring-label). Tone comes from data-tone, resolved
54
- * against the tokens in tokens.css - add a tone there, it works here with no new rule. */
55
- #wg-ring {
56
- position: fixed; z-index: var(--wg-z-ring); pointer-events: none; opacity: 0;
53
+ /*
54
+ * ONE ring implementation, shared by every surface (demo/auto's singleton #wg-ring, and Pilot's
55
+ * multiple simultaneous fixture rings) - `.wg-ring-el`/`.wg-ring-el-label` is the real class every
56
+ * ring element carries; `#wg-ring`/`#wg-ring-label` and Pilot's per-instance ids are just how each
57
+ * surface finds/targets ITS OWN ring(s) in JS (runner/inpage/core.js's __wgEnsureRingEl/
58
+ * __wgPaintRingAt). Before this file existed as one, the demo/auto ring and Pilot's fixture ring
59
+ * were two byte-identical copies of the same tone/size/weight rules - a real, provable case of the
60
+ * "why do we have two of everything" complaint that's easy to lose track of once it's spread across
61
+ * two selector families in one file. Tone comes from data-tone, resolved against tokens.css - add a
62
+ * tone there, it works here with no new rule.
63
+ */
64
+ .wg-ring-el {
65
+ position: fixed; z-index: var(--wg-z-ring); pointer-events: none; opacity: 0; box-sizing: border-box;
57
66
  border: 2.5px solid var(--wg-tone-planned-ring, #7C3AED); border-radius: var(--wg-radius-md);
58
67
  box-shadow: 0 0 0 4px var(--wg-tone-planned-glow, rgba(124,58,237,.16));
59
68
  /* Opacity fade only - NEVER transition border-color/box-shadow: tone swaps must snap instantly. */
60
- transition: opacity .3s ease;
69
+ transition: opacity .3s ease, left .12s, top .12s, width .12s, height .12s;
61
70
  }
62
- #wg-ring[data-tone] { border-color: var(--wg-tone-ring); box-shadow: 0 0 0 4px var(--wg-tone-glow); }
63
- #wg-ring[data-tone=planned] { --wg-tone-ring: var(--wg-tone-planned-ring); --wg-tone-glow: var(--wg-tone-planned-glow); }
64
- #wg-ring[data-tone=auto] { --wg-tone-ring: var(--wg-tone-auto-ring); --wg-tone-glow: var(--wg-tone-auto-glow); }
65
- #wg-ring[data-tone=info] { --wg-tone-ring: var(--wg-tone-info-ring); --wg-tone-glow: var(--wg-tone-info-glow); }
66
- #wg-ring[data-tone=warning] { --wg-tone-ring: var(--wg-tone-warning-ring); --wg-tone-glow: var(--wg-tone-warning-glow); }
67
- #wg-ring[data-tone=danger] { --wg-tone-ring: var(--wg-tone-danger-ring); --wg-tone-glow: var(--wg-tone-danger-glow); }
68
- #wg-ring[data-tone=success] { --wg-tone-ring: var(--wg-tone-success-ring); --wg-tone-glow: var(--wg-tone-success-glow); }
69
- #wg-ring[data-tone=orange] { --wg-tone-ring: var(--wg-tone-orange-ring); --wg-tone-glow: var(--wg-tone-orange-glow); }
70
- #wg-ring[data-size=sm] { border-width: 1.5px; border-radius: var(--wg-radius-sm); }
71
- #wg-ring[data-size=lg] { border-width: 4px; border-radius: var(--wg-radius-lg); }
72
-
73
- #wg-ring-label {
71
+ .wg-ring-el[data-tone] { border-color: var(--wg-tone-ring); box-shadow: 0 0 0 4px var(--wg-tone-glow); }
72
+ .wg-ring-el[data-tone=planned] { --wg-tone-ring: var(--wg-tone-planned-ring); --wg-tone-glow: var(--wg-tone-planned-glow); }
73
+ .wg-ring-el[data-tone=auto] { --wg-tone-ring: var(--wg-tone-auto-ring); --wg-tone-glow: var(--wg-tone-auto-glow); }
74
+ .wg-ring-el[data-tone=info] { --wg-tone-ring: var(--wg-tone-info-ring); --wg-tone-glow: var(--wg-tone-info-glow); }
75
+ .wg-ring-el[data-tone=warning] { --wg-tone-ring: var(--wg-tone-warning-ring); --wg-tone-glow: var(--wg-tone-warning-glow); }
76
+ .wg-ring-el[data-tone=danger] { --wg-tone-ring: var(--wg-tone-danger-ring); --wg-tone-glow: var(--wg-tone-danger-glow); }
77
+ .wg-ring-el[data-tone=success] { --wg-tone-ring: var(--wg-tone-success-ring); --wg-tone-glow: var(--wg-tone-success-glow); }
78
+ .wg-ring-el[data-tone=orange] { --wg-tone-ring: var(--wg-tone-orange-ring); --wg-tone-glow: var(--wg-tone-orange-glow); }
79
+ .wg-ring-el[data-size=sm] { border-width: 1.5px; border-radius: var(--wg-radius-sm); }
80
+ .wg-ring-el[data-size=lg] { border-width: 4px; border-radius: var(--wg-radius-lg); }
81
+
82
+ .wg-ring-el-label {
74
83
  position: fixed; z-index: var(--wg-z-ring); pointer-events: none; opacity: 0;
75
84
  max-width: min(360px, 70vw); white-space: normal; padding: 6px 10px; border-radius: 7px;
76
85
  background: var(--wg-tone-bg, var(--wg-tone-planned-bg)); color: var(--wg-tone-fg, var(--wg-tone-planned-fg));
77
86
  font: 600 12px/1.35 var(--wg-font); transition: opacity .3s ease;
87
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25);
78
88
  }
79
- #wg-ring-label[data-tone=planned] { --wg-tone-bg: var(--wg-tone-planned-bg); --wg-tone-fg: var(--wg-tone-planned-fg); }
80
- #wg-ring-label[data-tone=auto] { --wg-tone-bg: var(--wg-tone-auto-bg); --wg-tone-fg: var(--wg-tone-auto-fg); }
81
- #wg-ring-label[data-tone=info] { --wg-tone-bg: var(--wg-tone-info-bg); --wg-tone-fg: var(--wg-tone-info-fg); }
82
- #wg-ring-label[data-tone=warning] { --wg-tone-bg: var(--wg-tone-warning-bg); --wg-tone-fg: var(--wg-tone-warning-fg); }
83
- #wg-ring-label[data-tone=danger] { --wg-tone-bg: var(--wg-tone-danger-bg); --wg-tone-fg: var(--wg-tone-danger-fg); }
84
- #wg-ring-label[data-tone=success] { --wg-tone-bg: var(--wg-tone-success-bg); --wg-tone-fg: var(--wg-tone-success-fg); }
85
- #wg-ring-label[data-tone=orange] { --wg-tone-bg: var(--wg-tone-orange-bg); --wg-tone-fg: var(--wg-tone-orange-fg); }
89
+ .wg-ring-el-label[data-tone=planned] { --wg-tone-bg: var(--wg-tone-planned-bg); --wg-tone-fg: var(--wg-tone-planned-fg); }
90
+ .wg-ring-el-label[data-tone=auto] { --wg-tone-bg: var(--wg-tone-auto-bg); --wg-tone-fg: var(--wg-tone-auto-fg); }
91
+ .wg-ring-el-label[data-tone=info] { --wg-tone-bg: var(--wg-tone-info-bg); --wg-tone-fg: var(--wg-tone-info-fg); }
92
+ .wg-ring-el-label[data-tone=warning] { --wg-tone-bg: var(--wg-tone-warning-bg); --wg-tone-fg: var(--wg-tone-warning-fg); }
93
+ .wg-ring-el-label[data-tone=danger] { --wg-tone-bg: var(--wg-tone-danger-bg); --wg-tone-fg: var(--wg-tone-danger-fg); }
94
+ .wg-ring-el-label[data-tone=success] { --wg-tone-bg: var(--wg-tone-success-bg); --wg-tone-fg: var(--wg-tone-success-fg); }
95
+ .wg-ring-el-label[data-tone=orange] { --wg-tone-bg: var(--wg-tone-orange-bg); --wg-tone-fg: var(--wg-tone-orange-fg); }
86
96
  /* Gray (auto) = a real Playwright-driven instruction - mark it, a human/AI watching can't "see" DOM state otherwise. */
87
- #wg-ring-label[data-tone=auto]::before { content: "\1F916\00a0"; }
88
- #wg-ring-label[data-size=sm] { font-size: 10px; line-height: 1.25; padding: 4px 7px; border-radius: 5px; }
89
- #wg-ring-label[data-size=lg] { font-size: 16px; line-height: 1.35; padding: 8px 14px; border-radius: 9px; max-width: min(480px, 85vw); }
90
- #wg-ring-label[data-weight=bold] { font-weight: 800; }
91
- #wg-ring-label[data-weight=normal] { font-weight: 600; }
92
-
93
- /* Agent-sent pilot fixture rings/labels (.wg-pilot-fx-ring|label) - identical tone language as #wg-ring. */
94
- .wg-pilot-fx-ring {
95
- position: fixed; z-index: var(--wg-z-fx); pointer-events: none; opacity: 0; box-sizing: border-box;
96
- border: 3px solid var(--wg-tone-planned-ring); border-radius: var(--wg-radius-md);
97
- transition: opacity .12s ease, left .12s, top .12s, width .12s, height .12s;
98
- }
99
- .wg-pilot-fx-ring[data-tone] { border-color: var(--wg-tone-ring); box-shadow: 0 0 0 4px var(--wg-tone-glow); }
100
- .wg-pilot-fx-ring[data-tone=planned] { --wg-tone-ring: var(--wg-tone-planned-ring); --wg-tone-glow: var(--wg-tone-planned-glow); }
101
- .wg-pilot-fx-ring[data-tone=auto] { --wg-tone-ring: var(--wg-tone-auto-ring); --wg-tone-glow: var(--wg-tone-auto-glow); }
102
- .wg-pilot-fx-ring[data-tone=info] { --wg-tone-ring: var(--wg-tone-info-ring); --wg-tone-glow: var(--wg-tone-info-glow); }
103
- .wg-pilot-fx-ring[data-tone=warning] { --wg-tone-ring: var(--wg-tone-warning-ring); --wg-tone-glow: var(--wg-tone-warning-glow); }
104
- .wg-pilot-fx-ring[data-tone=danger] { --wg-tone-ring: var(--wg-tone-danger-ring); --wg-tone-glow: var(--wg-tone-danger-glow); }
105
- .wg-pilot-fx-ring[data-tone=success] { --wg-tone-ring: var(--wg-tone-success-ring); --wg-tone-glow: var(--wg-tone-success-glow); }
106
- .wg-pilot-fx-ring[data-tone=orange] { --wg-tone-ring: var(--wg-tone-orange-ring); --wg-tone-glow: var(--wg-tone-orange-glow); }
107
- .wg-pilot-fx-ring[data-size=sm] { border-width: 1.5px; border-radius: var(--wg-radius-sm); }
108
- .wg-pilot-fx-ring[data-size=lg] { border-width: 4px; border-radius: var(--wg-radius-lg); }
109
-
110
- .wg-pilot-fx-label {
111
- position: fixed; z-index: var(--wg-z-fx); pointer-events: none; opacity: 0;
112
- font: 600 12px/1.3 var(--wg-font); padding: 5px 9px; border-radius: 6px;
113
- max-width: min(360px, 80vw); box-shadow: 0 2px 8px rgba(0,0,0,.25); white-space: nowrap;
114
- overflow: hidden; text-overflow: ellipsis; transition: opacity .12s ease;
115
- background: var(--wg-tone-bg, var(--wg-tone-planned-bg)); color: var(--wg-tone-fg, var(--wg-tone-planned-fg));
116
- }
117
- .wg-pilot-fx-label[data-tone=planned] { --wg-tone-bg: var(--wg-tone-planned-bg); --wg-tone-fg: var(--wg-tone-planned-fg); }
118
- .wg-pilot-fx-label[data-tone=auto] { --wg-tone-bg: var(--wg-tone-auto-bg); --wg-tone-fg: var(--wg-tone-auto-fg); }
119
- .wg-pilot-fx-label[data-tone=info] { --wg-tone-bg: var(--wg-tone-info-bg); --wg-tone-fg: var(--wg-tone-info-fg); }
120
- .wg-pilot-fx-label[data-tone=warning] { --wg-tone-bg: var(--wg-tone-warning-bg); --wg-tone-fg: var(--wg-tone-warning-fg); }
121
- .wg-pilot-fx-label[data-tone=danger] { --wg-tone-bg: var(--wg-tone-danger-bg); --wg-tone-fg: var(--wg-tone-danger-fg); }
122
- .wg-pilot-fx-label[data-tone=success] { --wg-tone-bg: var(--wg-tone-success-bg); --wg-tone-fg: var(--wg-tone-success-fg); }
123
- .wg-pilot-fx-label[data-tone=orange] { --wg-tone-bg: var(--wg-tone-orange-bg); --wg-tone-fg: var(--wg-tone-orange-fg); }
124
- .wg-pilot-fx-label[data-tone=auto]::before { content: "\1F916\00a0"; }
125
- .wg-pilot-fx-label[data-size=sm] { font-size: 10px; padding: 4px 7px; }
126
- .wg-pilot-fx-label[data-size=lg] { font-size: 16px; padding: 8px 14px; }
127
- .wg-pilot-fx-label[data-weight=bold] { font-weight: 800; }
97
+ .wg-ring-el-label[data-tone=auto]::before { content: "\1F916\00a0"; }
98
+ .wg-ring-el-label[data-size=sm] { font-size: 10px; line-height: 1.25; padding: 4px 7px; border-radius: 5px; }
99
+ .wg-ring-el-label[data-size=lg] { font-size: 16px; line-height: 1.35; padding: 8px 14px; border-radius: 9px; max-width: min(480px, 85vw); }
100
+ .wg-ring-el-label[data-weight=bold] { font-weight: 800; }
101
+ .wg-ring-el-label[data-weight=normal] { font-weight: 600; }
128
102
 
129
103
 
130
104
  /* Travelling mouse cursor + click ripple (#wg-cursor, #wg-click-pulse). */
File without changes
@@ -0,0 +1,5 @@
1
+ [13:33:09.962] waygraph pilot: highlight ctx.todos n=3 index=0
2
+ [13:33:09.963] waygraph pilot: highlight ring #user-name tone=planned label="Username"
3
+ [13:33:09.963] waygraph pilot: highlight ring #password tone=info label="Password"
4
+ [13:33:16.194] waygraph pilot: highlight ring #no-such-element-waygraph tone=danger label="Gone"
5
+ [13:33:19.571] waygraph pilot: highlight ring #login-button tone=success label="Login"
File without changes
@@ -0,0 +1,6 @@
1
+ [13:33:49.001] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:33:49.001] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:33:49.001] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:33:49.001] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:33:49.001] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:33:50.662] waygraph pilot: stub.after ctx.todos n=6 index=1
@@ -0,0 +1,22 @@
1
+ [13:30:37.236] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:30:37.237] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:30:37.237] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:30:37.237] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:30:37.237] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:30:38.230] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [13:30:40.736] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [13:30:40.806] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [13:30:43.109] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [13:30:43.277] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [13:30:43.277] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [13:30:43.277] waygraph pilot: stub.after ctx.device(mobile)
13
+ [13:30:43.277] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [13:30:49.079] waygraph pilot: stub.before ctx.title("Pick a product · tablet")
15
+ [13:30:49.079] waygraph pilot: stub.before ctx.todos n=6 index=3
16
+ [13:30:49.079] waygraph pilot: stub.before ctx.device(tablet)
17
+ [13:30:49.079] waygraph pilot: stub.before ctx.zoom(1.35)
18
+ [13:30:49.079] waygraph pilot: stub.before ring div.inventory_item:has(button[data-test="add-to-cart-sauce-labs-backpack"], button[data-test="remove-sauce-labs-backpack"]) .inventory_item_name tone=info label="Sauce Labs Backpack"
19
+ [13:30:49.079] waygraph pilot: stub.before ring [data-test="add-to-cart-sauce-labs-backpack"] tone=success label="Add to cart"
20
+ [13:30:50.084] waygraph pilot: stub.after ctx.title("In the cart")
21
+ [13:30:50.084] waygraph pilot: stub.after ctx.todos n=6 index=4
22
+ [13:30:50.084] waygraph pilot: stub.after ring .shopping_cart_badge tone=success label="Cart badge"
File without changes
@@ -0,0 +1,20 @@
1
+ [13:33:33.648] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:33:33.648] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:33:33.648] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:33:33.648] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:33:33.648] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:33:35.319] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [13:33:37.648] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [13:33:37.918] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [13:33:40.322] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [13:33:40.631] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [13:33:40.631] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [13:33:40.635] waygraph pilot: stub.after ctx.device(mobile)
13
+ [13:33:40.635] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [13:33:45.020] waygraph pilot: stub.before ctx.title("Open cart · landscape")
15
+ [13:33:45.023] waygraph pilot: stub.before ctx.todos n=6 index=5
16
+ [13:33:45.023] waygraph pilot: stub.before ctx.device(mobile)
17
+ [13:33:45.023] waygraph pilot: stub.before ctx.zoom(1.4)
18
+ [13:33:45.023] waygraph pilot: stub.before ring .shopping_cart_link tone=planned label="Cart"
19
+ [13:33:45.685] waygraph pilot: stub.after ctx.title("Your cart · desktop")
20
+ [13:33:45.685] waygraph pilot: stub.after ring .cart_item tone=success label="Cart items"
@@ -0,0 +1,5 @@
1
+ [13:30:29.135] waygraph pilot: highlight ctx.todos n=3 index=0
2
+ [13:30:29.135] waygraph pilot: highlight ring #user-name tone=planned label="Username"
3
+ [13:30:29.135] waygraph pilot: highlight ring #password tone=info label="Password"
4
+ [13:30:31.729] waygraph pilot: highlight ring #no-such-element-waygraph tone=danger label="Gone"
5
+ [13:30:34.364] waygraph pilot: highlight ring #login-button tone=success label="Login"
File without changes
@@ -0,0 +1,2 @@
1
+ [13:28:46.645] waygraph pilot: highlight ring #user-name tone=info label="Username"
2
+ [13:28:46.645] waygraph pilot: highlight ring #password tone=planned label="Password"
File without changes
@@ -0,0 +1,22 @@
1
+ [13:33:41.969] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:33:41.970] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:33:41.970] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:33:41.970] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:33:41.971] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:33:43.496] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [13:33:47.539] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [13:33:47.674] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [13:33:51.047] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [13:33:51.434] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [13:33:51.434] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [13:33:51.434] waygraph pilot: stub.after ctx.device(mobile)
13
+ [13:33:51.434] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [13:33:58.614] waygraph pilot: stub.before ctx.title("Pick a product · tablet")
15
+ [13:33:58.614] waygraph pilot: stub.before ctx.todos n=6 index=3
16
+ [13:33:58.614] waygraph pilot: stub.before ctx.device(tablet)
17
+ [13:33:58.614] waygraph pilot: stub.before ctx.zoom(1.35)
18
+ [13:33:58.614] waygraph pilot: stub.before ring div.inventory_item:has(button[data-test="add-to-cart-sauce-labs-backpack"], button[data-test="remove-sauce-labs-backpack"]) .inventory_item_name tone=info label="Sauce Labs Backpack"
19
+ [13:33:58.614] waygraph pilot: stub.before ring [data-test="add-to-cart-sauce-labs-backpack"] tone=success label="Add to cart"
20
+ [13:34:00.150] waygraph pilot: stub.after ctx.title("In the cart")
21
+ [13:34:00.158] waygraph pilot: stub.after ctx.todos n=6 index=4
22
+ [13:34:00.158] waygraph pilot: stub.after ring .shopping_cart_badge tone=success label="Cart badge"
@@ -0,0 +1,20 @@
1
+ [13:30:39.074] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:30:39.075] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:30:39.076] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:30:39.077] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:30:39.077] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:30:40.400] waygraph pilot: stub.after ctx.todos n=6 index=1
7
+ [13:30:41.700] waygraph pilot: stub.before ring #password tone=planned label="Password"
8
+ [13:30:41.847] waygraph pilot: stub.after ctx.todos n=6 index=2
9
+ [13:30:43.065] waygraph pilot: stub.before ring #login-button tone=warning label="Login"
10
+ [13:30:43.238] waygraph pilot: stub.after ctx.title("Inventory · landscape")
11
+ [13:30:43.238] waygraph pilot: stub.after ctx.todos n=6 index=3
12
+ [13:30:43.238] waygraph pilot: stub.after ctx.device(mobile)
13
+ [13:30:43.238] waygraph pilot: stub.after ring .inventory_list tone=success label="Product shelf"
14
+ [13:30:47.003] waygraph pilot: stub.before ctx.title("Open cart · landscape")
15
+ [13:30:47.003] waygraph pilot: stub.before ctx.todos n=6 index=5
16
+ [13:30:47.003] waygraph pilot: stub.before ctx.device(mobile)
17
+ [13:30:47.003] waygraph pilot: stub.before ctx.zoom(1.4)
18
+ [13:30:47.003] waygraph pilot: stub.before ring .shopping_cart_link tone=planned label="Cart"
19
+ [13:30:47.239] waygraph pilot: stub.after ctx.title("Your cart · desktop")
20
+ [13:30:47.239] waygraph pilot: stub.after ring .cart_item tone=success label="Cart items"
@@ -0,0 +1,5 @@
1
+ [13:32:46.154] waygraph pilot: highlight ctx.todos n=3 index=0
2
+ [13:32:46.154] waygraph pilot: highlight ring #user-name tone=planned label="Username"
3
+ [13:32:46.155] waygraph pilot: highlight ring #password tone=info label="Password"
4
+ [13:32:48.514] waygraph pilot: highlight ring #no-such-element-waygraph tone=danger label="Gone"
5
+ [13:32:49.667] waygraph pilot: highlight ring #login-button tone=success label="Login"
File without changes
@@ -0,0 +1,6 @@
1
+ [13:31:17.677] waygraph pilot: stub.before ctx.title("Signing in · mobile")
2
+ [13:31:17.678] waygraph pilot: stub.before ctx.todos n=6 index=0
3
+ [13:31:17.678] waygraph pilot: stub.before ctx.device(mobile)
4
+ [13:31:17.678] waygraph pilot: stub.before ctx.zoom(1.35)
5
+ [13:31:17.678] waygraph pilot: stub.before ring #user-name tone=info label="Username"
6
+ [13:31:18.813] waygraph pilot: stub.after ctx.todos n=6 index=1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.15.45",
3
+ "version": "0.15.46",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",