@reticlehq/browser 2.13.1 → 3.1.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/actions-dom.d.ts +8 -20
- package/dist/actions/actions-dom.js +70 -69
- package/dist/actions/actions-press.d.ts +14 -0
- package/dist/actions/actions-press.js +123 -0
- package/dist/actions/actions.d.ts +1 -89
- package/dist/actions/actions.js +64 -365
- package/dist/actions/appeared-text.d.ts +0 -20
- package/dist/actions/appeared-text.js +6 -36
- package/dist/actions/danger-context.d.ts +3 -0
- package/dist/actions/danger-context.js +39 -0
- package/dist/actions/scroll.d.ts +8 -10
- package/dist/actions/scroll.js +28 -17
- package/dist/actions/synthetic/synthetic-input.d.ts +2 -0
- package/dist/actions/synthetic/synthetic-input.js +13 -0
- package/dist/actions/value-input.d.ts +0 -30
- package/dist/actions/value-input.js +0 -33
- package/dist/commands/commands.d.ts +0 -2
- package/dist/commands/commands.js +10 -70
- package/dist/connect-options.d.ts +2 -96
- package/dist/dom/a11y.d.ts +0 -29
- package/dist/dom/a11y.js +3 -90
- package/dist/dom/addressing/auto-anchor.d.ts +25 -0
- package/dist/dom/addressing/auto-anchor.js +41 -0
- package/dist/dom/addressing/refs.d.ts +14 -0
- package/dist/dom/addressing/refs.js +114 -0
- package/dist/dom/addressing/source.d.ts +9 -0
- package/dist/dom/addressing/source.js +29 -0
- package/dist/dom/chart.d.ts +0 -61
- package/dist/dom/chart.js +0 -60
- package/dist/dom/desktop-capture.d.ts +0 -30
- package/dist/dom/desktop-capture.js +1 -73
- package/dist/dom/dom-ignore.d.ts +0 -30
- package/dist/dom/dom-ignore.js +1 -48
- package/dist/dom/occlusion.d.ts +0 -7
- package/dist/dom/occlusion.js +31 -12
- package/dist/dom/paint-context.d.ts +6 -0
- package/dist/dom/paint-context.js +38 -0
- package/dist/dom/query.d.ts +0 -14
- package/dist/dom/query.js +50 -216
- package/dist/dom/realm.d.ts +0 -20
- package/dist/dom/realm.js +0 -28
- package/dist/dom/shadow-registry.d.ts +0 -33
- package/dist/dom/shadow-registry.js +2 -72
- package/dist/dom/snapshot.d.ts +2 -43
- package/dist/dom/snapshot.js +27 -152
- package/dist/dom/theme.d.ts +0 -37
- package/dist/dom/theme.js +2 -52
- package/dist/dom/virtualized.d.ts +0 -17
- package/dist/dom/virtualized.js +0 -27
- package/dist/edit-epoch.d.ts +1 -23
- package/dist/edit-epoch.js +1 -53
- package/dist/index.d.ts +4 -5
- package/dist/index.js +4 -28
- package/dist/observers/animation.d.ts +0 -1
- package/dist/observers/animation.js +1 -4
- package/dist/observers/blind-spots.d.ts +0 -26
- package/dist/observers/blind-spots.js +3 -62
- package/dist/observers/console.d.ts +1 -2
- package/dist/observers/console.js +41 -30
- package/dist/observers/context-open.d.ts +1 -11
- package/dist/observers/context-open.js +10 -14
- package/dist/observers/departure.d.ts +3 -0
- package/dist/observers/departure.js +52 -0
- package/dist/observers/dialogs.d.ts +2 -0
- package/dist/observers/dialogs.js +39 -0
- package/dist/observers/dom.js +28 -52
- package/dist/observers/download.d.ts +1 -2
- package/dist/observers/download.js +39 -56
- package/dist/observers/focus.d.ts +0 -6
- package/dist/observers/focus.js +0 -7
- package/dist/observers/frames.d.ts +0 -9
- package/dist/observers/frames.js +1 -28
- package/dist/observers/health.d.ts +0 -5
- package/dist/observers/health.js +2 -34
- package/dist/observers/install-all.d.ts +2 -0
- package/dist/observers/install-all.js +26 -27
- package/dist/observers/ipc.d.ts +0 -25
- package/dist/observers/ipc.js +0 -65
- package/dist/observers/navigation.d.ts +2 -0
- package/dist/observers/navigation.js +33 -0
- package/dist/observers/net-detail/network-body.d.ts +12 -0
- package/dist/observers/net-detail/network-body.js +71 -0
- package/dist/observers/net-detail/network-redact.d.ts +1 -0
- package/dist/observers/net-detail/network-redact.js +1 -0
- package/dist/observers/network-stream.d.ts +0 -21
- package/dist/observers/network-stream.js +3 -46
- package/dist/observers/network.d.ts +3 -27
- package/dist/observers/network.js +178 -295
- package/dist/observers/perf.d.ts +0 -10
- package/dist/observers/perf.js +0 -16
- package/dist/observers/route.d.ts +1 -2
- package/dist/observers/route.js +13 -19
- package/dist/observers/scroll.d.ts +0 -1
- package/dist/observers/scroll.js +2 -11
- package/dist/observers/sdk-failure.d.ts +1 -9
- package/dist/observers/sdk-failure.js +1 -30
- package/dist/observers/state.d.ts +1 -11
- package/dist/observers/state.js +13 -41
- package/dist/observers/storage.d.ts +0 -14
- package/dist/observers/storage.js +10 -34
- package/dist/observers/types.d.ts +0 -15
- package/dist/observers/types.js +0 -14
- package/dist/patching/capture-method.d.ts +0 -24
- package/dist/patching/capture-method.js +0 -26
- package/dist/presenter/chrome/layers.d.ts +2 -0
- package/dist/presenter/chrome/layers.js +2 -0
- package/dist/presenter/chrome/log-kinds.d.ts +12 -0
- package/dist/presenter/chrome/log-kinds.js +7 -0
- package/dist/presenter/{overlay.d.ts → chrome/overlay.d.ts} +0 -1
- package/dist/presenter/{overlay.js → chrome/overlay.js} +0 -1
- package/dist/presenter/chrome/presenter-brand.d.ts +3 -0
- package/dist/presenter/{presenter-brand.js → chrome/presenter-brand.js} +0 -21
- package/dist/presenter/chrome/presenter-effects.d.ts +4 -0
- package/dist/presenter/{presenter-effects.js → chrome/presenter-effects.js} +1 -10
- package/dist/presenter/chrome/presenter-hud-chrome.d.ts +7 -0
- package/dist/presenter/{presenter-hud-chrome.js → chrome/presenter-hud-chrome.js} +0 -10
- package/dist/presenter/chrome/presenter-log.d.ts +17 -0
- package/dist/presenter/{presenter-log.js → chrome/presenter-log.js} +5 -54
- package/dist/presenter/chrome/presenter-report-copy.d.ts +51 -0
- package/dist/presenter/chrome/presenter-report-copy.js +95 -0
- package/dist/presenter/chrome/presenter-safe-html.d.ts +2 -0
- package/dist/presenter/chrome/presenter-safe-html.js +16 -0
- package/dist/presenter/{presenter-tally.d.ts → chrome/presenter-tally.d.ts} +0 -5
- package/dist/presenter/{presenter-tally.js → chrome/presenter-tally.js} +1 -5
- package/dist/presenter/{presenter-verbs.js → chrome/presenter-verbs.js} +0 -7
- package/dist/presenter/{presenter-heroicons-data.d.ts → icons/presenter-heroicons-data.d.ts} +1 -8
- package/dist/presenter/{presenter-heroicons-data.js → icons/presenter-heroicons-data.js} +1 -8
- package/dist/presenter/{presenter-icons.d.ts → icons/presenter-icons.d.ts} +1 -6
- package/dist/presenter/{presenter-icons.js → icons/presenter-icons.js} +1 -6
- package/dist/presenter/presenter-account-styles.d.ts +1 -0
- package/dist/presenter/presenter-account-styles.js +99 -0
- package/dist/presenter/presenter-account.d.ts +40 -0
- package/dist/presenter/presenter-account.js +178 -0
- package/dist/presenter/presenter-config.d.ts +10 -107
- package/dist/presenter/presenter-config.js +5 -92
- package/dist/presenter/presenter-controls.d.ts +1 -35
- package/dist/presenter/presenter-controls.js +10 -133
- package/dist/presenter/presenter-dock-layout.d.ts +0 -3
- package/dist/presenter/presenter-dock-layout.js +1 -5
- package/dist/presenter/presenter-drag.d.ts +2 -42
- package/dist/presenter/presenter-drag.js +3 -76
- package/dist/presenter/presenter-glow.d.ts +0 -21
- package/dist/presenter/presenter-glow.js +2 -28
- package/dist/presenter/presenter-hud-position.d.ts +18 -0
- package/dist/presenter/presenter-hud-position.js +50 -0
- package/dist/presenter/presenter-report-styles.d.ts +0 -6
- package/dist/presenter/presenter-report-styles.js +22 -7
- package/dist/presenter/presenter-report.d.ts +5 -7
- package/dist/presenter/presenter-report.js +44 -95
- package/dist/presenter/presenter-run-state.d.ts +1 -8
- package/dist/presenter/presenter-run-state.js +1 -6
- package/dist/presenter/presenter-settings-styles.d.ts +0 -1
- package/dist/presenter/presenter-settings-styles.js +2 -2
- package/dist/presenter/presenter-settings.d.ts +5 -23
- package/dist/presenter/presenter-settings.js +21 -33
- package/dist/presenter/presenter-shell-styles.js +23 -20
- package/dist/presenter/presenter-shell.d.ts +6 -18
- package/dist/presenter/presenter-shell.js +26 -77
- package/dist/presenter/presenter-styles.d.ts +2 -10
- package/dist/presenter/presenter-styles.js +6 -12
- package/dist/presenter/presenter-workspace.d.ts +4 -4
- package/dist/presenter/presenter-workspace.js +30 -10
- package/dist/presenter/presenter.d.ts +3 -63
- package/dist/presenter/presenter.js +29 -132
- package/dist/presenter/tour/tour-view.d.ts +33 -0
- package/dist/presenter/tour/tour-view.js +188 -0
- package/dist/presenter/tour/tour.d.ts +25 -0
- package/dist/presenter/tour/tour.js +245 -0
- package/dist/recorder/recorder-styles.d.ts +0 -6
- package/dist/recorder/recorder-styles.js +0 -6
- package/dist/recorder/recorder.d.ts +0 -34
- package/dist/recorder/recorder.js +6 -49
- package/dist/registry/auto-testids.d.ts +0 -19
- package/dist/registry/auto-testids.js +1 -21
- package/dist/registry/capabilities.d.ts +0 -31
- package/dist/registry/capabilities.js +1 -46
- package/dist/registry/commit-and-signal.d.ts +0 -6
- package/dist/registry/commit-and-signal.js +1 -7
- package/dist/registry/declared-channels.d.ts +2 -0
- package/dist/registry/declared-channels.js +14 -0
- package/dist/registry/declared-platform.d.ts +4 -0
- package/dist/registry/declared-platform.js +34 -0
- package/dist/registry/domains.d.ts +0 -8
- package/dist/registry/domains.js +0 -7
- package/dist/registry/emitter.d.ts +0 -14
- package/dist/registry/emitter.js +1 -11
- package/dist/registry/store-adapters.d.ts +0 -186
- package/dist/registry/store-adapters.js +1 -164
- package/dist/registry/{adapters.d.ts → stores/adapters.d.ts} +0 -10
- package/dist/registry/{adapters.js → stores/adapters.js} +0 -10
- package/dist/registry/stores.d.ts +0 -33
- package/dist/registry/stores.js +1 -60
- package/dist/reticle-presenter-helpers.d.ts +0 -13
- package/dist/reticle-presenter-helpers.js +10 -20
- package/dist/reticle-singleton.d.ts +2 -0
- package/dist/reticle-singleton.js +3 -0
- package/dist/reticle.d.ts +1 -52
- package/dist/reticle.js +115 -180
- package/dist/review/annotator-styles.js +1 -8
- package/dist/review/annotator.d.ts +2 -13
- package/dist/review/annotator.js +2 -42
- package/dist/review/mark-anchor.d.ts +0 -11
- package/dist/review/mark-anchor.js +3 -11
- package/dist/security/serialization.d.ts +0 -20
- package/dist/security/serialization.js +1 -66
- package/dist/session-continuity.d.ts +0 -16
- package/dist/session-continuity.js +1 -20
- package/dist/timers/clock.d.ts +1 -14
- package/dist/timers/clock.js +59 -60
- package/dist/timers/console/native-console.js +5 -0
- package/dist/timers/native/native-timers.d.ts +11 -0
- package/dist/timers/native/native-timers.js +48 -0
- package/dist/transport/transport.d.ts +0 -51
- package/dist/transport/transport.js +5 -131
- package/dist/transport/unreachable-message.d.ts +0 -17
- package/dist/transport/unreachable-message.js +0 -17
- package/dist/util/captured-method.d.ts +0 -35
- package/dist/util/captured-method.js +0 -35
- package/package.json +5 -4
- package/dist/actions/synthetic-input.d.ts +0 -9
- package/dist/actions/synthetic-input.js +0 -40
- package/dist/dom/auto-anchor.d.ts +0 -65
- package/dist/dom/auto-anchor.js +0 -74
- package/dist/dom/refs.d.ts +0 -90
- package/dist/dom/refs.js +0 -245
- package/dist/dom/source.d.ts +0 -53
- package/dist/dom/source.js +0 -74
- package/dist/observers/network-body.d.ts +0 -35
- package/dist/observers/network-body.js +0 -168
- package/dist/observers/network-redact.d.ts +0 -20
- package/dist/observers/network-redact.js +0 -80
- package/dist/presenter/presenter-brand.d.ts +0 -22
- package/dist/presenter/presenter-effects.d.ts +0 -13
- package/dist/presenter/presenter-hud-chrome.d.ts +0 -17
- package/dist/presenter/presenter-log.d.ts +0 -64
- package/dist/presenter/presenter-report-copy.d.ts +0 -112
- package/dist/presenter/presenter-report-copy.js +0 -156
- package/dist/presenter/presenter-test-helpers.d.ts +0 -16
- package/dist/presenter/presenter-test-helpers.js +0 -41
- package/dist/timers/native-console.js +0 -9
- package/dist/timers/native-timers.d.ts +0 -36
- package/dist/timers/native-timers.js +0 -78
- /package/dist/presenter/{presenter-verbs.d.ts → chrome/presenter-verbs.d.ts} +0 -0
- /package/dist/timers/{native-console.d.ts → console/native-console.d.ts} +0 -0
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z_OVERLAY } from './chrome/layers.js';
|
|
2
|
+
import { LOG_CSS } from './chrome/presenter-log.js';
|
|
2
3
|
import { CONTROLS_CSS } from './presenter-controls.js';
|
|
3
4
|
import { SHELL_CSS } from './presenter-shell-styles.js';
|
|
4
5
|
import { SETTINGS_CSS } from './presenter-settings-styles.js';
|
|
5
|
-
import {
|
|
6
|
+
import { ACCOUNT_CSS } from './presenter-account-styles.js';
|
|
7
|
+
import { HUD_CHROME_CSS, HUD_LOG_WELL_CSS } from './chrome/presenter-hud-chrome.js';
|
|
6
8
|
import { REPORT_CSS } from './presenter-report-styles.js';
|
|
7
|
-
|
|
8
|
-
* All presenter overlay CSS - glow border, synthetic cursor/ring/ripple, and the floating HUD shell.
|
|
9
|
-
* Split across shell-styles + controls + log modules so each file stays under the size cap.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* The presenter overlay's stacking layer. Exported because the annotator has to sit ABOVE it: the
|
|
13
|
-
* overlay holds the page blocker, and anything below this number is covered by that shield - which
|
|
14
|
-
* is what buried the annotate composer and made its Cancel/Add buttons unclickable.
|
|
15
|
-
*/
|
|
16
|
-
export const Z_OVERLAY = 2147483600;
|
|
9
|
+
export { Z_OVERLAY };
|
|
17
10
|
export const PRESENTER_CSS = `
|
|
18
11
|
[data-reticle-overlay]{position:fixed;inset:0;pointer-events:none;z-index:${String(Z_OVERLAY)};}
|
|
19
12
|
/**
|
|
@@ -69,5 +62,6 @@ ${HUD_LOG_WELL_CSS}
|
|
|
69
62
|
${SHELL_CSS}
|
|
70
63
|
${SETTINGS_CSS}
|
|
71
64
|
${REPORT_CSS}
|
|
65
|
+
${ACCOUNT_CSS}
|
|
72
66
|
${LOG_CSS}
|
|
73
67
|
${CONTROLS_CSS}`;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import type { AccountState } from '@reticlehq/core';
|
|
2
|
+
import { type AccountDetails } from './presenter-account.js';
|
|
3
|
+
export declare const TOOLBAR_ACCOUNT_ATTR = "data-reticle-toolbar-account";
|
|
2
4
|
export declare function readWorkspaceRoot(): string | undefined;
|
|
3
|
-
/** Last path segment for compact display (Codex/Cursor-style chip). */
|
|
4
5
|
export declare function workspaceFolderLabel(root: string): string;
|
|
5
|
-
/** Project id from the URL lease stamp, when present. */
|
|
6
6
|
export declare function readProjectIdFromUrl(): string | undefined;
|
|
7
7
|
export declare function workspaceSummary(): {
|
|
8
8
|
folder: string;
|
|
9
9
|
root?: string;
|
|
10
10
|
projectId?: string;
|
|
11
11
|
};
|
|
12
|
-
/** Workspace chip + detail menu - sits above the composer row. */
|
|
13
12
|
export declare function workspaceRowHtml(): string;
|
|
14
13
|
export declare function paintWorkspace(root: HTMLElement): void;
|
|
15
14
|
export declare function mountWorkspaceSelector(root: HTMLElement): () => void;
|
|
15
|
+
export declare function paintToolbarAccount(root: HTMLElement, account: AccountState | undefined, dashboardUrl: string | undefined, details?: AccountDetails): void;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { RETICLE_ROOT_GLOBAL, RETICLE_URL_PARAM } from '@reticlehq/core';
|
|
2
|
-
import { PresenterIcon, PRESENTER_ICON_SIZE, hiIconHtml } from './presenter-icons.js';
|
|
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
4
|
const WORKSPACE_BTN_ATTR = 'data-reticle-workspace-btn';
|
|
4
5
|
const WORKSPACE_MENU_ATTR = 'data-reticle-workspace-menu';
|
|
5
6
|
const WORKSPACE_NAME_ATTR = 'data-reticle-workspace-name';
|
|
6
7
|
const WORKSPACE_PATH_ATTR = 'data-reticle-workspace-path';
|
|
7
8
|
const WORKSPACE_PROJECT_ATTR = 'data-reticle-workspace-project';
|
|
8
9
|
const WORKSPACE_COPY_ATTR = 'data-reticle-workspace-copy';
|
|
10
|
+
export const TOOLBAR_ACCOUNT_ATTR = 'data-reticle-toolbar-account';
|
|
11
|
+
const COPIED_MS = 1_200;
|
|
9
12
|
const WORKSPACE_LABEL = 'Workspace';
|
|
10
13
|
const PROJECT_LABEL = 'Project';
|
|
11
14
|
const COPY_PATH_LABEL = 'Copy path';
|
|
12
15
|
const COPIED_PATH_LABEL = 'Copied';
|
|
13
16
|
const WORKSPACE_FALLBACK = 'This page';
|
|
14
|
-
/** Read the Vite-injected repo root, when present. */
|
|
15
17
|
export function readWorkspaceRoot() {
|
|
16
18
|
const value = globalThis[RETICLE_ROOT_GLOBAL];
|
|
17
19
|
return 'string' === typeof value && value.length > 0 ? value : undefined;
|
|
18
20
|
}
|
|
19
|
-
/** Last path segment for compact display (Codex/Cursor-style chip). */
|
|
20
21
|
export function workspaceFolderLabel(root) {
|
|
21
22
|
const normalized = root.replace(/\\/g, '/').replace(/\/+$/, '');
|
|
22
23
|
const parts = normalized.split('/').filter((part) => part.length > 0);
|
|
23
24
|
const last = parts[parts.length - 1];
|
|
24
25
|
return last !== undefined && last.length > 0 ? last : WORKSPACE_FALLBACK;
|
|
25
26
|
}
|
|
26
|
-
/** Project id from the URL lease stamp, when present. */
|
|
27
27
|
export function readProjectIdFromUrl() {
|
|
28
28
|
if ('undefined' === typeof window)
|
|
29
29
|
return undefined;
|
|
@@ -43,7 +43,6 @@ export function workspaceSummary() {
|
|
|
43
43
|
out.projectId = projectId;
|
|
44
44
|
return out;
|
|
45
45
|
}
|
|
46
|
-
/** Workspace chip + detail menu - sits above the composer row. */
|
|
47
46
|
export function workspaceRowHtml() {
|
|
48
47
|
const folderIcon = hiIconHtml(PresenterIcon.LAYOUT, PRESENTER_ICON_SIZE.HELP);
|
|
49
48
|
const caret = hiIconHtml(PresenterIcon.CARET_DOWN, PRESENTER_ICON_SIZE.HELP);
|
|
@@ -54,10 +53,12 @@ export function workspaceRowHtml() {
|
|
|
54
53
|
<span class="reticle-workspace-name" ${WORKSPACE_NAME_ATTR}>${WORKSPACE_FALLBACK}</span>
|
|
55
54
|
<span class="reticle-workspace-caret" aria-hidden="true">${caret}</span>
|
|
56
55
|
</button>
|
|
57
|
-
<div class="reticle-workspace-menu" ${WORKSPACE_MENU_ATTR} role="
|
|
56
|
+
<div class="reticle-workspace-menu" ${WORKSPACE_MENU_ATTR} role="region" aria-label="${WORKSPACE_LABEL}" aria-hidden="true" hidden>
|
|
58
57
|
<div class="reticle-workspace-menu-head">
|
|
59
58
|
<div class="reticle-workspace-menu-title">${WORKSPACE_LABEL}</div>
|
|
60
|
-
<
|
|
59
|
+
<div class="reticle-workspace-menu-actions">
|
|
60
|
+
<button type="button" class="reticle-workspace-copy" ${WORKSPACE_COPY_ATTR} title="${COPY_PATH_LABEL}" aria-label="${COPY_PATH_LABEL}">${copyIcon}</button>
|
|
61
|
+
</div>
|
|
61
62
|
</div>
|
|
62
63
|
<div class="reticle-workspace-menu-row"><span class="reticle-workspace-menu-k">Folder</span><span class="reticle-workspace-menu-v" data-reticle-workspace-folder></span></div>
|
|
63
64
|
<div class="reticle-workspace-menu-row"><span class="reticle-workspace-menu-k">Path</span><span class="reticle-workspace-menu-v reticle-workspace-menu-path" ${WORKSPACE_PATH_ATTR}></span></div>
|
|
@@ -67,9 +68,6 @@ export function workspaceRowHtml() {
|
|
|
67
68
|
}
|
|
68
69
|
export function paintWorkspace(root) {
|
|
69
70
|
const summary = workspaceSummary();
|
|
70
|
-
// Nothing to say - no injected repo root, no leased project id - so the chip says nothing. It
|
|
71
|
-
// used to render its fallback, "This page", which names no workspace and is exactly as true of
|
|
72
|
-
// every page. The chip earns its slot only when it can tell you WHICH checkout is being driven.
|
|
73
71
|
const wrap = root.querySelector('.reticle-workspace-wrap');
|
|
74
72
|
if (wrap instanceof HTMLElement) {
|
|
75
73
|
const known = summary.root !== undefined || summary.projectId !== undefined;
|
|
@@ -135,6 +133,22 @@ export function mountWorkspaceSelector(root) {
|
|
|
135
133
|
e.stopPropagation();
|
|
136
134
|
toggle();
|
|
137
135
|
};
|
|
136
|
+
const onMenuClick = (e) => {
|
|
137
|
+
const target = e.target;
|
|
138
|
+
if (!(target instanceof Element))
|
|
139
|
+
return;
|
|
140
|
+
const signin = target.closest(`[${ACCOUNT_SIGNIN_ATTR}]`);
|
|
141
|
+
if (null === signin)
|
|
142
|
+
return;
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
void navigator.clipboard?.writeText(ACCOUNT_TEXT.SIGNIN_COMMAND).catch(() => undefined);
|
|
145
|
+
const previous = signin.textContent;
|
|
146
|
+
signin.textContent = ACCOUNT_TEXT.COPIED;
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
signin.textContent = previous;
|
|
149
|
+
}, COPIED_MS);
|
|
150
|
+
};
|
|
151
|
+
menu.addEventListener('click', onMenuClick);
|
|
138
152
|
const onDocPointer = (e) => {
|
|
139
153
|
const target = e.target;
|
|
140
154
|
if (!(target instanceof Node))
|
|
@@ -178,3 +192,9 @@ export function mountWorkspaceSelector(root) {
|
|
|
178
192
|
document.removeEventListener('keydown', onKeyDown);
|
|
179
193
|
};
|
|
180
194
|
}
|
|
195
|
+
export function paintToolbarAccount(root, account, dashboardUrl, details = {}) {
|
|
196
|
+
const slot = root.querySelector(`[${TOOLBAR_ACCOUNT_ATTR}]`);
|
|
197
|
+
if (!(slot instanceof HTMLElement))
|
|
198
|
+
return;
|
|
199
|
+
slot.innerHTML = accountControlHtml(account, { ...details, dashboardUrl }, true);
|
|
200
|
+
}
|
|
@@ -1,104 +1,44 @@
|
|
|
1
1
|
import { PresenterMode, SessionState, type PresenterTone } from '@reticlehq/core';
|
|
2
|
-
import { type LogKind, type LogResult, type LogHandle } from './presenter-log.js';
|
|
2
|
+
import { 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';
|
|
6
6
|
import { Annotator } from '../review/annotator.js';
|
|
7
7
|
export { GlowPhase } from './presenter-config.js';
|
|
8
8
|
export type { PresenterOptions } from './presenter-config.js';
|
|
9
|
-
export { LOG_KIND, LOG_RESULT } from './presenter-log.js';
|
|
10
|
-
export type { LogHandle } from './presenter-log.js';
|
|
9
|
+
export { LOG_KIND, LOG_RESULT } from './chrome/presenter-log.js';
|
|
10
|
+
export type { LogHandle } from './chrome/presenter-log.js';
|
|
11
11
|
export type { ControlIntent, ControlHandler } from './presenter-controls.js';
|
|
12
12
|
export declare class Presenter {
|
|
13
13
|
#private;
|
|
14
14
|
constructor(options?: PresenterOptions);
|
|
15
|
-
/** Setter so reticle.ts can wire the control callback after construction. */
|
|
16
15
|
setControlHandler(handler: ControlHandler): void;
|
|
17
|
-
/** Current live-control session state mirrored onto the panel (data-reticle-state). */
|
|
18
16
|
get state(): SessionState;
|
|
19
|
-
/** Whether a run is currently being presented (false before the agent's first activity / after end). */
|
|
20
17
|
get sessionActive(): boolean;
|
|
21
|
-
/** Drive the panel's live-control visual state (server-push / agent path; never emits). */
|
|
22
18
|
setState(state: SessionState, text?: string, tone?: PresenterTone): void;
|
|
23
|
-
/** Apply a bridge→browser presenter push: PRESENTER (state echo) or FLOWS (replay list, the human's
|
|
24
|
-
* no-agent replay surface). Owns the wire parsing so the SDK dispatcher stays a thin router;
|
|
25
|
-
* setState-only so an echo can't re-emit. */
|
|
26
|
-
/** Re-scope the replay-flow chips to the current page (called by the SDK on route change). */
|
|
27
19
|
refilterFlows(): void;
|
|
28
20
|
handlePush(command: {
|
|
29
21
|
name: string;
|
|
30
22
|
args: Record<string, unknown>;
|
|
31
23
|
}): void;
|
|
32
|
-
/** Current cap on accumulated log rows. */
|
|
33
24
|
get logMax(): number;
|
|
34
25
|
set logMax(n: number);
|
|
35
26
|
mount(): void;
|
|
36
|
-
/** Wire annotation chrome; expanding the HUD enters annotate mode. */
|
|
37
27
|
bindAnnotator(annotator: Annotator): void;
|
|
38
28
|
destroy(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Session start: in 'session' border mode this fades the base border IN and keeps it on until
|
|
41
|
-
* sessionEnd. Idempotent, and a no-op when unmounted or in 'busy' border mode.
|
|
42
|
-
*/
|
|
43
29
|
sessionStart(): void;
|
|
44
|
-
/**
|
|
45
|
-
* The bridge never answered: show that, rather than showing nothing.
|
|
46
|
-
*
|
|
47
|
-
* An instrumented page with a dead bridge used to be indistinguishable from a page with no
|
|
48
|
-
* Reticle in it — overlay mounted, dock off, nothing on screen. The user cannot tell "I forgot to
|
|
49
|
-
* start the daemon" from "the install did not work", and the commonest cause is the cheapest to
|
|
50
|
-
* say: the port. So the HUD appears, states the URL it tried, and marks itself unreachable so it
|
|
51
|
-
* is never mistaken for a live session.
|
|
52
|
-
*
|
|
53
|
-
* Not an error dialog and not modal: the page is the user's, and a dev overlay that shouts is one
|
|
54
|
-
* they turn off. It is the same capsule they would have had, saying the one thing it knows.
|
|
55
|
-
*/
|
|
56
30
|
showUnreachable(url: string, attempts: number): void;
|
|
57
|
-
/**
|
|
58
|
-
* Session end: hides the log/HUD and (in 'session' mode) clears the base border. Idempotent; a
|
|
59
|
-
* no-op without a prior sessionStart or when unmounted.
|
|
60
|
-
*/
|
|
61
31
|
sessionEnd(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Record agent activity. Idempotent while busy - only the first activity from idle/fading flips
|
|
64
|
-
* the glow on, so a burst never restarts the reticle-pulse animation (no strobe). Subsequent calls
|
|
65
|
-
* just refresh the last-activity timestamp and re-arm the idle check.
|
|
66
|
-
*/
|
|
67
32
|
markActivity(): void;
|
|
68
|
-
/** Re-arm the quiet-window idle check (kept for reticle.ts's finally block). */
|
|
69
33
|
scheduleIdle(): void;
|
|
70
|
-
/** Test/diagnostic accessor for the current glow phase. */
|
|
71
34
|
glowPhase(): import("./presenter-config.js").GlowPhase;
|
|
72
|
-
/** Current intent (reading vs acting), exposed for tests + the watcher. */
|
|
73
35
|
get mode(): PresenterMode;
|
|
74
|
-
/**
|
|
75
|
-
* Set the presenter intent. READING shows a cyan scan + chip and hides the cursor; ACTING
|
|
76
|
-
* keeps the warm cursor/ripple + chip; IDLE clears the chip. Drives color via data-reticle-mode.
|
|
77
|
-
*/
|
|
78
36
|
setMode(mode: PresenterMode): void;
|
|
79
37
|
status(text: string): void;
|
|
80
|
-
/** Agent-tunable idle-end window (reticle_session). Floored so it can't be set uselessly small. */
|
|
81
38
|
setIdleEndMs(ms: number): void;
|
|
82
|
-
/**
|
|
83
|
-
* The exported "run state" for the Copy/Export buttons - everything the page holds about this
|
|
84
|
-
* run: session id, url, duration, capability surface, per-kind counts, and the full activity log.
|
|
85
|
-
* (The full network/console ring-buffer lives server-side; this is the in-page run summary.)
|
|
86
|
-
*/
|
|
87
39
|
runState(): PresenterRunState | Record<string, unknown>;
|
|
88
|
-
/**
|
|
89
|
-
* Append an activity-log row. Accumulates (never overwrites): each call adds a timestamped row
|
|
90
|
-
* with a mode chip + text. Returns a handle to stamp the row's outcome glyph (✓/✗) later, or
|
|
91
|
-
* undefined when unmounted / when the text is empty after trimming.
|
|
92
|
-
*/
|
|
93
40
|
log(kind: LogKind, text: string, result?: LogResult): LogHandle | undefined;
|
|
94
|
-
/** Back-compat: narration appends to the live log (append-only, never overwrites). */
|
|
95
41
|
narrate(text: string, level?: string): LogHandle | undefined;
|
|
96
|
-
/**
|
|
97
|
-
* Mirror the server's session.throttled state onto the HUD border. When throttled (tab
|
|
98
|
-
* backgrounded or stale), the border turns amber so the developer knows actions are no-oping -
|
|
99
|
-
* the same signal the agent already reads from result.session.throttled.
|
|
100
|
-
*/
|
|
101
42
|
setThrottled(throttled: boolean): void;
|
|
102
|
-
/** Fly the cursor to an element, play the action's effect, then pace for the human. */
|
|
103
43
|
beforeAct(refId: string, action: string, label: string): Promise<void>;
|
|
104
44
|
}
|