@reticlehq/browser 3.6.0 → 3.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/dist/actions/action-report.d.ts +54 -0
- package/dist/actions/action-report.js +60 -0
- package/dist/actions/actions-dom.d.ts +1 -0
- package/dist/actions/actions-dom.js +12 -0
- package/dist/actions/actions-press.d.ts +1 -0
- package/dist/actions/actions-press.js +25 -1
- package/dist/actions/actions.d.ts +1 -37
- package/dist/actions/actions.js +24 -66
- package/dist/actions/appeared-text.js +3 -0
- package/dist/actions/danger-context.d.ts +2 -0
- package/dist/actions/danger-context.js +28 -2
- package/dist/actions/value-input.d.ts +1 -0
- package/dist/actions/value-input.js +11 -0
- package/dist/commands/commands.js +4 -0
- package/dist/dom/a11y.js +251 -10
- package/dist/dom/addressing/coverage-markers.d.ts +6 -0
- package/dist/dom/addressing/coverage-markers.js +13 -0
- package/dist/dom/dom-ignore.d.ts +2 -0
- package/dist/dom/dom-ignore.js +15 -2
- package/dist/dom/query.d.ts +1 -1
- package/dist/dom/query.js +78 -16
- package/dist/dom/render-page.d.ts +12 -0
- package/dist/dom/render-page.js +135 -0
- package/dist/dom/snapshot.js +55 -7
- package/dist/observers/dom.js +32 -16
- package/dist/observers/field.js +3 -21
- package/dist/observers/network.js +56 -7
- package/dist/observers/perf.js +53 -1
- package/dist/observers/route.js +6 -5
- package/dist/presenter/carousel/carousel.js +2 -7
- package/dist/presenter/carousel/panel-slides.d.ts +2 -4
- package/dist/presenter/carousel/panel-slides.js +17 -15
- package/dist/presenter/chrome/log-memory.d.ts +1 -0
- package/dist/presenter/chrome/presenter-log.d.ts +7 -0
- package/dist/presenter/chrome/presenter-log.js +48 -8
- package/dist/presenter/chrome/presenter-morph.d.ts +1 -0
- package/dist/presenter/chrome/presenter-morph.js +34 -0
- package/dist/presenter/chrome/presenter-report-copy.d.ts +17 -4
- package/dist/presenter/chrome/presenter-report-copy.js +26 -4
- package/dist/presenter/hud-telemetry.js +55 -4
- package/dist/presenter/presenter-account-styles.js +3 -3
- package/dist/presenter/presenter-account.d.ts +27 -5
- package/dist/presenter/presenter-account.js +83 -6
- package/dist/presenter/presenter-agent-link.d.ts +9 -0
- package/dist/presenter/presenter-agent-link.js +62 -0
- package/dist/presenter/presenter-chat-views.d.ts +27 -5
- package/dist/presenter/presenter-chat-views.js +312 -72
- package/dist/presenter/presenter-config.d.ts +2 -0
- package/dist/presenter/presenter-config.js +1 -0
- package/dist/presenter/presenter-controls.d.ts +0 -1
- package/dist/presenter/presenter-controls.js +13 -91
- package/dist/presenter/presenter-design-tokens.js +1 -1
- package/dist/presenter/presenter-frame.d.ts +1 -1
- package/dist/presenter/presenter-frame.js +8 -10
- package/dist/presenter/presenter-harness-row.d.ts +67 -0
- package/dist/presenter/presenter-harness-row.js +209 -0
- package/dist/presenter/presenter-personas.d.ts +35 -0
- package/dist/presenter/presenter-personas.js +95 -0
- package/dist/presenter/presenter-plan.js +25 -24
- package/dist/presenter/presenter-report-styles.js +40 -22
- package/dist/presenter/presenter-report.d.ts +2 -1
- package/dist/presenter/presenter-report.js +83 -17
- package/dist/presenter/presenter-settings-styles.js +8 -4
- package/dist/presenter/presenter-settings.d.ts +7 -6
- package/dist/presenter/presenter-settings.js +75 -34
- package/dist/presenter/presenter-shell-styles.js +12 -3
- package/dist/presenter/presenter-shell.d.ts +10 -4
- package/dist/presenter/presenter-shell.js +31 -23
- package/dist/presenter/presenter-styles.js +0 -2
- package/dist/presenter/presenter-workspace.js +10 -3
- package/dist/presenter/presenter.d.ts +3 -2
- package/dist/presenter/presenter.js +81 -20
- package/dist/registry/declared-platform.js +2 -0
- package/dist/reticle-inject.js +777 -700
- package/dist/reticle.js +36 -2
- package/dist/storage-keys.d.ts +3 -2
- package/dist/storage-keys.js +7 -3
- package/dist/transport/transport.js +5 -3
- package/dist/transport/unreachable-message.d.ts +1 -1
- package/dist/transport/unreachable-message.js +3 -5
- package/package.json +2 -2
- package/dist/presenter/carousel/offer-card.d.ts +0 -21
- package/dist/presenter/carousel/offer-card.js +0 -56
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ActionType, HudCorner, HudVisibility, HumanControlKind, ReticleCommand, PresenterMode, SessionState, isPresenterTone, isSessionState, } from '@reticlehq/core';
|
|
2
2
|
import { refs } from '../dom/addressing/refs.js';
|
|
3
|
-
import {
|
|
3
|
+
import { UNREACHABLE_HEADLINE, unreachableMessage } from '../transport/unreachable-message.js';
|
|
4
4
|
import { actionVerb } from './chrome/presenter-verbs.js';
|
|
5
5
|
import { nativeSetTimeout, nativeClearTimeout, nativeNow } from '../timers/native/native-timers.js';
|
|
6
|
-
import { LOG_KIND, CHIP_LABEL, DATA_RETICLE_LOG, clampLogMax, formatElapsed, humanDuration, appendLogRow, clearLogRows, trimLogRows, } from './chrome/presenter-log.js';
|
|
6
|
+
import { LOG_KIND, CHIP_LABEL, LOG_ACTOR, DATA_RETICLE_LOG, clampLogMax, formatElapsed, humanDuration, appendLogRow, clearLogRows, trimLogRows, } from './chrome/presenter-log.js';
|
|
7
7
|
import { PRESENTER_CSS } from './presenter-styles.js';
|
|
8
8
|
import { HudShell } from './presenter-shell.js';
|
|
9
|
+
import { HARNESS_LOG_ATTR, harnessGateIn } from './presenter-harness-row.js';
|
|
10
|
+
import { platformDetails } from './presenter-account.js';
|
|
9
11
|
import { parseImpactSnapshot } from './chrome/presenter-report-copy.js';
|
|
10
12
|
import { scheduleSyncDockLayout } from './presenter-dock-layout.js';
|
|
11
13
|
import { applyHudPosition, clampHudPosition, hudLayoutBox, resetHudDockPosition, } from './presenter-hud-position.js';
|
|
@@ -15,12 +17,12 @@ import { moveCursor, ringAround, spawnRipple, pace } from './chrome/presenter-ef
|
|
|
15
17
|
import { GlowController } from './presenter-glow.js';
|
|
16
18
|
import { PresenterIcon, PRESENTER_ICON_SIZE, hiIcon } from './icons/presenter-icons.js';
|
|
17
19
|
import { renderTally } from './chrome/presenter-tally.js';
|
|
18
|
-
import { CONTROLS_BANNER_HTML,
|
|
19
|
-
import { statusTheme, blockerHtml, getPresenterSettings, OutputDetail, syncPageBlocker, } from './presenter-settings.js';
|
|
20
|
+
import { CONTROLS_BANNER_HTML, CONTROLS_MARKS_HTML, CONTROLS_FOOT_HTML, CONTROLS_STATUS_HTML, ENDED_FADE_MS, ControlPanel, } from './presenter-controls.js';
|
|
21
|
+
import { statusTheme, blockerHtml, getPresenterSettings, OutputDetail, syncPageBlocker, paintSdkVersion, } from './presenter-settings.js';
|
|
20
22
|
import { Annotator } from '../review/annotator.js';
|
|
21
23
|
import { shouldAutoOpenChat } from './presenter-shell.js';
|
|
22
24
|
import { installHudTelemetry } from './hud-telemetry.js';
|
|
23
|
-
import {
|
|
25
|
+
import { PlanBoard, parsePlanView } from './presenter-plan.js';
|
|
24
26
|
import { claimLog, readRememberedLog, rememberLog, } from './chrome/log-memory.js';
|
|
25
27
|
const COPIED_FLASH_MS = 1600;
|
|
26
28
|
export { GlowPhase } from './presenter-config.js';
|
|
@@ -46,6 +48,7 @@ export class Presenter {
|
|
|
46
48
|
#borderMode;
|
|
47
49
|
#glowCtl;
|
|
48
50
|
#lastActionText = '';
|
|
51
|
+
#lastActor;
|
|
49
52
|
#heartbeatTimer;
|
|
50
53
|
#idleEndMs;
|
|
51
54
|
#sessionId;
|
|
@@ -55,6 +58,9 @@ export class Presenter {
|
|
|
55
58
|
#sessionActive = false;
|
|
56
59
|
#logMax;
|
|
57
60
|
#log;
|
|
61
|
+
#harnessLog;
|
|
62
|
+
#harnessRunId;
|
|
63
|
+
#harnessSteps;
|
|
58
64
|
#plan = new PlanBoard();
|
|
59
65
|
#remembered = [];
|
|
60
66
|
#logBaseMs;
|
|
@@ -100,6 +106,12 @@ export class Presenter {
|
|
|
100
106
|
onSyncNow: () => this.#onControl?.({ kind: HumanControlKind.SYNC }),
|
|
101
107
|
onSignIn: () => this.#onControl?.({ kind: HumanControlKind.SIGNIN }),
|
|
102
108
|
onHarness: (enabled) => this.#onControl?.({ kind: HumanControlKind.HARNESS, text: enabled ? 'on' : 'off' }),
|
|
109
|
+
onHarnessRun: (persona) => this.#onControl?.({
|
|
110
|
+
kind: HumanControlKind.HARNESS_RUN,
|
|
111
|
+
...(persona === undefined ? {} : { text: persona }),
|
|
112
|
+
}),
|
|
113
|
+
onHarnessStop: () => this.#onControl?.({ kind: HumanControlKind.HARNESS_STOP }),
|
|
114
|
+
onHarnessLink: () => this.#onControl?.({ kind: HumanControlKind.HARNESS_LINK }),
|
|
103
115
|
settings: {
|
|
104
116
|
onBeforeOpen: () => {
|
|
105
117
|
if (this.#shell.isCollapsed())
|
|
@@ -111,6 +123,7 @@ export class Presenter {
|
|
|
111
123
|
onHarness: (enabled) => this.#onControl?.({ kind: HumanControlKind.HARNESS, text: enabled ? 'on' : 'off' }),
|
|
112
124
|
},
|
|
113
125
|
});
|
|
126
|
+
this.#shell.setProjectId(options.projectId);
|
|
114
127
|
}
|
|
115
128
|
setControlHandler(handler) {
|
|
116
129
|
this.#onControl = handler;
|
|
@@ -127,6 +140,10 @@ export class Presenter {
|
|
|
127
140
|
refilterFlows() {
|
|
128
141
|
this.#panel.refilterFlows();
|
|
129
142
|
}
|
|
143
|
+
showSdkVersion(version) {
|
|
144
|
+
if (this.#root !== undefined)
|
|
145
|
+
paintSdkVersion(this.#root, version);
|
|
146
|
+
}
|
|
130
147
|
handlePush(command) {
|
|
131
148
|
const a = command.args;
|
|
132
149
|
if (command.name === ReticleCommand.FLOWS)
|
|
@@ -143,8 +160,11 @@ export class Presenter {
|
|
|
143
160
|
const snapshot = parseImpactSnapshot(a['snapshot']);
|
|
144
161
|
if (snapshot !== undefined) {
|
|
145
162
|
this.#shell.report.setSnapshot(snapshot);
|
|
146
|
-
this.#shell.
|
|
147
|
-
this.#shell.paintHarness(snapshot.harnessConfig);
|
|
163
|
+
this.#shell.paintNotices(snapshot.notices);
|
|
164
|
+
this.#shell.paintHarness(snapshot.harnessConfig, harnessGateIn(snapshot.instrumentation, snapshot.harnessConfig));
|
|
165
|
+
this.#shell.paintHarnessDrive(snapshot.harnessDrive);
|
|
166
|
+
this.#paintHarnessRun(snapshot.harnessDrive);
|
|
167
|
+
this.#shell.paintAgent(snapshot.agent);
|
|
148
168
|
this.#shell.paintImpact(snapshot.project.counts.verdicts);
|
|
149
169
|
const owner = true === snapshot.account?.signedIn ? snapshot.account.email : undefined;
|
|
150
170
|
if (claimLog(owner))
|
|
@@ -154,6 +174,7 @@ export class Presenter {
|
|
|
154
174
|
dashboardUrl: snapshot.dashboardUrl,
|
|
155
175
|
verdicts: snapshot.project.counts.verdicts,
|
|
156
176
|
defects: snapshot.project.counts.failed,
|
|
177
|
+
...platformDetails(snapshot.harnessConfig, snapshot.sync),
|
|
157
178
|
});
|
|
158
179
|
}
|
|
159
180
|
return;
|
|
@@ -186,7 +207,7 @@ export class Presenter {
|
|
|
186
207
|
<div data-reticle-glow></div>
|
|
187
208
|
<div data-reticle-cursor></div>
|
|
188
209
|
<div data-reticle-ring></div>
|
|
189
|
-
${HudShell.dockHtml(actStrip,
|
|
210
|
+
${HudShell.dockHtml(actStrip, '', DATA_RETICLE_LOG, CONTROLS_MARKS_HTML, CONTROLS_FOOT_HTML)}`;
|
|
190
211
|
document.body.appendChild(root);
|
|
191
212
|
this.#root = root;
|
|
192
213
|
this.#glow = root.querySelector('[data-reticle-glow]') ?? undefined;
|
|
@@ -200,6 +221,7 @@ export class Presenter {
|
|
|
200
221
|
this.#chatPillTime =
|
|
201
222
|
root.querySelector('[data-reticle-chat-pill-time]') ?? undefined;
|
|
202
223
|
this.#log = root.querySelector(`[${DATA_RETICLE_LOG}]`) ?? undefined;
|
|
224
|
+
this.#harnessLog = root.querySelector(`[${HARNESS_LOG_ATTR}]`) ?? undefined;
|
|
203
225
|
this.#chip = root.querySelector('[data-reticle-chip]') ?? undefined;
|
|
204
226
|
this.#tally = root.querySelector('[data-reticle-tally]') ?? undefined;
|
|
205
227
|
this.#shell.mount(root);
|
|
@@ -215,13 +237,14 @@ export class Presenter {
|
|
|
215
237
|
this.#renderTally();
|
|
216
238
|
}
|
|
217
239
|
#restoreLog() {
|
|
218
|
-
|
|
219
|
-
if (log === undefined || 0 < this.#remembered.length)
|
|
240
|
+
if (this.#log === undefined || 0 < this.#remembered.length)
|
|
220
241
|
return;
|
|
221
242
|
for (const row of readRememberedLog().slice(-this.#logMax)) {
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
243
|
+
for (const log of this.#logsFor(row.actor, true === row.summary)) {
|
|
244
|
+
const handle = appendLogRow(log, row.kind, row.text, row.ts, this.#logMax, row.actor);
|
|
245
|
+
if (row.result !== undefined)
|
|
246
|
+
handle.result(row.result);
|
|
247
|
+
}
|
|
225
248
|
this.#logBaseMs = this.#now() - row.at;
|
|
226
249
|
this.#runLog.push({
|
|
227
250
|
at: row.at,
|
|
@@ -295,6 +318,7 @@ export class Presenter {
|
|
|
295
318
|
this.#sessionActive = false;
|
|
296
319
|
this.#logBaseMs = undefined;
|
|
297
320
|
this.#log = undefined;
|
|
321
|
+
this.#harnessLog = undefined;
|
|
298
322
|
this.#remembered = [];
|
|
299
323
|
rememberLog([]);
|
|
300
324
|
this.#root?.remove();
|
|
@@ -327,8 +351,9 @@ export class Presenter {
|
|
|
327
351
|
const dock = this.#root?.querySelector('[data-reticle-dock]');
|
|
328
352
|
dock?.setAttribute(DATA_ON, GLOW_ON);
|
|
329
353
|
this.#hud?.setAttribute(DATA_ON, GLOW_ON);
|
|
330
|
-
this.#lastActionText =
|
|
354
|
+
this.#lastActionText = UNREACHABLE_HEADLINE;
|
|
331
355
|
this.#paintActStrip(this.#lastActionText, true);
|
|
356
|
+
this.#actLine?.setAttribute('title', unreachableMessage(url, attempts));
|
|
332
357
|
if (shouldAutoOpenChat(getPresenterSettings().autoOpenChat))
|
|
333
358
|
this.#shell.openChat();
|
|
334
359
|
}
|
|
@@ -406,9 +431,25 @@ export class Presenter {
|
|
|
406
431
|
this.#lastActionText = text;
|
|
407
432
|
this.#paintActStrip(text, false);
|
|
408
433
|
}
|
|
409
|
-
#
|
|
410
|
-
if (
|
|
434
|
+
#paintHarnessRun(drive) {
|
|
435
|
+
if (drive !== undefined && drive.runId !== this.#harnessRunId) {
|
|
436
|
+
this.#harnessRunId = drive.runId;
|
|
437
|
+
if (this.#harnessLog !== undefined)
|
|
438
|
+
clearLogRows(this.#harnessLog);
|
|
439
|
+
}
|
|
440
|
+
const was = this.#harnessSteps;
|
|
441
|
+
this.#harnessSteps = drive?.steps;
|
|
442
|
+
if (drive !== undefined)
|
|
443
|
+
this.#paintActStrip(this.#lastActionText, false);
|
|
444
|
+
else if (was !== undefined)
|
|
445
|
+
this.#paintActStrip(ACT_STRIP.READY, true);
|
|
446
|
+
}
|
|
447
|
+
#paintActStrip(raw, idle) {
|
|
448
|
+
const text = this.#harnessSteps === undefined ? raw : ACT_STRIP.harnessTesting(this.#harnessSteps);
|
|
449
|
+
if (this.#actLine !== undefined) {
|
|
411
450
|
this.#actLine.textContent = text;
|
|
451
|
+
this.#actLine.removeAttribute('title');
|
|
452
|
+
}
|
|
412
453
|
const liveness = idle ? 'idle' : 'active';
|
|
413
454
|
if (this.#actStrip !== undefined)
|
|
414
455
|
this.#actStrip.setAttribute('data-liveness', liveness);
|
|
@@ -444,6 +485,12 @@ export class Presenter {
|
|
|
444
485
|
return;
|
|
445
486
|
if ('' === this.#lastActionText)
|
|
446
487
|
return;
|
|
488
|
+
if (this.#harnessSteps !== undefined)
|
|
489
|
+
return;
|
|
490
|
+
if (LOG_ACTOR.HARNESS === this.#lastActor) {
|
|
491
|
+
this.#paintActStrip(ACT_STRIP.READY, true);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
447
494
|
const since = ACT_STRIP.SINCE_LAST;
|
|
448
495
|
this.#paintActStrip(`${ACT_STRIP.PLANNING_PREFIX}${humanDuration(idleMs)}${since}`, true);
|
|
449
496
|
if (this.#chatPillTime !== undefined)
|
|
@@ -526,6 +573,8 @@ export class Presenter {
|
|
|
526
573
|
this.#tallied = { passes: 0, fails: 0 };
|
|
527
574
|
if (this.#log !== undefined)
|
|
528
575
|
clearLogRows(this.#log);
|
|
576
|
+
if (this.#harnessLog !== undefined)
|
|
577
|
+
clearLogRows(this.#harnessLog);
|
|
529
578
|
this.#renderTally();
|
|
530
579
|
}
|
|
531
580
|
#applyHideUntilRestart() {
|
|
@@ -542,9 +591,17 @@ export class Presenter {
|
|
|
542
591
|
}
|
|
543
592
|
this.#syncAnnotator();
|
|
544
593
|
}
|
|
545
|
-
|
|
594
|
+
#logsFor(actor, summary) {
|
|
595
|
+
const agent = this.#log;
|
|
596
|
+
const harness = this.#harnessLog;
|
|
597
|
+
if (LOG_ACTOR.HARNESS !== actor || harness === undefined)
|
|
598
|
+
return agent === undefined ? [] : [agent];
|
|
599
|
+
return summary && agent !== undefined ? [agent, harness] : [harness];
|
|
600
|
+
}
|
|
601
|
+
log(kind, text, result, actor, summary = false) {
|
|
546
602
|
const ms = this.#now();
|
|
547
603
|
this.#glowCtl.markActivity(ms);
|
|
604
|
+
this.#lastActor = actor;
|
|
548
605
|
if (this.#log === undefined)
|
|
549
606
|
return undefined;
|
|
550
607
|
const trimmed = text.trim();
|
|
@@ -558,7 +615,8 @@ export class Presenter {
|
|
|
558
615
|
while (this.#runLog.length > this.#logMax)
|
|
559
616
|
this.#runLog.shift();
|
|
560
617
|
const ts = formatElapsed(ms - this.#logBaseMs);
|
|
561
|
-
const
|
|
618
|
+
const handles = this.#logsFor(actor, summary).map((log) => appendLogRow(log, kind, trimmed, ts, this.#logMax, actor));
|
|
619
|
+
const handle = { result: (r) => handles.forEach((h) => h.result(r)) };
|
|
562
620
|
if (result !== undefined)
|
|
563
621
|
handle.result(result);
|
|
564
622
|
const kept = {
|
|
@@ -567,6 +625,7 @@ export class Presenter {
|
|
|
567
625
|
ts,
|
|
568
626
|
at: ms - this.#logBaseMs,
|
|
569
627
|
...(actor === undefined ? {} : { actor }),
|
|
628
|
+
...(summary ? { summary: true } : {}),
|
|
570
629
|
...(result === undefined ? {} : { result }),
|
|
571
630
|
};
|
|
572
631
|
this.#remembered.push(kept);
|
|
@@ -593,14 +652,16 @@ export class Presenter {
|
|
|
593
652
|
}
|
|
594
653
|
this.#tallied = renderTally(this.#tally, this.#runLog, this.#tallied);
|
|
595
654
|
}
|
|
596
|
-
narrate(text, level = 'info') {
|
|
655
|
+
narrate(text, level = 'info', actor = LOG_ACTOR.AGENT, summary = false) {
|
|
597
656
|
const line = 'info' === level ? text : `[${level}] ${text}`;
|
|
598
|
-
return this.log(LOG_KIND.NARRATION, line);
|
|
657
|
+
return this.log(LOG_KIND.NARRATION, line, undefined, actor, summary);
|
|
599
658
|
}
|
|
600
659
|
#pruneLog() {
|
|
601
660
|
if (this.#log === undefined)
|
|
602
661
|
return;
|
|
603
662
|
trimLogRows(this.#log, this.#logMax);
|
|
663
|
+
if (this.#harnessLog !== undefined)
|
|
664
|
+
trimLogRows(this.#harnessLog, this.#logMax);
|
|
604
665
|
}
|
|
605
666
|
setThrottled(throttled) {
|
|
606
667
|
this.#root?.setAttribute(THROTTLED_ATTR, throttled ? '1' : '0');
|
|
@@ -25,11 +25,13 @@ export const SERVED_COMMANDS = [
|
|
|
25
25
|
ReticleCommand.PRESENTER,
|
|
26
26
|
ReticleCommand.IMPACT,
|
|
27
27
|
ReticleCommand.CAPTURE,
|
|
28
|
+
ReticleCommand.RENDER,
|
|
28
29
|
ReticleCommand.NAVIGATE,
|
|
29
30
|
ReticleCommand.REFRESH,
|
|
30
31
|
ReticleCommand.FLOWS,
|
|
31
32
|
ReticleCommand.FLOW_PROGRESS,
|
|
32
33
|
ReticleCommand.PLAN,
|
|
34
|
+
ReticleCommand.MARKERS,
|
|
33
35
|
];
|
|
34
36
|
export function declaredCommands() {
|
|
35
37
|
return [...SERVED_COMMANDS];
|