@reticlehq/browser 3.5.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 +56 -43
- package/dist/actions/actions-press.d.ts +11 -4
- package/dist/actions/actions-press.js +132 -17
- package/dist/actions/actions.d.ts +1 -35
- package/dist/actions/actions.js +32 -65
- package/dist/actions/appeared-text.js +3 -0
- package/dist/actions/danger-context.d.ts +2 -0
- package/dist/actions/danger-context.js +29 -3
- 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/connect-options.d.ts +1 -0
- package/dist/dom/a11y.js +264 -14
- package/dist/dom/addressing/coverage-markers.d.ts +6 -0
- package/dist/dom/addressing/coverage-markers.js +13 -0
- package/dist/dom/addressing/refs.js +2 -1
- package/dist/dom/addressing/testid-attr.d.ts +4 -0
- package/dist/dom/addressing/testid-attr.js +14 -0
- package/dist/dom/dom-ignore.d.ts +2 -0
- package/dist/dom/dom-ignore.js +15 -2
- package/dist/dom/query.d.ts +2 -1
- package/dist/dom/query.js +116 -27
- package/dist/dom/render-page.d.ts +12 -0
- package/dist/dom/render-page.js +135 -0
- package/dist/dom/snapshot.js +56 -7
- package/dist/observers/departure.js +51 -9
- package/dist/observers/dom.js +35 -18
- package/dist/observers/field.js +5 -21
- package/dist/observers/health.js +63 -2
- package/dist/observers/network-stream.d.ts +1 -1
- package/dist/observers/network-stream.js +3 -3
- package/dist/observers/network.js +57 -8
- package/dist/observers/perf.js +53 -1
- package/dist/observers/route.js +6 -5
- package/dist/observers/storage.js +6 -1
- package/dist/presenter/carousel/carousel.d.ts +5 -2
- package/dist/presenter/carousel/carousel.js +30 -8
- package/dist/presenter/carousel/panel-slides.d.ts +3 -4
- package/dist/presenter/carousel/panel-slides.js +48 -9
- package/dist/presenter/carousel/talk-card.d.ts +1 -1
- package/dist/presenter/chrome/log-kinds.d.ts +5 -0
- package/dist/presenter/chrome/log-kinds.js +1 -0
- package/dist/presenter/chrome/log-memory.d.ts +13 -0
- package/dist/presenter/chrome/log-memory.js +39 -0
- package/dist/presenter/chrome/presenter-hud-chrome.d.ts +1 -0
- package/dist/presenter/chrome/presenter-hud-chrome.js +7 -1
- package/dist/presenter/chrome/presenter-log.d.ts +12 -4
- package/dist/presenter/chrome/presenter-log.js +100 -10
- 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 +28 -5
- package/dist/presenter/chrome/presenter-report-copy.js +40 -5
- package/dist/presenter/hud-telemetry.js +83 -3
- package/dist/presenter/icons/presenter-heroicons-data.d.ts +1 -0
- package/dist/presenter/icons/presenter-heroicons-data.js +4 -3
- package/dist/presenter/icons/presenter-icons.d.ts +2 -0
- package/dist/presenter/icons/presenter-icons.js +2 -0
- package/dist/presenter/presenter-account-styles.js +3 -3
- package/dist/presenter/presenter-account.d.ts +31 -8
- package/dist/presenter/presenter-account.js +105 -15
- 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 +43 -0
- package/dist/presenter/presenter-chat-views.js +622 -0
- package/dist/presenter/presenter-config.d.ts +5 -2
- package/dist/presenter/presenter-config.js +5 -3
- package/dist/presenter/presenter-controls.d.ts +3 -2
- package/dist/presenter/presenter-controls.js +163 -61
- package/dist/presenter/presenter-design-tokens.d.ts +1 -0
- package/dist/presenter/presenter-design-tokens.js +34 -0
- package/dist/presenter/presenter-dock-layout.js +1 -1
- package/dist/presenter/presenter-frame.d.ts +12 -0
- package/dist/presenter/presenter-frame.js +187 -0
- 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.d.ts +10 -0
- package/dist/presenter/presenter-plan.js +186 -0
- package/dist/presenter/presenter-report-styles.js +46 -21
- package/dist/presenter/presenter-report.d.ts +2 -1
- package/dist/presenter/presenter-report.js +123 -20
- package/dist/presenter/presenter-settings-styles.js +18 -4
- package/dist/presenter/presenter-settings.d.ts +8 -2
- package/dist/presenter/presenter-settings.js +134 -33
- package/dist/presenter/presenter-shell-styles.js +48 -42
- package/dist/presenter/presenter-shell.d.ts +17 -4
- package/dist/presenter/presenter-shell.js +139 -79
- package/dist/presenter/presenter-styles.js +9 -3
- package/dist/presenter/presenter-workspace.js +10 -3
- package/dist/presenter/presenter.d.ts +6 -4
- package/dist/presenter/presenter.js +171 -22
- package/dist/presenter/tour/tour.d.ts +4 -1
- package/dist/presenter/tour/tour.js +6 -4
- package/dist/recorder/recorder.js +2 -2
- package/dist/registry/auto-testids.js +3 -4
- package/dist/registry/declared-platform.js +4 -0
- package/dist/reticle-inject.js +938 -494
- package/dist/reticle.d.ts +10 -1
- package/dist/reticle.js +109 -11
- package/dist/review/annotator-styles.d.ts +1 -1
- package/dist/review/annotator.d.ts +7 -0
- package/dist/review/annotator.js +20 -2
- package/dist/review/mark-anchor.js +2 -2
- package/dist/session-continuity.js +2 -1
- package/dist/storage-keys.d.ts +15 -0
- package/dist/storage-keys.js +21 -0
- 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 +3 -2
- package/dist/presenter/carousel/offer-card.d.ts +0 -21
- package/dist/presenter/carousel/offer-card.js +0 -55
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
import { appModalOpen } from '../dom/dom-ignore.js';
|
|
2
2
|
import { PresenterReport, reportPanelHtml } from './presenter-report.js';
|
|
3
3
|
import { paintToolbarAccount, TOOLBAR_ACCOUNT_ATTR } from './presenter-workspace.js';
|
|
4
|
-
import { mountAccountControl } from './presenter-account.js';
|
|
4
|
+
import { mountAccountControl, TEAM_SLOT_ATTR } from './presenter-account.js';
|
|
5
5
|
import { paintSettingsAccount } from './presenter-settings.js';
|
|
6
|
-
import { CHAT_MIN_ATTR, CHAT_PILL_ATTR, REPORT_ATTR,
|
|
7
|
-
import { offerDismissed } from './carousel/offer-card.js';
|
|
6
|
+
import { CHAT_MIN_ATTR, CHAT_PILL_ATTR, REPORT_ATTR, ANNOTATE_BTN_ATTR, CHAT_ATTR, CHAT_TOGGLE_ATTR, CHAT_PANEL_ATTR, DOCK_ATTR, FAB_ATTR, MIN_ATTR, SETTINGS_ATTR, SETTINGS_BTN_ATTR, MINIMISED_STORAGE_KEY, } from './presenter-config.js';
|
|
8
7
|
import { paintCarousel } from './carousel/carousel.js';
|
|
9
8
|
import { panelSlides } from './carousel/panel-slides.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { paintRail, RAIL_HTML, RAIL_PROMO_ATTR } from './presenter-frame.js';
|
|
10
|
+
import { FAB_TOGGLE_HTML, MARK_SVG } from './chrome/presenter-brand.js';
|
|
11
|
+
import { settleLogAtLatest } from './chrome/presenter-log.js';
|
|
12
12
|
import { installHudDragHandles, installHudPositionGuards } from './presenter-drag.js';
|
|
13
13
|
import { scheduleSyncDockLayout } from './presenter-dock-layout.js';
|
|
14
14
|
import { hiIconHtml, hiToggleIconHtml, PRESENTER_ICON_SIZE, PresenterIcon, } from './icons/presenter-icons.js';
|
|
15
15
|
import { HUD_SURFACE_CLASS, HUD_LOG_WELL_CLASS } from './chrome/presenter-hud-chrome.js';
|
|
16
|
-
import {
|
|
16
|
+
import { ChatViews, CHAT_VIEWS_NAV_HTML, ANNOTATIONS_HTML, FLOWS_PAGE_HTML, HARNESS_PAGE_HTML, NAV_LABEL, navLabelHtml, platformBase, } from './presenter-chat-views.js';
|
|
17
17
|
import { PresenterSettingsPanel, settingsPanelHtml, } from './presenter-settings.js';
|
|
18
18
|
const DRAG_HANDLE_CLASS = 'reticle-toolbar-drag';
|
|
19
19
|
const TRANSITION_LOCK_MS = 120;
|
|
20
|
-
const ANNOTATE_LABEL = 'Annotate';
|
|
21
20
|
const CHAT_MIN_LABEL = 'Minimise chat';
|
|
22
21
|
const CHAT_PILL_LABEL = 'Open agent chat';
|
|
23
|
-
const REPORT_LABEL = 'Impact';
|
|
24
22
|
const SETTINGS_LABEL = 'Settings';
|
|
23
|
+
const AGENT_LOG_TITLE = 'Reticle';
|
|
25
24
|
const EXIT_LABEL = 'Exit';
|
|
25
|
+
function paintPromo(root, notices = [], base) {
|
|
26
|
+
const target = root.querySelector(`[${RAIL_PROMO_ATTR}]`);
|
|
27
|
+
if (null === target)
|
|
28
|
+
return;
|
|
29
|
+
let storage;
|
|
30
|
+
try {
|
|
31
|
+
storage = window.sessionStorage;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
storage = undefined;
|
|
35
|
+
}
|
|
36
|
+
paintCarousel(target, panelSlides(notices, base), storage);
|
|
37
|
+
}
|
|
26
38
|
export class HudShell {
|
|
27
39
|
#root;
|
|
28
40
|
#dock;
|
|
29
41
|
#fab;
|
|
30
42
|
#chatPanel;
|
|
31
|
-
#chatToggle;
|
|
32
43
|
#collapseBtn;
|
|
33
44
|
#settings;
|
|
45
|
+
#chatViews;
|
|
34
46
|
#dragTeardown;
|
|
35
47
|
#layoutTeardown;
|
|
36
48
|
#transitionLock = false;
|
|
@@ -48,9 +60,52 @@ export class HudShell {
|
|
|
48
60
|
});
|
|
49
61
|
#callbacks;
|
|
50
62
|
#pushedAccount;
|
|
63
|
+
#pushedNotices = [];
|
|
64
|
+
#pushedHarness;
|
|
65
|
+
#promoBase;
|
|
51
66
|
#accountTeardown;
|
|
52
|
-
|
|
53
|
-
this.#
|
|
67
|
+
setProjectId(projectId) {
|
|
68
|
+
this.#chatViews.setProjectId(projectId);
|
|
69
|
+
}
|
|
70
|
+
paintHarnessDrive(drive) {
|
|
71
|
+
this.#chatViews.paintDrive(drive);
|
|
72
|
+
}
|
|
73
|
+
paintAgent(link) {
|
|
74
|
+
this.#chatViews.paintAgent(link);
|
|
75
|
+
}
|
|
76
|
+
paintHarness(config, gate) {
|
|
77
|
+
this.#pushedHarness = config;
|
|
78
|
+
this.#settings.paintHarness(config, gate);
|
|
79
|
+
this.#chatViews.paintHarness(config, gate);
|
|
80
|
+
this.#repaintPromoIfMoved();
|
|
81
|
+
}
|
|
82
|
+
#promoLinks() {
|
|
83
|
+
return platformBase(this.#pushedHarness, this.#pushedAccount?.account ?? { signedIn: false });
|
|
84
|
+
}
|
|
85
|
+
#repaintPromoIfMoved() {
|
|
86
|
+
const base = this.#promoLinks();
|
|
87
|
+
if (this.#root === undefined || base === this.#promoBase)
|
|
88
|
+
return;
|
|
89
|
+
this.#promoBase = base;
|
|
90
|
+
paintPromo(this.#root, this.#pushedNotices, base);
|
|
91
|
+
}
|
|
92
|
+
paintImpact(verdicts) {
|
|
93
|
+
this.#chatViews.paintImpact(verdicts);
|
|
94
|
+
}
|
|
95
|
+
paintAnnotations(items) {
|
|
96
|
+
this.#chatViews.paintAnnotations(items);
|
|
97
|
+
}
|
|
98
|
+
openView(view) {
|
|
99
|
+
if ('activity' === view)
|
|
100
|
+
this.showChat();
|
|
101
|
+
else {
|
|
102
|
+
if (this.isCollapsed())
|
|
103
|
+
this.expand();
|
|
104
|
+
this.closeChat();
|
|
105
|
+
this.#settings.close();
|
|
106
|
+
this.#report.close();
|
|
107
|
+
}
|
|
108
|
+
this.#chatViews.open(view);
|
|
54
109
|
}
|
|
55
110
|
paintAccount(account, dashboardUrl, details = {}) {
|
|
56
111
|
this.#pushedAccount = { account, dashboardUrl, details };
|
|
@@ -58,65 +113,72 @@ export class HudShell {
|
|
|
58
113
|
return;
|
|
59
114
|
paintToolbarAccount(this.#root, account, dashboardUrl, details);
|
|
60
115
|
paintSettingsAccount(this.#root, account, dashboardUrl, details);
|
|
116
|
+
paintRail(this.#root, account);
|
|
117
|
+
this.#chatViews.paintAccount(account);
|
|
118
|
+
this.#repaintPromoIfMoved();
|
|
61
119
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.#
|
|
65
|
-
this.#
|
|
66
|
-
|
|
67
|
-
#paintCarousel() {
|
|
68
|
-
const log = this.#root?.querySelector(`[${DATA_RETICLE_LOG}]`);
|
|
69
|
-
if (!(log instanceof HTMLElement))
|
|
70
|
-
return;
|
|
71
|
-
const declined = offerDismissed(this.#storage());
|
|
72
|
-
paintCarousel(log, panelSlides(this.#pushedOffer, declined), this.#sessionStorage());
|
|
73
|
-
}
|
|
74
|
-
#sessionStorage() {
|
|
75
|
-
try {
|
|
76
|
-
return globalThis.sessionStorage;
|
|
77
|
-
}
|
|
78
|
-
catch {
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
#storage() {
|
|
83
|
-
try {
|
|
84
|
-
return globalThis.localStorage;
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
120
|
+
paintNotices(notices = []) {
|
|
121
|
+
this.#pushedNotices = notices;
|
|
122
|
+
this.#promoBase = this.#promoLinks();
|
|
123
|
+
if (this.#root !== undefined)
|
|
124
|
+
paintPromo(this.#root, notices, this.#promoBase);
|
|
89
125
|
}
|
|
90
126
|
constructor(callbacks = {}) {
|
|
91
127
|
this.#callbacks = callbacks;
|
|
128
|
+
this.#chatViews = new ChatViews(() => {
|
|
129
|
+
this.#chatViews.closePage();
|
|
130
|
+
this.closeChat();
|
|
131
|
+
this.#report.open();
|
|
132
|
+
}, (view) => {
|
|
133
|
+
if ('activity' === view) {
|
|
134
|
+
this.#chatViews.open(view);
|
|
135
|
+
this.showChat();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (this.isCollapsed())
|
|
139
|
+
this.expand();
|
|
140
|
+
this.closeChat();
|
|
141
|
+
this.#settings.close();
|
|
142
|
+
this.#report.close();
|
|
143
|
+
}, {
|
|
144
|
+
run: (persona) => callbacks.onHarnessRun?.(persona),
|
|
145
|
+
stop: () => callbacks.onHarnessStop?.(),
|
|
146
|
+
setHarness: (on) => callbacks.onHarness?.(on),
|
|
147
|
+
link: () => callbacks.onHarnessLink?.(),
|
|
148
|
+
});
|
|
92
149
|
this.#settings = new PresenterSettingsPanel({
|
|
93
150
|
...callbacks.settings,
|
|
94
151
|
onBeforeOpen: () => {
|
|
95
152
|
this.closeChat();
|
|
153
|
+
this.#chatViews.closePage();
|
|
96
154
|
this.#report.close();
|
|
97
155
|
callbacks.settings?.onBeforeOpen?.();
|
|
98
156
|
},
|
|
99
157
|
});
|
|
100
158
|
}
|
|
101
159
|
static dockHtml(actStripHtml, bannerHtml, logAttr, flowsHtml, footHtml) {
|
|
102
|
-
const annotate = hiToggleIconHtml(PresenterIcon.ANNOTATE, PRESENTER_ICON_SIZE.TOOLBAR);
|
|
103
|
-
const chart = hiToggleIconHtml(PresenterIcon.CHART, PRESENTER_ICON_SIZE.TOOLBAR);
|
|
104
160
|
const gear = hiToggleIconHtml(PresenterIcon.GEAR, PRESENTER_ICON_SIZE.TOOLBAR);
|
|
105
161
|
const exit = hiIconHtml(PresenterIcon.REMOVE, PRESENTER_ICON_SIZE.TOOLBAR);
|
|
106
|
-
return `<div ${DOCK_ATTR}>
|
|
107
|
-
<div ${CHAT_PANEL_ATTR} class="reticle-chat-panel ${HUD_SURFACE_CLASS}" role="region" aria-label="
|
|
162
|
+
return `<div ${DOCK_ATTR} role="complementary" aria-label="Reticle">
|
|
163
|
+
<div ${CHAT_PANEL_ATTR} class="reticle-chat-panel ${HUD_SURFACE_CLASS}" role="region" aria-label="Agent Log" aria-hidden="true">
|
|
108
164
|
<div class="reticle-chat-head">
|
|
109
|
-
<span class="reticle-chat-brand">${MARK_SVG}<span class="reticle-chat-brandname">${
|
|
165
|
+
<span class="reticle-chat-brand">${MARK_SVG}<span class="reticle-chat-brandname">${AGENT_LOG_TITLE}</span></span>
|
|
166
|
+
<span ${TEAM_SLOT_ATTR} class="reticle-head-team"></span>
|
|
110
167
|
<span ${TOOLBAR_ACCOUNT_ATTR} class="reticle-head-account"></span>
|
|
111
168
|
</div>
|
|
112
169
|
<button type="button" ${CHAT_MIN_ATTR} class="reticle-chat-min" title="${CHAT_MIN_LABEL}" aria-label="${CHAT_MIN_LABEL}">${hiIconHtml(PresenterIcon.CARET_DOWN, PRESENTER_ICON_SIZE.TOOLBAR)}</button>
|
|
113
170
|
${actStripHtml}
|
|
114
171
|
<span class="reticle-tally" data-reticle-tally hidden></span>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
172
|
+
<section class="reticle-chat-view" role="region" aria-label="Agent Log">
|
|
173
|
+
${bannerHtml}
|
|
174
|
+
<div class="${HUD_LOG_WELL_CLASS}"><div ${logAttr}></div></div>
|
|
175
|
+
${flowsHtml}
|
|
176
|
+
</section>
|
|
118
177
|
${footHtml}
|
|
119
178
|
</div>
|
|
179
|
+
${FLOWS_PAGE_HTML}
|
|
180
|
+
${HARNESS_PAGE_HTML}
|
|
181
|
+
${ANNOTATIONS_HTML}
|
|
120
182
|
<button type="button" ${CHAT_PILL_ATTR} class="reticle-chat-pill" title="${CHAT_PILL_LABEL}" aria-label="${CHAT_PILL_LABEL}">
|
|
121
183
|
${MARK_SVG}
|
|
122
184
|
<span class="reticle-chat-pill-text" data-reticle-chat-pill-text></span>
|
|
@@ -125,27 +187,19 @@ export class HudShell {
|
|
|
125
187
|
</button>
|
|
126
188
|
${settingsPanelHtml()}
|
|
127
189
|
${reportPanelHtml()}
|
|
190
|
+
${RAIL_HTML}
|
|
128
191
|
<div data-reticle-hud>
|
|
129
192
|
<div class="reticle-hud-deco" aria-hidden="true"></div>
|
|
130
193
|
${FAB_TOGGLE_HTML}
|
|
131
194
|
<div class="reticle-toolbar ${DRAG_HANDLE_CLASS}" role="toolbar" aria-label="Reticle controls">
|
|
132
|
-
<div class="reticle-toolbar-actions">${CONTROLS_TOOLBAR_HTML}</div>
|
|
133
|
-
<span class="reticle-tb-sep" aria-hidden="true"></span>
|
|
134
195
|
<div class="reticle-toolbar-chrome">
|
|
196
|
+
${CHAT_VIEWS_NAV_HTML}
|
|
135
197
|
<div class="reticle-tb-wrap">
|
|
136
|
-
<button type="button" ${
|
|
137
|
-
<span class="reticle-tb-tip">${ANNOTATE_LABEL}</span>
|
|
138
|
-
</div>
|
|
139
|
-
<div class="reticle-tb-wrap">
|
|
140
|
-
<button type="button" ${REPORT_BTN_ATTR} class="reticle-tb-btn reticle-tb-btn--toggle" title="${REPORT_LABEL}" aria-label="${REPORT_LABEL}" aria-pressed="false" data-active="0">${chart}</button>
|
|
141
|
-
<span class="reticle-tb-tip">${REPORT_LABEL}</span>
|
|
142
|
-
</div>
|
|
143
|
-
<div class="reticle-tb-wrap">
|
|
144
|
-
<button type="button" ${SETTINGS_BTN_ATTR} class="reticle-tb-btn reticle-tb-btn--toggle" title="${SETTINGS_LABEL}" aria-label="${SETTINGS_LABEL}" aria-pressed="false" data-active="0">${gear}</button>
|
|
198
|
+
<button type="button" ${SETTINGS_BTN_ATTR} class="reticle-tb-btn reticle-tb-btn--toggle" title="${SETTINGS_LABEL}" aria-label="${SETTINGS_LABEL}" aria-pressed="false" data-active="0">${gear}${navLabelHtml(NAV_LABEL.SETTINGS)}</button>
|
|
145
199
|
<span class="reticle-tb-tip">${SETTINGS_LABEL}</span>
|
|
146
200
|
</div>
|
|
147
201
|
<div class="reticle-tb-wrap">
|
|
148
|
-
<button type="button" data-reticle-min-btn class="reticle-tb-btn" title="${EXIT_LABEL}" aria-label="${EXIT_LABEL}">${exit}</button>
|
|
202
|
+
<button type="button" data-reticle-min-btn class="reticle-tb-btn" title="${EXIT_LABEL}" aria-label="${EXIT_LABEL}">${exit}${navLabelHtml(NAV_LABEL.HIDE)}</button>
|
|
149
203
|
<span class="reticle-tb-tip">${EXIT_LABEL}<span class="reticle-tb-kbd">Esc</span></span>
|
|
150
204
|
</div>
|
|
151
205
|
</div>
|
|
@@ -167,7 +221,16 @@ export class HudShell {
|
|
|
167
221
|
};
|
|
168
222
|
lit(CHAT_TOGGLE_ATTR, '1' === root.getAttribute(CHAT_ATTR));
|
|
169
223
|
lit(SETTINGS_BTN_ATTR, '1' === root.getAttribute(SETTINGS_ATTR));
|
|
170
|
-
|
|
224
|
+
const impact = root.querySelector('[data-reticle-chat-impact]');
|
|
225
|
+
if (impact !== null) {
|
|
226
|
+
const on = '1' === root.getAttribute(REPORT_ATTR);
|
|
227
|
+
impact.setAttribute('data-active', on ? '1' : '0');
|
|
228
|
+
this.#chatViews.setImpactOpen(on);
|
|
229
|
+
if (on)
|
|
230
|
+
impact.setAttribute('aria-current', 'page');
|
|
231
|
+
else
|
|
232
|
+
impact.removeAttribute('aria-current');
|
|
233
|
+
}
|
|
171
234
|
}
|
|
172
235
|
isAnnotateOn() {
|
|
173
236
|
return this.#annotateOn;
|
|
@@ -176,6 +239,14 @@ export class HudShell {
|
|
|
176
239
|
this.#annotateOn = on;
|
|
177
240
|
this.#annotateBtn?.setAttribute('aria-pressed', on ? 'true' : 'false');
|
|
178
241
|
this.#annotateBtn?.setAttribute('data-active', on ? '1' : '0');
|
|
242
|
+
this.#annotateBtn?.setAttribute('aria-label', on ? 'Stop adding notes' : 'Add notes');
|
|
243
|
+
this.#annotateBtn?.setAttribute('title', on ? 'Stop adding notes' : 'Add notes');
|
|
244
|
+
const label = this.#annotateBtn?.querySelector('[data-reticle-notes-toggle-label]');
|
|
245
|
+
if (label !== null && label !== undefined)
|
|
246
|
+
label.textContent = on ? 'Stop adding notes' : 'Add notes';
|
|
247
|
+
this.#root
|
|
248
|
+
?.querySelector('[data-reticle-chat-view-btn="annotations"]')
|
|
249
|
+
?.setAttribute('data-capture', on ? '1' : '0');
|
|
179
250
|
}
|
|
180
251
|
mount(root) {
|
|
181
252
|
this.#listeners = new AbortController();
|
|
@@ -186,10 +257,9 @@ export class HudShell {
|
|
|
186
257
|
this.#fab = fabEl instanceof HTMLButtonElement ? fabEl : undefined;
|
|
187
258
|
const chatPanelEl = root.querySelector(`[${CHAT_PANEL_ATTR}]`);
|
|
188
259
|
this.#chatPanel = chatPanelEl instanceof HTMLElement ? chatPanelEl : undefined;
|
|
189
|
-
const chatToggleEl = root.querySelector(`[${CHAT_TOGGLE_ATTR}]`);
|
|
190
|
-
this.#chatToggle = chatToggleEl instanceof HTMLElement ? chatToggleEl : undefined;
|
|
191
260
|
const annotateEl = root.querySelector(`[${ANNOTATE_BTN_ATTR}]`);
|
|
192
261
|
this.#annotateBtn = annotateEl instanceof HTMLButtonElement ? annotateEl : undefined;
|
|
262
|
+
this.setAnnotateOn(this.#annotateOn);
|
|
193
263
|
this.#annotateBtn?.addEventListener('click', (e) => {
|
|
194
264
|
e.preventDefault();
|
|
195
265
|
e.stopPropagation();
|
|
@@ -215,17 +285,15 @@ export class HudShell {
|
|
|
215
285
|
root.removeAttribute(CHAT_ATTR);
|
|
216
286
|
this.#settings.mount(root);
|
|
217
287
|
this.#report.mount(root);
|
|
288
|
+
this.#chatViews.mount(root);
|
|
289
|
+
this.#promoBase = this.#promoLinks();
|
|
290
|
+
paintPromo(root, this.#pushedNotices, this.#promoBase);
|
|
218
291
|
this.#toggleSync = new MutationObserver(() => this.#syncToolbarToggles());
|
|
219
292
|
this.#toggleSync.observe(root, {
|
|
220
293
|
attributes: true,
|
|
221
294
|
attributeFilter: [CHAT_ATTR, SETTINGS_ATTR, REPORT_ATTR],
|
|
222
295
|
});
|
|
223
296
|
this.#syncToolbarToggles();
|
|
224
|
-
root.querySelector(`[${REPORT_BTN_ATTR}]`)?.addEventListener('click', (e) => {
|
|
225
|
-
e.preventDefault();
|
|
226
|
-
e.stopPropagation();
|
|
227
|
-
this.#report.toggle();
|
|
228
|
-
}, { signal });
|
|
229
297
|
this.#fab?.addEventListener('click', (e) => {
|
|
230
298
|
e.stopPropagation();
|
|
231
299
|
if (this.#suppressFabClick) {
|
|
@@ -238,10 +306,6 @@ export class HudShell {
|
|
|
238
306
|
e.stopPropagation();
|
|
239
307
|
this.collapse();
|
|
240
308
|
}, { signal });
|
|
241
|
-
this.#chatToggle?.addEventListener('click', (e) => {
|
|
242
|
-
e.stopPropagation();
|
|
243
|
-
this.toggleChat();
|
|
244
|
-
}, { signal });
|
|
245
309
|
const toolbarDrag = root.querySelector(`.${DRAG_HANDLE_CLASS}`);
|
|
246
310
|
const dragHandles = [this.#fab, toolbarDrag].filter((el) => el instanceof HTMLElement);
|
|
247
311
|
if (this.#dock !== undefined && dragHandles.length > 0) {
|
|
@@ -250,20 +314,18 @@ export class HudShell {
|
|
|
250
314
|
this.#suppressFabClick = true;
|
|
251
315
|
},
|
|
252
316
|
onDragEnd: (moved) => {
|
|
253
|
-
|
|
254
|
-
this.#suppressFabClick = true;
|
|
317
|
+
this.#suppressFabClick = moved && this.isCollapsed();
|
|
255
318
|
},
|
|
256
319
|
});
|
|
257
320
|
this.#layoutTeardown = installHudPositionGuards(this.#dock, root);
|
|
258
321
|
}
|
|
259
322
|
document.addEventListener('pointerdown', this.#onDocPointerDown, { signal });
|
|
260
323
|
document.addEventListener('keydown', this.#onKeyDown, { signal });
|
|
261
|
-
this.#accountTeardown = mountAccountControl(root);
|
|
324
|
+
this.#accountTeardown = mountAccountControl(root, () => this.#callbacks.onSignIn?.());
|
|
262
325
|
if (this.#pushedAccount !== undefined) {
|
|
263
326
|
const pushed = this.#pushedAccount;
|
|
264
327
|
this.paintAccount(pushed.account, pushed.dashboardUrl, pushed.details);
|
|
265
328
|
}
|
|
266
|
-
this.#paintCarousel();
|
|
267
329
|
}
|
|
268
330
|
teardown() {
|
|
269
331
|
this.#accountTeardown?.();
|
|
@@ -277,11 +339,11 @@ export class HudShell {
|
|
|
277
339
|
this.#layoutTeardown?.();
|
|
278
340
|
this.#layoutTeardown = undefined;
|
|
279
341
|
this.#settings.teardown();
|
|
342
|
+
this.#chatViews.teardown();
|
|
280
343
|
this.#root = undefined;
|
|
281
344
|
this.#dock = undefined;
|
|
282
345
|
this.#fab = undefined;
|
|
283
346
|
this.#chatPanel = undefined;
|
|
284
|
-
this.#chatToggle = undefined;
|
|
285
347
|
this.#collapseBtn = undefined;
|
|
286
348
|
}
|
|
287
349
|
isCollapsed() {
|
|
@@ -323,6 +385,8 @@ export class HudShell {
|
|
|
323
385
|
if (this.isCollapsed())
|
|
324
386
|
this.expand();
|
|
325
387
|
this.#settings.close();
|
|
388
|
+
this.#chatViews.closePage();
|
|
389
|
+
this.#chatViews.open('activity');
|
|
326
390
|
if (this.isChatOpen())
|
|
327
391
|
return;
|
|
328
392
|
this.#root.setAttribute(CHAT_ATTR, '1');
|
|
@@ -330,8 +394,6 @@ export class HudShell {
|
|
|
330
394
|
if (log !== null)
|
|
331
395
|
settleLogAtLatest(log);
|
|
332
396
|
this.#chatPanel?.setAttribute('aria-hidden', 'false');
|
|
333
|
-
this.#chatToggle?.setAttribute('data-active', '1');
|
|
334
|
-
this.#chatToggle?.setAttribute('aria-pressed', 'true');
|
|
335
397
|
this.#callbacks.onChatOpen?.();
|
|
336
398
|
if (this.#dock !== undefined)
|
|
337
399
|
scheduleSyncDockLayout(this.#dock, this.#root);
|
|
@@ -341,8 +403,6 @@ export class HudShell {
|
|
|
341
403
|
return;
|
|
342
404
|
this.#root.removeAttribute(CHAT_ATTR);
|
|
343
405
|
this.#chatPanel?.setAttribute('aria-hidden', 'true');
|
|
344
|
-
this.#chatToggle?.setAttribute('data-active', '0');
|
|
345
|
-
this.#chatToggle?.setAttribute('aria-pressed', 'false');
|
|
346
406
|
this.#callbacks.onChatClose?.();
|
|
347
407
|
if (this.#dock !== undefined)
|
|
348
408
|
scheduleSyncDockLayout(this.#dock, this.#root);
|
|
@@ -6,11 +6,15 @@ import { SETTINGS_CSS } from './presenter-settings-styles.js';
|
|
|
6
6
|
import { ACCOUNT_CSS } from './presenter-account-styles.js';
|
|
7
7
|
import { HUD_CHROME_CSS, HUD_LOG_WELL_CSS } from './chrome/presenter-hud-chrome.js';
|
|
8
8
|
import { REPORT_CSS } from './presenter-report-styles.js';
|
|
9
|
-
import { OFFER_CSS } from './carousel/offer-card.js';
|
|
10
9
|
import { TALK_CSS } from './carousel/talk-card.js';
|
|
11
10
|
import { CAROUSEL_CSS } from './carousel/carousel.js';
|
|
11
|
+
import { CHAT_VIEWS_CSS } from './presenter-chat-views.js';
|
|
12
|
+
import { PLAN_CSS } from './presenter-plan.js';
|
|
13
|
+
import { FRAME_CSS } from './presenter-frame.js';
|
|
14
|
+
import { PRESENTER_DESIGN_TOKENS_CSS } from './presenter-design-tokens.js';
|
|
12
15
|
export { Z_OVERLAY };
|
|
13
16
|
export const PRESENTER_CSS = `
|
|
17
|
+
${PRESENTER_DESIGN_TOKENS_CSS}
|
|
14
18
|
[data-reticle-overlay]{position:fixed;inset:0;pointer-events:none;z-index:${String(Z_OVERLAY)};}
|
|
15
19
|
/**
|
|
16
20
|
* The session glow: the page itself says an agent is here, and BREATHES while it is working.
|
|
@@ -66,8 +70,10 @@ ${SHELL_CSS}
|
|
|
66
70
|
${SETTINGS_CSS}
|
|
67
71
|
${REPORT_CSS}
|
|
68
72
|
${ACCOUNT_CSS}
|
|
69
|
-
${OFFER_CSS}
|
|
70
73
|
${TALK_CSS}
|
|
71
74
|
${CAROUSEL_CSS}
|
|
72
75
|
${LOG_CSS}
|
|
73
|
-
${
|
|
76
|
+
${CHAT_VIEWS_CSS}
|
|
77
|
+
${PLAN_CSS}
|
|
78
|
+
${CONTROLS_CSS}
|
|
79
|
+
${FRAME_CSS}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RETICLE_ROOT_GLOBAL, RETICLE_URL_PARAM } from '@reticlehq/core';
|
|
2
2
|
import { PresenterIcon, PRESENTER_ICON_SIZE, hiIconHtml } from './icons/presenter-icons.js';
|
|
3
|
-
import { ACCOUNT_SIGNIN_ATTR, ACCOUNT_TEXT, accountControlHtml, } from './presenter-account.js';
|
|
3
|
+
import { ACCOUNT_SIGNIN_ATTR, ACCOUNT_TEXT, accountControlHtml, paintAccountSlot, teamLinkHtml, TEAM_SLOT_ATTR, } from './presenter-account.js';
|
|
4
4
|
const WORKSPACE_BTN_ATTR = 'data-reticle-workspace-btn';
|
|
5
5
|
const WORKSPACE_MENU_ATTR = 'data-reticle-workspace-menu';
|
|
6
6
|
const WORKSPACE_NAME_ATTR = 'data-reticle-workspace-name';
|
|
@@ -10,6 +10,8 @@ const WORKSPACE_COPY_ATTR = 'data-reticle-workspace-copy';
|
|
|
10
10
|
export const TOOLBAR_ACCOUNT_ATTR = 'data-reticle-toolbar-account';
|
|
11
11
|
const COPIED_MS = 1_200;
|
|
12
12
|
const WORKSPACE_LABEL = 'Workspace';
|
|
13
|
+
const CHIP_KEY = 'Project';
|
|
14
|
+
const CHIP_TITLE = 'The project folder this page is served from, which Reticle reports to. Click for its path.';
|
|
13
15
|
const PROJECT_LABEL = 'Project';
|
|
14
16
|
const COPY_PATH_LABEL = 'Copy path';
|
|
15
17
|
const COPIED_PATH_LABEL = 'Copied';
|
|
@@ -48,8 +50,9 @@ export function workspaceRowHtml() {
|
|
|
48
50
|
const caret = hiIconHtml(PresenterIcon.CARET_DOWN, PRESENTER_ICON_SIZE.HELP);
|
|
49
51
|
const copyIcon = hiIconHtml(PresenterIcon.COPY, PRESENTER_ICON_SIZE.HELP);
|
|
50
52
|
return `<div class="reticle-workspace-wrap">
|
|
51
|
-
<button type="button" class="reticle-workspace" ${WORKSPACE_BTN_ATTR} aria-haspopup="true" aria-expanded="false" title="${
|
|
53
|
+
<button type="button" class="reticle-workspace" ${WORKSPACE_BTN_ATTR} aria-haspopup="true" aria-expanded="false" title="${CHIP_TITLE}">
|
|
52
54
|
<span class="reticle-workspace-icon" aria-hidden="true">${folderIcon}</span>
|
|
55
|
+
<span class="reticle-workspace-k">${CHIP_KEY}</span>
|
|
53
56
|
<span class="reticle-workspace-name" ${WORKSPACE_NAME_ATTR}>${WORKSPACE_FALLBACK}</span>
|
|
54
57
|
<span class="reticle-workspace-caret" aria-hidden="true">${caret}</span>
|
|
55
58
|
</button>
|
|
@@ -193,8 +196,12 @@ export function mountWorkspaceSelector(root) {
|
|
|
193
196
|
};
|
|
194
197
|
}
|
|
195
198
|
export function paintToolbarAccount(root, account, dashboardUrl, details = {}) {
|
|
199
|
+
const team = root.querySelector(`[${TEAM_SLOT_ATTR}]`);
|
|
200
|
+
if (team instanceof HTMLElement)
|
|
201
|
+
paintAccountSlot(team, teamLinkHtml(account, dashboardUrl));
|
|
196
202
|
const slot = root.querySelector(`[${TOOLBAR_ACCOUNT_ATTR}]`);
|
|
197
203
|
if (!(slot instanceof HTMLElement))
|
|
198
204
|
return;
|
|
199
|
-
|
|
205
|
+
const door = !(team instanceof HTMLElement);
|
|
206
|
+
paintAccountSlot(slot, accountControlHtml(account, { ...details, dashboardUrl }, door));
|
|
200
207
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PresenterMode, SessionState, type PresenterTone } from '@reticlehq/core';
|
|
2
|
-
import { type LogKind, type LogResult, type LogHandle } from './chrome/presenter-log.js';
|
|
1
|
+
import { HudCorner, HudVisibility, PresenterMode, SessionState, type PresenterTone } from '@reticlehq/core';
|
|
2
|
+
import { type LogActor, type LogKind, type LogResult, type LogHandle } from './chrome/presenter-log.js';
|
|
3
3
|
import { type PresenterOptions } from './presenter-config.js';
|
|
4
4
|
import { type PresenterRunState } from './presenter-run-state.js';
|
|
5
5
|
import { type ControlHandler } from './presenter-controls.js';
|
|
@@ -17,6 +17,7 @@ export declare class Presenter {
|
|
|
17
17
|
get sessionActive(): boolean;
|
|
18
18
|
setState(state: SessionState, text?: string, tone?: PresenterTone): void;
|
|
19
19
|
refilterFlows(): void;
|
|
20
|
+
showSdkVersion(version: string | undefined): void;
|
|
20
21
|
handlePush(command: {
|
|
21
22
|
name: string;
|
|
22
23
|
args: Record<string, unknown>;
|
|
@@ -35,10 +36,11 @@ export declare class Presenter {
|
|
|
35
36
|
get mode(): PresenterMode;
|
|
36
37
|
setMode(mode: PresenterMode): void;
|
|
37
38
|
status(text: string): void;
|
|
39
|
+
placeHud(visibility: HudVisibility | undefined, corner: HudCorner | undefined): string[];
|
|
38
40
|
setIdleEndMs(ms: number): void;
|
|
39
41
|
runState(): PresenterRunState | Record<string, unknown>;
|
|
40
|
-
log(kind: LogKind, text: string, result?: LogResult): LogHandle | undefined;
|
|
41
|
-
narrate(text: string, level?: string): LogHandle | undefined;
|
|
42
|
+
log(kind: LogKind, text: string, result?: LogResult, actor?: LogActor, summary?: boolean): LogHandle | undefined;
|
|
43
|
+
narrate(text: string, level?: string, actor?: LogActor, summary?: boolean): LogHandle | undefined;
|
|
42
44
|
setThrottled(throttled: boolean): void;
|
|
43
45
|
beforeAct(refId: string, action: string, label: string): Promise<void>;
|
|
44
46
|
}
|