import * as lit_html from 'lit-html';
import * as lit from 'lit';
import { LitElement, nothing, TemplateResult } from 'lit';
import { Configure } from 'configure/browser';
import { IconNode } from 'lucide';
type AuthVerifyOptions = {
externalId?: string;
embed?: boolean;
};
type AuthVerifyResult = {
token: string;
userId: string;
embedReceipt?: string;
};
declare class ConfigureBase extends LitElement {
apiKey: string;
baseUrl: string;
authToken: string;
userId: string;
agent: string;
agentName: string;
agentLogo: string;
copyMode: string;
font: string;
presentation: 'card' | 'bare';
theme: string;
authPattern: string;
protected _client: Configure | null;
static baseStyles: lit.CSSResult;
protected get hasApiKey(): boolean;
protected get isConfigureOwnedSurface(): boolean;
protected get canUseAuth(): boolean;
protected renderApiKeyNotice(): typeof nothing | lit_html.TemplateResult<1>;
protected get client(): Configure;
protected authEndpoint(path: string): string;
/**
* How the code reaches the user. 'sms' is the real path. 'fixed' is the
* reviewer fixture: the server answers `verification_id: 'test_phone'` for
* the demo number, sends nothing, and accepts a fixed code - so the code
* step must not tell the reviewer a text was sent.
*/
protected sendAuthOtp(phone: string): Promise<{
delivery: 'sms' | 'fixed';
}>;
protected verifyAuthOtp(phone: string, code: string, options?: AuthVerifyOptions): Promise;
protected updated(changed: Map): void;
connectedCallback(): void;
disconnectedCallback(): void;
private _handleAuth;
private _seedOAuthPopupStorage;
protected _reserveOAuthPopup(statusLabel?: string): Window | null;
protected _openOAuthPopup(url: string, reservedPopup?: Window | null): Window | null;
protected emit(name: string, detail: T): void;
protected _shouldSkipFocus(): boolean;
}
declare const ICONS: {
'arrow-left': IconNode;
'chevron-down': IconNode;
'circle-check': IconNode;
ellipsis: IconNode;
eye: IconNode;
'file-text': IconNode;
'globe-2': IconNode;
lock: IconNode;
'lock-simple': IconNode;
'mail-x': IconNode;
plus: IconNode;
search: IconNode;
'shield-check': IconNode;
'trash-2': IconNode;
'user-round': IconNode;
x: IconNode;
zap: IconNode;
};
type ConfigureIconName = keyof typeof ICONS;
declare class ConfigureIcon extends ConfigureBase {
name: ConfigureIconName | '';
size: number;
strokeWidth: number;
static styles: lit.CSSResult[];
render(): typeof nothing | TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
'configure-icon': ConfigureIcon;
}
}
declare class ConfigurePhoneInput extends ConfigureBase {
/** The phone step in the language the page was translated into (locale.ts). */
private _locale;
loading: boolean;
error: string;
disabled: boolean;
agent: string;
loginHint: string;
fixture: boolean;
/** Hosted surfaces open with the number field focused so a phone's keyboard
* is already up when the screen paints. */
autoFocus: boolean;
/** SSO copy overrides: the hosted connect flow words this step around what the
* number DOES (saves the context just imported), not around the mechanics. */
heading: string;
copy: string;
ctaLabel: string;
/** Show the three protections under the field (hosted connect flow). */
showTrust: boolean;
/** Focused connection screens put the number first on every viewport. */
trustPosition: 'above' | 'below-field';
/** "start" lines the title up with the left-flush copy under it (the connect screens); the default centres it. */
titleAlign: 'center' | 'start';
/** The page above already says who is asking and why (the plugin connect screen): no heading or copy of its own. */
hideHeading: boolean;
private _rawDigits;
private _formatted;
private _selectedCountry;
private _showPicker;
private _pickerSearch;
/** Keyboard cursor inside the picker list. -1 = nothing active yet. */
private _activeIndex;
private _invalid;
private _appliedLoginHint;
private _input;
private _pickerInput;
private _pickerTrigger;
private _clickOutsideHandler?;
private _viewedAt;
private _firstInputAt;
private _firstFocusAt;
connectedCallback(): void;
disconnectedCallback(): void;
updated(changed: Map): void;
firstUpdated(): Promise;
/** The native autofocus raises the keyboard on touch phones (Sep 6). With a mouse it only scrolls the field into
* view, which in a short window pushes the page's own marks out of sight (Oct 17, ChatGPT's install window), so
* there the field takes focus in place (focusInput, preventScroll). */
private _touchKeyboard;
/** Move focus into the number field. Call synchronously from a user gesture
* when possible: iOS only raises the keyboard for gesture-driven focus. */
focusInput(): void;
static styles: lit.CSSResult[];
private _format;
private _applyLoginHint;
private _getPlaceholder;
/** Manuel (Sep 22): the horizontal badges and the "How it's protected" toggle are gone — the
* three protections are simply shown, every time, under the field. */
/** "No spam, ever" used to go on " can't text you", which 64 visits on Sep 30 read as a failure to text them (the
* replay reviews: people stopped or left before any code was sent). It promises what we do, not what the app can't. */
private _renderTrust;
private _isValid;
private _getE164;
private _digitIndexAt;
private _caretForDigitIndex;
private _renderDigits;
private _handleInput;
private _handleKeydown;
private _handleBlur;
private _handleFocus;
private _submit;
private _handleSubmit;
/** Inside the tap (or the Enter/Go key): the code screen's field paints after the send answers, too late for iOS
* to raise the keyboard (keyboard-hold.ts). Hold the number pad open now; the code field takes it over. A second
* call while the send is in flight (Enter's keydown, then the form's submit) holds nothing more. */
private _holdKeyboardForCode;
private _fixtureEnabled;
private _closePicker;
private _togglePicker;
/** Keep the active row in sight without hijacking the page's own scroll. */
private _scrollActiveIntoView;
private _handlePickerKeydown;
/** The trigger itself opens on the arrow keys, the way a select does. */
private _handleTriggerKeydown;
private _selectCountry;
private _handlePickerSearch;
private _filteredCountries;
private _addClickOutside;
private _removeClickOutside;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureOtpInput extends ConfigureBase {
/** The code step in the language the page was translated into (locale.ts). */
private _locale;
phone: string;
externalId: string;
embedFlow: boolean;
loading: boolean;
error: string;
fixture: boolean;
/**
* 'sms' (default): a code was texted, so say so and offer a resend.
* 'fixed': the server accepts a fixed code for this number and sent
* nothing - the reviewer fixture. Saying "sent to" or "resend" here reads
* as SMS two-factor to a directory reviewer, which is a rejection reason.
*/
delivery: 'sms' | 'fixed';
/** Opened without a new code: the number has had all the codes the provider sends for now (a 429 on the phone
* screen, after Back). The ones already texted still work; say so, and offer no resend that would be refused. */
resendLimited: boolean;
/** SSO copy overrides (the hosted connect flow words this step plainly). */
heading: string;
copy: string;
/** What the host is doing after the code is verified (a partner bind, a save). Shown as a live
* status under the verified mark, only once verified — the screen never sits silent. */
afterCode: string;
private _code;
private _canResend;
private _countdown;
/** Resends this code screen has sent. Two, then it stops (three codes in all): on Sep 29-30 two people sent 7 and 14,
* typed an older code, and the provider's rate limit locked them out mid-flow. Neither finished. */
private _resends;
/** What the line under the code says after a resend: the new code, or that there will be no more. */
private _resendNote;
/** The line under the code: this screen's own resends, else why it opened without a new code (resendLimited). */
private get _note();
static readonly MAX_RESENDS = 2;
private _verified;
private _hiddenInput;
private _timer?;
private _viewedAt;
private _firstInputAt;
static styles: lit.CSSResult[];
private _otpAbort?;
private _emitVerified;
connectedCallback(): void;
disconnectedCallback(): void;
firstUpdated(): Promise;
/** Manuel (Sep 22): the keyboard must be up on the code screen. The hidden input is DISABLED until
* the auth context arrives (canUseAuth), and a disabled input cannot take focus — so the first
* paint's focus() was a no-op. Focus once, the first time the input is enabled. */
private _focusedOnce;
private _focusWhenReady;
protected updated(changed: Map): void;
private _tryWebOTP;
private _startCountdown;
private _handleInput;
/** The tick, never a reason to fail a sign-in the server accepted: a render that throws is recorded, and the flow goes
* on (auth_otp_verified_render_failed, so a page that cannot draw it is seen, not hidden). */
private _showVerifiedStateSafely;
private _showVerifiedState;
private _handleKeydown;
private _focusInput;
private _fixtureEnabled;
private _resend;
render(): lit_html.TemplateResult<1>;
}
interface AuthenticatedDetail {
token: string;
userId?: string;
}
interface PhoneSubmitDetail {
phone: string;
}
interface OtpVerifyDetail {
code: string;
}
interface ToolConnectDetail {
tool: string;
}
interface ToolDisconnectDetail {
tool: string;
}
interface ToolApprovalDetail {
actionId: string;
}
interface MemoryEditDetail {
key: string;
}
interface MemoryDeleteDetail {
key: string;
}
interface IdentityUpdateDetail {
field: string;
value: string;
}
interface ErrorDetail {
message: string;
code?: string;
}
interface ConnectionData {
id: string;
name: string;
connected: boolean;
accountEmail?: string;
accountName?: string;
accountUsername?: string;
reconnectRequired?: boolean;
error?: string;
loading?: boolean;
}
interface MemoryData {
key: string;
value: string;
}
interface ToolApprovalParams {
to?: string;
subject?: string;
body?: string;
title?: string;
start_time?: string;
end_time?: string;
location?: string;
description?: string;
}
interface ConfirmationDetail {
confirmed: boolean;
}
type ExportProvider = 'chatgpt' | 'claude' | 'gemini';
interface ExportClickDetail {
provider: string;
}
interface ImportStartDetail {
provider: string;
stageId: string;
}
interface ImportCompleteDetail {
provider: string;
source: string;
}
interface ImportErrorDetail {
message: string;
phase: 'stage' | 'auth' | 'claim' | 'processing';
}
interface PromptCopiedDetail {
prompt: string;
}
interface ProfileApprovedDetail {
userId: string;
agent: string;
approvedCategories?: string[];
subtitle?: string;
}
interface OtpVerifiedDetail {
token: string;
userId: string;
phone: string;
}
interface AccessRequestDetail {
tool: string;
agent: string;
}
interface PersonalizationOpenDetail {
agent: string;
agentName?: string;
}
interface PersonalizationAssetSelectDetail {
agent: string;
agentName?: string;
}
interface PersonalizationMenuToggleDetail {
open: boolean;
}
interface PersonalizationToggleDetail {
enabled: boolean;
agent: string;
agentName?: string;
}
declare class ConfigureConnectionRow extends ConfigureBase {
name: string;
description: string;
toolId: string;
connected: boolean;
loading: boolean;
userScoped: boolean;
/** Hosted connect flow, before the phone step: no user token exists yet, so connect and
* confirm go to /v1/flows/session/tools/* on this origin with the flow cookie, acting as the
* unlinked user the imports already land on (Manuel, Sep 22: "you should always be able to
* connect your apps and import your memories"). Implies user-scoped. */
flowSession: boolean;
private get _hasCredential();
reconnectRequired: boolean;
forceNew: boolean;
reconnectAccountId: string;
capability: string;
error: string;
variant: 'row' | 'action';
actionLabel: string;
loadingLabel: string;
fallbackLabel: string;
errorLabel: string;
iconId: string;
returnUrl: string;
fixture: boolean;
/**
* On a phone, run the grant in THIS tab: leave for the provider and come back to this page, the
* provider callback navigating the tab home (`oauth_same_tab=1`). A popup on a phone is a second
* tab, and after the callback closes it the browser shows whichever tab it picks: Chrome on iOS
* showed a person with 100+ tabs an unrelated configure.dev tab, three grants in a row, while the
* flow tab sat connected behind it (prod, Sep 26 2026). The same-window redirect with a resume is
* the mobile pattern Plaid documents for its OAuth hand-off. Opt-in: only a host that resumes
* itself from its own URL sets it (the hosted flow before its receipt).
*/
sameTabOnTouch: boolean;
private _connectionRequestId;
private _error;
private _pendingUrl;
private _preservedMessage;
private _pollTimer?;
private _visibilityHandler?;
private _focusHandler?;
private _pageshowHandler?;
private _polling;
private _connectAttempt;
private _connectStartedAt;
private _connectTransportRetries;
private _pollStartedAt;
private _pollAttempts;
private _oauthPopup;
private _oauthPopupClosedAt;
static styles: lit.CSSResult[];
disconnectedCallback(): void;
/** When this row asked for the provider's sign-in address and has not had it back (0 = not waiting). */
private _linkRequestedAt;
/**
* True from the tap until the provider's sign-in address comes back (or the request fails or is cancelled): the 1-3 s
* before any window or redirect exists. A host reads it to tell a second tap on a link still on its way from a tap
* that should restart a grant whose window was closed.
*/
fetchingLink(): boolean;
cancelPendingConnection(): void;
updated(changed: Map): void;
/** A phone: the primary input is a finger (no hover, coarse pointer), where a popup is a second tab. */
private _grantInThisTab;
/**
* What this page's URL says about a same-tab grant it is coming back from: null when it is not one
* (a reload, a Back from the provider, a first visit), else the callback's verdict.
*/
private _sameTabReturn;
/**
* This page came back from a same-tab grant for THIS app but holds no record to resume it from (storage cleared,
* or a browser that reopened the return elsewhere). Nothing resumes, so say it: an empty resume and a broken one
* must not look the same. The person's recovery is one more tap (the server answers "already connected").
*/
private _announceOrphanedReturn;
/** The return markers are read once: a later reload of this address is not another return. */
private _dropSameTabReturnMarkers;
/** The grant left this page for the provider. Back from the provider shows the page again from the
* back-forward cache, frozen mid-connect: ask once whether the grant landed, otherwise hand the
* button back ("Didn't connect"), never a spinner that waits minutes for a grant that isn't coming. */
private _leaveForGrant;
/** One confirm for a grant this tab came back from without a live poll: connected if it landed, else the
* row says so and is actionable again. */
private _settleReturnedGrant;
private get _pendingKey();
private _storePendingConnection;
private _clearPendingConnection;
private _restorePendingConnection;
private _confirmPendingOnce;
private _stopPolling;
private _friendlyError;
private _statusError;
private _closePopup;
private _handleClick;
private _startConnection;
private _fixtureEnabled;
/**
* The return URL the provider callback page receives. When the grant runs
* in a popup, the URL is tagged `oauth_popup=1`: Google's consent pages
* carry Cross-Origin-Opener-Policy headers that sever the popup's opener
* handle, so the callback page cannot tell a popup from a same-tab flow
* on its own. Untagged, it would `location.replace` a whole hosted flow
* INSIDE the popup (staging, Sep 11 2026) while the original tab already
* shows the new mailbox. Tagged, it closes or says "you can close this".
*/
private _returnUrlFor;
/** Flow-session mode: the host makes sure its flow session is open (the cookie exists) before
* the first request. Awaited AFTER the window was reserved in the click. */
prepare: (() => Promise) | null;
private _connectUserScoped;
private _confirmConnection;
private _requestUserTool;
private _isPendingOAuthError;
/** A connected answer whose grant was NOT stored: the server kept an older
* grant instead. /v1/me/tools/:tool/confirm says `reusedExisting: true` and
* nests the rejection under `sync` (its top level is a plain success for the
* OLD mailbox, so top-level fields alone read as a fresh connect — staging,
* Sep 9 2026: a second mailbox added with Gmail unticked was announced as
* the old mailbox connecting, and the tried address vanished). */
private _isPreservedGrant;
private _isExplicitConnectionFailure;
private _failureMessage;
private _markConnectionFailed;
private _markConnected;
private _markPreserved;
private _startPolling;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureExportButton extends ConfigureBase {
provider: string;
prompt: string;
label: string;
static styles: lit.CSSResult[];
private get _url();
private get _label();
private _handleClick;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureExportPrompt extends ConfigureBase {
prompt: string;
private _copied;
static styles: lit.CSSResult[];
private get _prompt();
private _handleCopy;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureMemoryImport extends ConfigureBase {
/** The import dialog in the language the page was translated into (locale.ts). */
private _locale;
connectSetup: boolean;
/** Which assistants use the setup pop-up ('' = all). */
setupProviders: string;
private _setupFor;
setupAttempt: {
launch_url?: string;
proof?: string;
prompt?: string;
guide_url?: string;
pairing_code?: string;
/** ChatGPT through the published plugin, or Claude through the directory connector: the person's message, its code and
* the assistant link (chatgpt_url, whichever assistant). */
link?: {
code?: string;
back_url?: string;
message?: string;
chatgpt_url?: string;
reply?: string;
};
loading?: boolean;
error?: string;
/** This tab's own account adopted the ChatGPT link (phone or Continue): it holds the journey. */
adopted?: boolean;
/** Decoupled partners (spec 2026-10-21): this tab goes back at the install; ChatGPT's memories follow on "done". */
resume_at_install?: boolean;
/** Another agent's live progress, polled by the host from /status. */
status?: {
approved?: boolean;
outcome?: string | null;
saved?: number;
source_name?: string | null;
browser_approved?: boolean;
resume_path?: string;
};
} | null;
/** The "Other agent" message was copied in this dialog: the status line waits for the agent. */
private _agentCopied;
/** A verified hosted return resolves its old launch draft, including partial/no-context. */
resolvedSetupProvider: string;
/** The flow has a signed-in account here (its token is only passed on the agent lane): "Continue", never the phone. */
signedIn: boolean;
private _manualSetup;
providers: string;
agent: string;
/** The flow's own sign-in or sign-up (Configure is the agent): the tile is Configure's mark, never a "C". */
configureOwn: boolean;
sectionLabel: string;
importedProviders: string;
/** A published Configure plugin listing; staging has its own verified listing. */
chatgptPluginUrl: string;
/** OAuth connection must finish before a plugin can receive selected memories. */
disablePluginTransfer: boolean;
/** Profile pages can reuse the same dialog without a second provider list. */
dialogOnly: boolean;
/** A partner's one-line link request (the import-link agents, Anything and Skydive: "Please read this link and export
* all of my memories: "), used for EVERY provider instead of the pasted prompt. Anything else is ignored. */
exportRequest: string;
private _promptFor;
private _transfer;
private _transferLoading;
private _transferError;
private _transferRequestCopied;
private _transferTimer?;
private _transferPolling;
private _transferEpoch;
private _transferAccountKey;
private _transferAuthToken;
private _transferCreation;
/** True when the export prompt reached the clipboard on the last launch. */
private _promptCopied;
embedded: boolean;
direct: boolean;
startProvider: string;
pasteTitle: string;
pasteCopy: string;
/**
* Who claims the staged paste.
* 'self' (default) this component claims with its own authToken, or sends
* the user through phone auth if it has none. Unchanged behaviour.
* 'host' stop after staging and emit configure:import-staged with the
* stage_id; the embedding page claims on ITS credential and calls
* hostImportSettled() with the outcome. Built for the import-only
* hosted flow, which claims with a __Host- cookie and must never
* show phone auth. Nothing else in this component changes.
*/
claimMode: 'self' | 'host';
private _phase;
private _selectedProvider;
private _stageId;
private _pasteValue;
private _phone;
private _errorMessage;
private _importSource;
private _claimedStage;
private _statusTimer?;
private _statusInFlight;
private _baselineImportMarker;
private _claimedAt;
private _importStartedAt;
private _importOutcomeRecorded;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
updated(changed: Map): void;
private get _apiBase();
private get _isAuthenticated();
private get _providerList();
private get _storageKey();
private _providerName;
private _providerUrl;
private _importedSet;
private _normalizeProvider;
private _analyticsProvider;
private _captureImport;
private _recordImportOutcome;
private _startDirectImportIfNeeded;
private _restoreDraft;
private _persistDraft;
/** Reuses the hosted import dialog from other owner surfaces. */
openProvider(provider: string, ev?: MouseEvent): Promise | null | undefined;
private get _deferChatgptTransfer();
private _selectProvider;
private _selectManualProvider;
/** Open the assistant and copy the request, inside the click that asked for it. */
private _openAndCopy;
/** One retained provider window, opened to the research-verified recipe
* (Blink navigation_policy.cc + HTML spec, Aug 31 brief):
* - NAMED target with a held handle: repeat clicks re-navigate and FOCUS
* the existing window instead of stacking new ones (features are
* spec-ignored on reuse, so the shape set on first open persists).
* - A modified click (Cmd/Ctrl/middle/Shift) makes Chromium's
* NavigationPolicyForCreateWindow hand the user a TAB no matter what
* features say — that is the user's stated intent, so it proceeds, but
* it is captured so "sometimes it tabs" reports stop being mysteries.
* - null return = BLOCKED (never a tab): surfaced as an inline real
* anchor, because a genuine link click bypasses every popup heuristic
* and every embedder popups-to-tabs override.
* Never navigates the top frame — this component lives inside a partner
* app mid-flow. */
private static _providerWin;
private _popupBlocked;
/** Hosted flows (authPattern "sso"): the card's tap opens a small "Continue to X" screen, and ITS click opens the
* assistant (Manuel, Sep 23: "it's supposed to show one screen that says Continue to ChatGPT; they click that,
* and then it opens"). Other surfaces keep opening the assistant on the tap itself. */
private _continued;
/** Back from the assistant with nothing pasted yet: the modal says so and points at the box (Sep 30 replay reviews;
* the reviewer's grouped notes count 19 of 138 visits that came back to an unchanged screen and took seconds to
* re-orient, or left). */
private _welcomeBack;
/** What each provider's box held when the modal was cancelled: reopening it gives the text back instead of making
* them fetch the export again (Sep 30 replay reviews: 8 visits in the
* reviewer's grouped notes re-picked and re-pasted; one lost 154 s). A retry, or a
* finished import, lets it go. */
private _keptPaste;
/** Another person's session starts on this page (sign-out, a restarted attempt): what the previous one pasted is
* theirs, and must not come back when the next person opens the same assistant. Called by the hosted flow's lane
* reset; the component also calls it itself when its own sign-in token is dropped or replaced. */
forgetKeptInput(): void;
/** Heuristic: the browser turned our popup into a tab (embedder override,
* modified click, fullscreen). Changes copy only, never behavior. */
private _openedAsTab;
/** When they chose or reopened the assistant this paste is for: how long they had to get its reply. 0 when unknown. */
private _assistantChosenAt;
private _openProviderPopup;
private _handlePasteInput;
private _focusPaste;
/** Back on this page after "Continue to " with the box still empty: say so (the handlers below also focus
* the box, as before; on iOS that shows no keyboard, which WebKit opens only inside a real touch, so the line asks
* for a paste and never promises a keyboard). A popup returns focus to this window without ever hiding the tab, so
* both the focus and the visibility events land here. */
private _markReturned;
private _onFocus;
private _onVisibility;
private _resumeImportStatus;
private _handleSubmit;
/**
* claim-mode="host" only: the embedding page reports what its claim produced.
* completed/duplicate/empty return to the provider list with this source
* marked imported, reusing the existing row state; failed shows the existing
* error phase with a retryable message.
*/
hostImportSettled(outcome: {
status: 'completed' | 'duplicate' | 'empty' | 'failed';
message?: string;
}): void;
private _claim;
private _pollStatus;
private _stopStatusPolling;
private _importMarker;
private _currentImportMarker;
private _profileShowsFreshImportedSource;
private _claimedImportExpired;
private _expireClaimedImport;
private _completeImport;
private _failImport;
private _handlePhoneSubmit;
private _handleAuthenticated;
private _reset;
/** What the last "Copy the prompt" press did, shown on the button for a moment (Manuel, Sep 22:
* "there needs to be some type of thing so the user can know that they clicked"). */
private _copyFlash;
private _copyFlashTimer?;
private _copyPrompt;
private _copyLabel;
private get _pluginUrl();
get pluginTransferAvailable(): boolean;
private get _transferStorageKey();
private _beginPluginTransfer;
private _createTransfer;
private _startTransferPolling;
private _stopTransferPolling;
private _checkTransfer;
private _closeTransfer;
private _dismissTransfer;
private _useManualImport;
private _copyTransferRequest;
private _renderTransferDialog;
private _renderRows;
private _chatgptOpened;
/** The partner's logo didn't load (a moved or blocked image): its initial instead of a broken image. */
private _agentLogoFailed;
private _renderLinkStatus;
/** ChatGPT did its part (or the journey ended) but this browser cannot carry it: only the back link or the phone can. */
private _linkElsewhere;
/** The ChatGPT link opens in a normal tab, every partner and every device (Manuel, Oct 26: the small window "makes things
* confusing and worse": Christian's install sign-in closed onto it, and the partner tab sat unseen behind). The anchor
* opens the tab; Claude, Grok and the other imports keep the small window (_openProviderPopup). */
private _openChatgptLink;
private _renderSetupModal;
/** The picked agent, or 'list' while choosing (the Plaid-style chooser), 'general' for any other agent. */
private _agentChoice;
private _agentQuery;
/** Which small copy button just copied (the server address or the command). */
private _copiedLine;
private _copyLine;
private _copyLineRow;
private _chooseAgent;
private _agentPickName;
private _agentMessage;
private _copyAgentMessage;
private _agentDialog;
private _targetTile;
private _renderAgentPicker;
private _renderAgentSetupModal;
private _renderImportModal;
private _renderPastePanel;
render(): typeof nothing | lit_html.TemplateResult<1>;
}
/** The owner-state pair this component fetches for itself (/v1/me and
* /v1/me/tools/status), when a parent resolved it BEFORE this step painted. */
interface OwnerStatePreload {
profile: Record;
toolStatus: Record;
/** The bearer the preload was fetched with. A list acting with a different
* token must not paint someone else's truth over its own actions. */
token?: string;
}
interface GmailAccountSummary {
id: string;
/** The provider's account id. Absent on a placeholder row (a fixture, or a
* connection with no per-account entries): such a row reconnects through
* a plain connect, never through the per-account route, which 404s on a
* synthesized id (prod, Sep 9 2026). */
connectedAccountId?: string;
label: string;
status: 'ready' | 'reconnect';
/** Tried without Gmail access: the row says so and offers the consent link. */
pendingPermission?: boolean;
}
declare class ConfigureConnectionList extends ConfigureBase {
connections: ConnectionData[];
connectors: string;
importsOnly: boolean;
disablePluginTransfer: boolean;
chatgptPluginUrl: string;
importedProviders: string;
/** Which import sources the cards offer. The hosted flow narrows this to the session's own list. */
importProviders: string;
showActions: boolean;
/** Overrides the continue button's label. The component otherwise GUESSES the
* next step from its own state, which is wrong wherever continuing does not
* lead to a permissions review -- the hosted MCP connect page just ends the
* flow, so it said "Review permissions" and then said "you can close this
* tab". A host that knows what comes next should say so. */
continueLabel: string;
userScoped: boolean;
reconnectMode: boolean;
capability: string;
optional: boolean;
fixture: boolean;
gmailAccounts: GmailAccountSummary[];
gmailSkipped: boolean;
gmailMultiAccount: boolean;
returnUrl: string;
/** Owner state the hosted flow resolved before this step painted. Seeded in
* willUpdate so the FIRST paint is the final truth — no "Connect" card that
* turns into a connected hub, no "Reconnect" that flips to "Connected". */
preload: OwnerStatePreload | null;
private _connectionStates;
private _connectionMeta;
private _importedProviders;
private _fetched;
private _dropdownOpen;
private _searchQuery;
private _searchMode;
private _gmailMenuId;
private _gmailRemovingId;
private _searchStartedAt;
private _hasScrollOverflow;
private _hasMoreBelow;
private _scrollObserver;
private _observedScrollHub;
private _observedScrollFooter;
private _scrollTracking;
private _scrollStartedRecorded;
private _scrollBottomRecorded;
private _lastScrollTop;
private _scrollFooterHeight;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
willUpdate(changed: Map): void;
updated(changed: Map): void;
private _startScrollTracking;
private _stopScrollTracking;
private _observeScrollContent;
private _measureScrollAffordance;
private _onListScroll;
private _scrollMore;
private _onToolStateChange;
private _fetchConnectionStates;
private _fetchUserProfileState;
/** Fold a /v1/me payload + owner tool status into the rendered state. ONE
* parser for both the component's own fetch and a parent's preload. */
private _applyOwnerState;
private _fetchProfileImports;
private _getConnections;
/** The full connector catalog for search, with live connected state —
* scoped entries keep their reconnect flags, everything else joins in. */
private _catalogForSearch;
private _requestedConnectors;
private _connectedFor;
private _asReconnectTarget;
private _metaFor;
private _imported;
private _importName;
private _onImportComplete;
private _emitContinue;
private _emitSkip;
private _emitShowProfile;
private _emitAddAccount;
private _onSearchInput;
private _enterSearch;
private _exitSearch;
private _onSearchKeydown;
private _onSearchExitPointerDown;
/** Closes the open account actions on any pointer press outside them, or Escape. */
private _onDocumentPointerDown;
private _onDocumentKeydown;
private _toggleGmailMenu;
private _recordAccountRemoval;
private _removeGmailAccount;
private _removeProviderAccount;
private _onReconnectedGmailAccount;
private _onAdditionalGmailPreserved;
/** The capability to hand a row: only when it names that row's connector
* (a "gmail:send" upgrade must not attach to the calendar row). */
private _rowCapability;
render(): lit_html.TemplateResult<1>;
private _renderConnection;
private _renderSsoHub;
private _renderSsoConnectedAccounts;
private _renderSsoGmailAccountRows;
private _renderSsoProviderAccountRow;
private _renderSsoConnection;
/** import-providers as a typed list; unknown slugs are dropped so a typo never renders an unknown card. */
private _importProviderList;
private _renderSsoAssistantImporter;
}
/**
* Shared "you're connected / approved" surface.
*
* Pure render — no fetches, no event listeners, no internal state.
* Used by:
* - configure-auth (success step)
* - configure-profile-editor (approved state)
* - apps/web/embed/auth/index.html (showComplete)
*
* The embed page mounts this via document.createElement('configure-success-card')
* so the visual treatment stays consistent between the production iframe path and
* the dev/lab component path.
*/
declare class ConfigureSuccessCard extends ConfigureBase {
title: string;
subtitle: string;
showProgress: boolean;
showProfileAction: boolean;
static styles: lit.CSSResult[];
private _showProfile;
render(): lit_html.TemplateResult<1>;
}
interface KnownGmailAccount {
id?: string;
connectedAccountId?: string;
providerAccountId?: string;
accountEmail?: string;
accountUsername?: string;
label?: string;
}
declare class ConfigureProfileEditor extends ConfigureBase {
agent: string;
profileSignup: boolean;
/** Consent surfaces: label of the "other answer" under Allow (e.g. "Not now"). Absent = no decline control. */
declineLabel: string;
/** Connection-only sign-in has no import screen to return to. */
hideBack: boolean;
/** Partner-lane disclosure rendered above the access categories. The copy is
* Configure-authored and supplied by the hosting page; this component only
* places it. Absent (or blank) = no disclosure line. */
partnerDisclosure: string;
gmailAccounts: KnownGmailAccount[];
demo: boolean;
demoGmailConnected: boolean;
/**
* The import-only hosted flow (store hosts): there are no connected
* accounts to share, only memories the user imports, so the consent copy
* must say that instead of "Connected accounts".
*/
importsOnly: boolean;
private _loading;
private _error;
private _sessionRequired;
private _categories;
private _details;
private _showDetails;
private _expandedCategory;
private _saving;
private _leaving;
private _permissions;
private _approved;
private _saveTimer;
private _lastSaveFailed;
private _categoryOverrides;
private _touchedDetails;
private _permissionsDegraded;
private _loadAttempt;
private _permissionSaves;
private _pendingPermissionSaves;
static styles: lit.CSSResult[];
connectedCallback(): void;
updated(changed: Map): void;
private _loadDemo;
private _valueLabel;
private _isDenied;
private _pathDenied;
private _globMatch;
private _isAggregateCategoryPath;
private _categoryHasAggregateDeny;
private _managedPermissionOverrides;
private _removeAgentFromOverrideRule;
private _normalizePermissions;
private _fetchJson;
private _statusFromError;
/** A rejected token is not a degraded load: tell the flow so the machine
* can route to designed recovery instead of a "Try again" that cannot work. */
private _reportAuthRejected;
private _recordPermissionsFallback;
private _fetchProfile;
private _toggleCategory;
private _toggleDetail;
private _toggleExpandedCategory;
private _debouncedSave;
private _queuePermissionSave;
requestBack(): Promise;
private _back;
/** Consent "Not now". Nothing is saved; the flow decides what the surface
* does with a decline (OAuth: deny redirect; connect: nothing connected). */
private _decline;
private _persistPermissions;
private _approve;
private _iconFor;
private _formatApprovedLabels;
private _displayCategory;
private _approvalSubtitle;
private _renderShell;
/** The partner-lane disclosure line, or nothing. Blank and whitespace-only
* copy render nothing at all — an empty grey bar is worse than no line.
* The truthy guard comes first because Lit writes `null` into a String
* property when its attribute is REMOVED, and `null.trim()` would take the
* whole access step down with it. */
private _renderPartnerDisclosure;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureAuth extends ConfigureBase {
agent: string;
userName: string;
externalId: string;
connectors: string;
private _step;
private _phone;
private _hasProfileData;
private _successSubtitle;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
private _restoreSession;
private _onPhoneSubmit;
private _onOtpVerified;
private _checkProfileData;
private _onProfileApproved;
private _onConnectionsContinue;
private _onProfileBack;
private _onConnectionsSkip;
/** Returns the current auth token, or null if not authenticated. */
getToken(): string | null;
/** Returns the current user ID, or null if not authenticated. */
getUserId(): string | null;
/** Clears stored auth and resets to the phone input step. */
logout(): void;
render(): lit_html.TemplateResult<1>;
}
/** The page-level step the hosted shell routes and paints on. */
type HostedStep$1 = 'phone' | 'otp' | 'verified' | 'gmail' | 'connections' | 'imports' | 'profile' | 'complete' | 'blocked' | 'unsupported' | 'expired';
interface HostedInit {
agentToken?: string;
userId?: string;
externalId?: string;
baseUrl?: string;
theme?: string;
agentName?: string;
agentLogo?: string;
copyMode?: string;
loginHint?: string;
methods?: string[] | string | null;
font?: string;
connectors?: string[] | string | null;
connectorOnly?: boolean;
reconnectMode?: boolean;
gmailMultiAccount?: boolean;
fixture?: boolean;
}
interface GmailAccountView {
id: string;
connectedAccountId?: string;
providerAccountId?: string;
label: string;
/** The provider-reported address, when the row has one. The profile-signup
* gate reads THIS, never the label: the server proves ownership from it. */
accountEmail?: string;
status: 'ready' | 'reconnect';
pendingPermission?: boolean;
/** For an address-less pending row: the real accounts that existed when it
* was created. Any new real account retires it (the grant that fixed it
* cannot be matched by address). */
pendingSeenIds?: string[];
}
interface FixturePreviewState {
step: HostedStep$1;
phone: string;
verified: boolean;
gmailConnected: boolean;
outlookConnected: boolean;
gmailNeedsPermissions: boolean;
gmailSkipped: boolean;
gmailAccounts: GmailAccountView[];
}
/**
* Canonical Configure-owned authentication and connection flow.
* First-party surfaces should mount this orchestrator in SSO mode instead of
* recomposing phone, OTP, Gmail, connection, or permission steps themselves.
*/
declare class ConfigureHostedAuthFlow extends LitElement {
/** Every screen in the language the page was translated into (locale.ts). */
private _locale;
apiKey: string;
baseUrl: string;
agent: string;
agentName: string;
agentLogo: string;
valueProposition: string;
/** Partner-lane disclosure shown above the access categories. Configure-authored,
* supplied by the hosting page; the components never invent this copy. */
partnerDisclosure: string;
copyMode: string;
externalId: string;
loginHint: string;
methods: string;
connectors: string;
connectorOnly: boolean;
importsOnly: boolean;
/** Connect a plugin account and review access; transfer happens in the assistant. */
connectionOnly: boolean;
/** Offer optional source imports after sign-in, before completing a memory-only grant. */
connectionImports: boolean;
/** Verified setup presentation only; the OAuth source agent remains unchanged. */
connectionTargetName: string;
/** The partner whose hosted page opened ChatGPT's install in this browser (server-chosen from its signed marker, never the URL). */
connectionPartnerName: string;
connectionPartnerLogo: string;
/** That journey's finish link (same server-chosen source). ChatGPT's own turn right after any plugin install can't use
* the new plugin's tools, while a chat the person starts can (Booking.com too, Oct 19), so the ending opens it in a new
* tab, a new chat with the request filled in, before returning to ChatGPT. Only an https link is ever opened. */
connectionPartnerFinish: string;
/** What the person types in ChatGPT to let it save (the either-way trial, Oct 24); empty keeps "done". */
connectionPartnerReply: string;
/** The OAuth scopes this grant carries (space separated): the plugin connect screen's pills. */
scopes: string;
disablePluginTransfer: boolean;
chatgptPluginUrl: string;
skipConnections: boolean;
/** Configure profile onboarding uses the full flow and requires a connected mailbox. */
profileSignup: boolean;
/**
* A partner's linked-account flow (dx: the import-only session machinery with an
* account): the handoff token from the /f/ link. Its presence selects the
* partnerLinked intent; the page peeked it and set gmail-step from its steps.
* The flow's own calls (open, account, finish) go same-origin: the __Host-
* cookie /open mints belongs to this page's origin, which proxies /v1.
*/
flowHandoff: string;
pluginSetup: boolean;
/** Which assistants use the setup pop-up ('' = all). Production's ChatGPT link test sets 'chatgpt' only. */
pluginSetupProviders: string;
private _setupOn;
setupResume: string;
private _setupAttempts;
private _setupFlowId;
private _setupResumeComplete;
private _setupResumeOutcome;
private _setupResumeProvider;
/** An "Other agent" return: the agent's own name and how many facts it saved, for the receipt row. */
private _setupResumeSource;
private _setupResumeSaved;
/** Decoupled return before ChatGPT saved (spec 2026-10-21): the connection is settled here, its memories still to come. */
private _setupResumePending;
private _pendingWatch;
/** Back at the install before ChatGPT saved (decoupled): this tab finds out by itself when the save lands, so ChatGPT's
* card turns Imported and the "reply done" note goes (Oct 22: it said "Waiting for ChatGPT…" long after the save).
* Every 5 s for up to 30 min; stops when the journey is gone or no longer this tab's. */
private _watchChatgptPending;
private _agentWatch;
/** The agent picked in the "Other agent" chooser ('' for a general message): its name on the sign-in page and receipt. */
private _agentPicked;
gmailStep: boolean;
/** Import-first (`connect`): stage imports BEFORE identity. Set by the page
* from the peeked flow slug, exactly as gmail-step is set from the steps. */
importFirst: boolean;
/** A partner connect link opens on a trust screen before the grid (mock, Sep 29; local and staging only via ?trust=1). */
trustScreen: boolean;
/** The import-link agents' one-line link request (Anything, Skydive), handed to the import card. The page sets it
* from the server's per-agent defaults; every other agent leaves it empty and keeps the pasted prompt. */
exportRequest: string;
/** The connect flow's screens for EVERY lane (Manuel, Sep 22: "every hosted flow means every
* hosted flow" — SDK, sign-in.me, OAuth, MCP, profile sign-up, text-back). Presentation only:
* the machine, its steps and the analytics names stay the lane's own (flow/SCREENS.md). */
design: string;
private get _v6();
/** An agent lane on the connect screens (no partner): SDK sign-in, sign-in.me, OAuth, MCP, profile sign-up, text-back. */
private get _v6Agent();
/** An agent lane the grid carries, walked in the connect flow's order (Manuel, Sep 23: "the apps and
* assistants first, with the sign-in button, then the phone number and code, then the receipt" —
* for every hosted flow): the grid BEFORE identity. What the person does there before the phone
* lives on a `hosted` flow session this page mints on their first tap (POST /v1/flows/hosted).
* Not a partner's linked_account link: its contract lands nothing before the phone (flows.ts
* refuses a pre-phone import or connect there), so it keeps identity first on these screens. */
private get _v6AgentFirst();
/** The grid comes before identity: a partner's connect link, or an agent lane above. */
private get _gridFirst();
/** The header's X leaves this flow, asking first when leaving would lose something (hosted-shell). */
get leavesByX(): boolean;
/** Source-provider authorization uses Connect screens, without creating another hosted import session. */
private get _focusedConnection();
/** ChatGPT's plugin connect screen (Manuel's Oct 18 changes: no bars, its own placeholder, the "coming from another
* app" line). Claude's connect screen stays as it is (Manuel, Oct 16: "Claude's screens stay as they are"). */
private get _chatgptConnect();
private get _connectionImports();
/** The plugin connect screen has no step bars (Manuel, Oct 18): one short screen, nothing to count. The shell reads it. */
get hidesProgress(): boolean;
/** ChatGPT's install opened from a partner's page (Manuel, Oct 21): the number screen fits without scrolling (scrolled,
* it slid the "Smry ••• ChatGPT" lockup off the top), so its trust cards give way to the shell's "Secured by
* Configure" at the bottom. The shell reads it. */
get securedOnPhone(): boolean;
private _connectionConsent;
/** A flow session holds the person's pre-phone work: the partner's link, or this page's own. */
private get _hasFlowSession();
importSources: string;
/** What the person must import or connect before Continue (Manuel, Sep 23), as a comma list — "chatgpt,gmail" —
* from whoever minted the link (the SDK's signInUrl, the partner API). An entry may name alternatives,
* "gmail|outlook", and any ONE of them meets it (Sep 24). Required ones sit first; a lone one reads "Required" in
* red, alternatives are named by the line above Continue, and Continue holds until every entry is met. */
required: string;
/** Whether a required mailbox (Gmail/Outlook) must give access to its mail ("yes", the default) or only prove the
* address ("no"): Smry signs people in BY that address and needs nothing from the inbox (Manuel, Sep 30). */
mailboxAccess: string;
/** connect: the partner's VETTED return URL (the page checks it) and its label; the flow draws the receipt. */
returnUrl: string;
returnLabel: string;
requireEmail: boolean;
/** OIDC sign-ins: every path passes through Review and add connections;
* neither an existing grant nor an already-proven email mints on arrival. */
alwaysReview: boolean;
/** Consent surfaces (OAuth, connect): label of the decline action on the
* access step. The page owns what a decline means; the flow ends on
* done.denied and dispatches configure:declined. */
declineLabel: string;
reconnectMode: boolean;
gmailMultiAccount: boolean;
capability: string;
font: string;
theme: string;
presentation: 'card' | 'bare';
intent: 'link' | 'signin' | 'connect' | 'reconnect';
authPattern: 'inline' | 'sso';
agentToken: string;
initialUserId: string;
ignoreSession: boolean;
requirePhoneEvidence: boolean;
resetOnComplete: boolean;
fixtureState: string;
fixture: boolean;
private _step;
/** Why a pre-identity import did not attach, if it did not. Empty means it did.
* Distinguishes retryable ('offline', 'unavailable') from the person's own
* ('expired'/'gone'), which the receipt words differently. */
private _importClaimFailure;
/** Providers claimed on the import-first lane. The card is remounted on
* back-nav and would otherwise forget what it just imported. */
private _importedProviders;
/** Claimed imports that brought nothing: the assistant had nothing on them ('empty') or our side failed ('failed').
* They still count, so Continue stays open (Manuel, Oct 31: "we still let them through if they want to"); the card
* and one line say what happened instead of "Imported", and a tap tries again. */
private _broughtNothing;
/** The provider of the last import that brought nothing, for the line under the cards. */
private _lastNothing;
/** v6 grid state: apps chosen (new user) or connected (signed in / post-bind). */
private _selectedApps;
private _connectedApps;
private _connectingApp;
private _appErrors;
/** A sign-in window the browser blocked: the address to open by a tap instead (a link always opens). */
private _appOpenUrl;
/** The app whose failure the live region reads out (the last one to fail), until it connects or is tapped again. */
private _v6LiveId;
private _appOpenUrlTimers;
private _activeImport;
private _pendingCard;
/** An import this page's card is claiming itself (the agent lane): the card says so until it lands or fails. */
private _importingCard;
private _finishResult;
private _returning;
/** An agent lane's ending, handed over by its page once the page's own last step answered (OAuth's code,
* the SDK's return code, the MCP approve): the agreed receipt carries it as its one action (Manuel,
* Sep 23: "a receipt that shows what you have connected and a check, modeled off of Uber"). */
private _pageEnding;
private _endingTaken;
/** The page asked to hold its ending (ChatGPT's install, server-timed): until this clears the receipt stays
* "Finishing your connection…" with a bar for the remaining wait, and neither returns nor offers the button. */
private _endingHeldMs;
private _endingHoldTimer;
/** No page can hold the receipt longer than this, whatever it passes. */
static readonly ENDING_HOLD_MAX_MS = 120000;
private _clearEndingHold;
/** The page's last step failed (it says why, and may offer its own retry): the receipt stops "Saving…" and says so. */
private _pageFailure;
/** Finished, but neither an ending nor a failure long after: the receipt says it is taking longer (parity B2). */
private _pageStalled;
private _endingWatchdog;
/** Every lane on the connect screens ends on the receipt; a partner's connect link keeps its own return. */
get acceptsEnding(): boolean;
/** The page's success ending (hosted-shell finishWith). False when this flow does not end on the receipt. */
presentEnding(ending: {
label: string;
go: () => void;
auto?: boolean;
autoNote?: string;
leaves?: 'navigate' | 'close';
holdMs?: number;
}): boolean;
/** The page's last step failed (the MCP install's completion, a code the server refused): the receipt says so in the
* page's own words, with the page's own retry if it has one. False where the flow does not end on its receipt. */
presentFailure(failure: {
message: string;
retry?: () => void;
retryLabel?: string;
}): boolean;
/** The failure's own retry: back to "Saving…" while the page tries again; its next answer settles the receipt. */
private _retryPageFailure;
private _clearEndingWatchdog;
/** The page's own card covers the flow (hosted-shell renderTerminal: a failure the page words itself, or its own
* ending). The page answered, so the receipt is not waiting: no watchdog, and no stall left over for Try again,
* which uncovers it (clearTerminal) and gets a wait of its own. */
private _coveredByPage;
setCoveredByPage(covered: boolean): void;
/** Stop the receipt's countdown, both its wait and the leave after the spin. */
private _cancelReturn;
private _leaveConfirm;
/** Apps whose last connect came back without a permission: their button reads "Allow access" until one lands. */
private _appNeedsAccess;
/** The Gmail permission experiment (experiments.ts): this browser's arm, decided the first time it is needed, and
* whether this journey's exposure and conversion were recorded (once each per journey, so neither is reset with the
* lane). */
private _gmailScope;
/** The journey the arm was assigned for: the key its marks are kept under for the tab (experiments.ts). */
private _gmailScopeJourney;
/** What the arm was drawn on: this browser's first counted journey, or this one (experimentUnit). */
private _gmailScopeUnit;
private _gmailScopeExposed;
private _gmailScopeConverted;
/** Continue on the trust screen: the grid follows. */
private _v6TrustPassed;
/** The trust screen experiment (experiments.ts): this browser's arm, decided the first time it is needed, and whether
* this journey's exposure was recorded (once per journey, kept for the tab like the Gmail experiment's). */
private _trust;
private _trustJourney;
private _trustUnit;
private _trustExposed;
/** Continue was pressed on the trust screen in this tab for this journey: a phone's same-tab trip to Google reloads the
* page, and someone who cancelled there must come back to the grid, not to the trust screen again. */
private _trustPassedStored;
private _v6TrustOpen;
/** Imports claimed after /finish answered (a redo on the receipt): the server's list predates them. */
private _lateImports;
/** A new attempt (machine restart, cleared session) forgets the previous lane: its cards,
* pills, answer and countdown belong to the account that just left. */
private _resetV6Lane;
/** Apps connected from the receipt's own Connect, after the answer. */
private _receiptConnected;
private _returnTimer;
private _phone;
private _otpDelivery;
private _userToken;
private _userId;
private _embedReceipt;
private _gmailConnected;
private _outlookConnected;
/** /v1/me identity.email_verified — a proven address already on the account. */
private _emailVerified;
private _mailboxError;
private _mailboxChecking;
private _signingOut;
private _signOutError;
private _confirmAfterProfileSave;
private _firstPartyRestoreUnavailable;
private _outlookEmail;
private _outlookLimitNotice;
private _gmailNeedsPermissions;
private _gmailSkipped;
private _gmailAccounts;
/** Mailboxes tried without Gmail access. They exist nowhere on the server,
* so every server-driven rebuild of the list re-applies them here until a
* real grant for the same address arrives (measured on staging: the
* pending row flashed and vanished on the next refresh). */
private _pendingGmailAccounts;
private _stepHistory;
private _navigatingHistory;
private _flowStartedAt;
private _stepEnteredAt;
private _flowStartedRecorded;
private _trackedStep;
private _trackedStateKey;
private _stateKey;
private _entryMode;
private _machineTelemetry;
private _trackedStepExitRecorded;
private _flowCompleted;
private _flowExitedRecorded;
private _disconnectGeneration;
private _lastVisibilityState;
private _gmailRefreshVersion;
private _connectorCompletionPromise;
private _completedConnectorTools;
private _journeyResume;
private _requestedResumeStep;
private _authJourneyId;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
firstUpdated(): void;
private _actor;
private _machineEpoch;
private _flowIntent;
private get _partnerLinked();
private _flowOpenPromise;
/** Claim a pre-identity stage NOW rather than carrying the id through phone and
* OTP. The route resolves the provisional user (flowSessionUserId falls back to
* the mapping id), and linkUser -> migrateUserData adopts that user's data into
* the real account at bind. So nothing has to survive the identity steps, and a
* reload mid-code cannot lose an import.
*
* Advancing is UNCONDITIONAL. A failed claim must never strand the person on the
* import screen: we record why, continue to identity, and the receipt tells the
* truth about what did or did not attach. */
static readonly V6_APPS: ReadonlyArray<{
id: string;
name: string;
}>;
private static readonly V6_SOURCE_NAMES;
/** A returning user's grid shows what the account already has: imported assistants as done
* cards, connected apps as done pills. Merged, never overwritten, from the same owner
* preload the review hub reads (profile.imports keyed by provider; toolStatus.tools, or
* profile.integrations[app].connected as the older shape). */
/** Signed in, but the account held nothing when the grid opened — a "Sign in" with a number
* that had no Configure history yet. That person gets the new-person grid: something must be
* imported or connected before Continue, which then goes straight to the receipt (the phone is
* already done). Set once, at the preload, so it does not flip as they import. */
private _accountWasEmpty;
private _seedV6FromPreload;
/** The signed-in number, all but its last four digits hidden: "••• 0123". */
private _maskedPhone;
/** A restored session on this lane: no phone step, "Done" instead of a count, no auto-return. */
private _v6SignedIn;
/** The grid acts as the account: a partner link once its floor reaches review; an agent lane from the
* code on (its email step sits BELOW review in the machine's order, yet the person is signed in). */
private _v6HasAccount;
private _v6Sources;
/** The assistants this session offers, in their own order. */
private _v6SourceList;
/** The required entries as groups of alternatives ("gmail|outlook,claude" → [[gmail, outlook], [claude]]), kept to
* what this grid shows (its own assistants, any app); anything else — an edited or hand-built link — is ignored
* rather than holding Continue shut for something nobody can see. */
private _v6RequiredGroups;
private _requiredIgnoredSaid;
private _v6Required;
/** The entries nothing has met yet: while one is left, Continue holds and its alternatives read Required. */
private _v6RequiredOutstanding;
/** Why a held Continue is held, in words: the first entry still open ("Connect Gmail or Outlook to continue."). */
private _v6RequiredReason;
/** "Required" (the approved design, Sep 23: red, under an app's name; an assistant card's status) on every
* alternative of an entry nothing has met yet — Gmail and Outlook both, until either is connected. The line by
* Continue says that one of them is enough. */
private _v6RequiredLabel;
private static readonly V6_MAILBOXES;
/** The mailboxes still asked for by a required entry made only of mailboxes ("gmail|outlook", "gmail"), or by a
* surface that needs a proven email (an OIDC email scope, profile sign-up), in the grid's order; empty once
* one is connected or nothing asks. Those go on the mailbox page, in front of the grid. */
private _v6MailboxesFirst;
private _v6MailboxFirstSeen;
/** The last step painted (the render's own decision): the page hides its header marks while it shows (data-cobrand). */
private _v6LastStepPainted;
/** The person pressed Continue on their grid (before the phone, or signed in): they asked to finish, not to see the
* grid again. Kept for the TAB under this journey (_writeContinued) and carried over to one page only: the one a
* same-tab Google trip (a phone) comes back to, so it still finishes when the address lands. Any other page load in
* this tab (a reload, a restored tab, Back/Forward) is shown the grid and taps Continue again: whoever is signed in
* there may not be the person who pressed it (Oct 7 review: a reload approved with no tap). A new sign-in is a new
* journey and never inherits it. */
private _v6PressedContinue;
/** This page is a same-tab grant's return (arrivedFromSameTabGrant), read as the element is created. */
private readonly _sameTabGrantReturn;
private _continuedKey;
private _readContinued;
private _writeContinued;
/** The apps the email page asks for, or none when the grid paints instead. The ONE decision the render and the
* funnel's screen name both read, so the name recorded is always the page painted. */
private _v6MailboxPageApps;
/** What the v6 page paints on this step, as the funnel names it: the email page is 'mailbox', the grid is 'imports'
* whichever step it covers ('gmail' and 'connections' paint the grid on agent lanes; see render). '' otherwise. */
private _v6PaintedScreen;
/** The mailbox page (Manuel, Sep 24): "Connect your apps and assistants to Smry. First, connect Gmail or Outlook to
* secure your account." Two rows shaped like a sign-in and no Continue — a landed connect is the way on, and the
* grid follows with the mailbox already connected, then the phone and the code. The OAuth rows ride along so the
* tap opens the window in the gesture, as on the grid; the sign-in line is the grid's own. */
private _renderV6MailboxFirst;
/**
* The address the sign-in needed has landed, and this journey's person had pressed Continue (Manuel, Oct 5: "what
* happens after Gmail"): finish as that Continue does, instead of a grid that waits for a second one. From the signed-in
* grid (IMPORTS_STAGED), where this lane's last step and a phone's same-tab return both stand; from review (APPROVED)
* for a lane that reaches it holding a Continue (none does today: a failed finish spends it). Never on an unknown (the
* read still running, or failed: _mailboxStillNeeded holds), never while an import or a connect is in flight, never for
* a partner's link (its own finish) or Configure's own sign-in. Asked once: the Continue is spent before the event, so
* an event the machine does not take is never repeated, and it is counted only if the machine took it.
*/
private _v6FinishAfterEmail;
/** A proven address would finish this page (_v6FinishAfterEmail's standing conditions, the address aside): the person
* pressed Continue, signed in, on a partner's email sign-in. Never a partner's link (its own finish) or Configure's own
* sign-in. "Saving to {agent}" is shown only when this holds: it promises a save that follows (Oct 7 review). */
private _v6FinishFollowsEmail;
/** _v6FinishAfterEmail's conditions, with no side effects: the render reads them too, so the frame in which the
* address lands already paints what follows it. */
private _v6FinishReady;
/** The last step painted at least once on this page (the receipt's bars follow it). */
private _v6LastStepShown;
/** The finish this page asked for after the address landed, while the machine runs it (approving). */
private _v6FinishingAfterEmail;
/** That finish reached done: the email page waits for the receipt's answer (_v6HoldingForReceipt). Spent once. */
private _v6HoldForReceipt;
/**
* The address landed after a Continue: the email page stays up, saving, until the receipt replaces it (Manuel, Oct 6:
* "a little circle thing to check my Gmail, and then it was a little bit jarring how it switched"). The grid used to
* paint between the check and the receipt, for as long as the finish took: the frame before the finish is asked for
* (_v6FinishReady), every frame of approving after it (_v6FinishingAfterEmail), and the frames after it until the
* receipt can answer (_v6HoldingForReceipt).
*/
private _v6SavingAfterEmail;
/**
* The machine is done before an agent lane's receipt can say anything: it waits for its page's ending and the server's
* summary (_v6Settled), 130 ms on the Oct 6 staging walk and up to the summary's deadline. Painted, that wait was a
* second page change in a fifth of a second, "Saving your context" between "Saving to Smry" and "You're all set"
* (Manuel, Sep 22, the same page after the code: "a really weird in-between screen"). So the email page stays up,
* saving, and the receipt appears once, with the answer. A failure or a stall is the receipt's to say, at once, and the
* hold is spent then: a retry from the receipt waits on the receipt, as it always has.
*/
private _v6HoldingForReceipt;
/** The last step is what shows: painted on its own step, or held for the receipt. The page hides its header marks
* (data-cobrand) and the bar reads the address as the current stage while it does. */
private _v6LastStepUp;
/** The bars while the last step is up: this page's own screens, with the address as the stage before the ending. A
* journey that walked the phone and the code here keeps their segments (the machine's plan drops them once the person
* is signed in); a page that opened signed in (a same-tab return) shows the grid, the address and the ending. */
private _lastStepPlan;
/** ChatGPT's install opened from a partner's hosted page (Manuel, Oct 19: "Connect Newly to ChatGPT"): the partner is
* named on these screens. Only ChatGPT's connect, and only with a server-chosen partner. */
private get _gptPartner();
/** The partner journey's finish link, on ChatGPT's install screen only, and only an https one. */
private get _gptFinish();
/** The partner's screens' lockup (Manuel, Oct 20): "Newly ••• ChatGPT" in the hosted flow's own tiles, the
* partner's whole logo shown (the overlapping circles clipped wide marks). */
private _gptLockup;
private _v6TargetPair;
/** The partner's mark overlapping Configure's (Plaid's co-brand pair): the trust screen and the last step. */
private _v6PartnerPair;
/** What each OAuth scope lets the assistant do. The pills are drawn from the scopes the grant actually carries, so they
* can claim neither more nor less than it gives (Manuel, Oct 16: pills instead of toggles, then Continue). */
private static readonly SCOPE_PILLS;
/** ChatGPT's install, the imports page: the person's other assistants (never ChatGPT itself: they are in it), each
* opening the same import dialog as the hosted grid, claimed to their account; Continue completes the grant, imported
* or not, and the ending follows. Someone signed in already starts here (Manuel, Oct 19: "they should go to the import
* page first and then the ending"), so for them it is the first page and carries what the first page did: what the
* grant lets ChatGPT do, the terms under Continue, and who is signed in. After the phone and the code that consent
* was already given on the sign-in page, so the page stays as it was. */
private _renderConnectionImports;
/** The plugin connect screen's top, shared by the number screen and the signed-in one: the assistant's mark over
* Configure's (the trust screen's pair), what this connection is for in plain words, and what the grant allows. */
private _focusedHero;
/** What the grant lets the assistant do, one pill per scope it carries (none when it carries none). */
private _scopePills;
private _termsLine;
/** Required ones first, the rest in their own order. */
private _v6RequiredFirst;
private _v6AgentLabel;
/** Signing in to Configure itself (the profile, Configure's own agent or copy): no "Configure uses
* Configure" (Manuel, Sep 22: just "Configure", never "Configure + Configure"). */
private _v6IsConfigureItself;
/** A plain check, no circle around it (Manuel, Sep 22: "just put a check mark, size it up"). */
private _v6Check;
/**
* What a row says while its sign-in window is open. The spinner alone read as a stall: people watched an unchanged row
* for 2-70 s, unsure whether to wait, retry or leave (replay reviews, Sep 30; the reviewer's grouped notes count 11 of 138
* visits). The window belongs to
* the provider, not the app, so it names the provider people will see.
*/
private _v6WaitingLine;
private _setOpenLink;
private _clearOpenLinks;
/** "Open Google sign-in": a real link to the window the browser blocked. Drawn beside a row, never inside its button. */
private _v6OpenLink;
/**
* What a screen reader hears about the app rows: the wait while a sign-in window is open, else the latest failure.
* One region per screen, in the page from its first render and empty until needed (a region inserted with its text
* already in it is often not read, MDN "Live regions"), and never inside a button: a button's content is
* presentational, and WebKit drops it from the accessibility tree, so VoiceOver would never hear it.
*/
private _v6LiveRegion;
/** Whose sign-in window the person sees for an app: Google for the Google apps, Microsoft for Outlook. */
private _v6Provider;
private _v6AppName;
/**
* What an app row says when its connect did not land, as a sentence the person can act on. The connection row reports
* short technical strings ("additional permissions needed", "popup blocked - allow popups and try again", "unable to
* connect \u2014 try again") that were shown as they came. The commonest, a Google permission left unticked on the
* consent screen (45 of 46 permission failures on prod in the 7 days to Sep 30, reason provider_scope_missing), said
* neither whose permission nor what to do, and the replay reviews watched people leave on it. The structured fields
* decide first: the reason code and the popup flag; then the row's known strings; anything else (a server's own
* message) is shown as sent, capitalised. V6_ROW_ERRORS must cover every string configure-connection-row.ts can emit
* (a test reads them out of that file).
*/
private _v6ErrorCopy;
/** A permission left unticked (Manuel, Sep 30: "Google didn't share Gmail access. Tick the Gmail box and try again").
* Google's consent screen has a box per app; Microsoft's and Notion's do not, so they are asked to allow it. */
static v6PermissionCopy(app: string, provider: string): string;
/** The failure is a permission left unticked: the row's button asks for access instead of offering Connect again. */
static v6IsPermissionFailure(detail: {
error?: unknown;
reason?: unknown;
} | undefined): boolean;
/** Every string configure-connection-row.ts can put in a tool-error event, lower-cased, to the sentence shown. */
static readonly V6_ROW_ERRORS: Record string>;
private _v6Spinner;
/** On the email step, a surface that requires a proven mailbox (profile sign-up, an OIDC email scope) still lacks one. */
private _v6NeedsEmail;
/** The review variants the grid carries so far. A reconnect, a one-app link, an imports-only
* store host and a capability upgrade still get the hub until each is built on the grid. */
private _v6GridCovers;
/** An MCP work link (configure_connect for an app, intent "connect"): the person came to connect, not
* to import — the grid drops the assistant cards and names the app (the one-app screen's words). */
private get _v6WorkLink();
/** The one app a link was made for (a `connectors` list of one, not a repair): the machine's `connect` intent.
* The grid read only the page's `intent` attribute, which the accounts page sets to "signin" on such links, so
* it showed the whole grid and let the person finish without the app (parity A23). That app is the link's work:
* its screen, and required (met by a connection the account already holds). */
private _v6LinkApp;
/** A repair link (reconnect): the hub's rules — the app reads "Reconnect" until it reconnects ON THIS
* SCREEN (a stored "connected" is what broke), always a fresh grant, Continue once every one is back. */
private get _v6Reconnect();
private _v6Reconnected;
private _v6ReconnectPending;
/** The app pills this surface offers: a page that lists its apps (the OAuth page's `connectors`) gets
* exactly those, in the grid's order; otherwise every app the grid knows. */
private _v6OfferedApps;
private _renderV6Grid;
/**
* "Also connect your apps" starts OPEN, as it did from Sep 22 (Manuel, Oct 5: "I don't want it to start collapsed").
* On Oct 4 it was made to start closed and open itself for a reason, from "do not auto open the dropdown that's
* terrible": a misreading, undone. The page never opens or closes it by itself after that: the person's own open and
* close are kept (the toggle event), so a re-render never moves it under them, and each is recorded as a tap.
*/
private _v6AppsOpen;
private _onV6AppsToggle;
/**
* The trust screen keeps both promises above Continue at any length of words: in a longer language (German at 360x660
* put the last line of the second promise under Continue, Oct 4), with a long partner name, or with Android's larger
* text setting, which no height breakpoint can see. When they do not fit, the screen is drawn tight, as the shortest
* screens are: each promise its title, its sentence kept for screen readers. Measured after each render, on a resize
* and once the fonts land; the attribute is set before the browser paints, so nothing visibly jumps.
*/
private _fitTrustScreen;
/** Who the trust screen is for: a partner's connect link, at the grid's step, with no account here and nothing
* brought in yet. Both arms of the experiment are counted on this, so they are the same people. */
private _v6TrustEligible;
/** Whether the trust screen is what the grid's step paints: eligible, not yet passed, and either forced on (?trust=1 on
* local and staging previews, never counted) or this journey's arm is b. Render, the funnel name and the page's
* header all read this. */
private _v6TrustShowing;
private _trustAssignment;
/** Counts this journey in the experiment, once, the first time it is eligible (either arm). Previews are never counted. */
private _recordTrustExposure;
private _trustPassedKey;
private _readTrustPassed;
/** Continue on the trust screen. The page scrolls inside this element (the v6 card), and the grid is the same step,
* so nothing else resets it: without this the grid opened scrolled past its own title (iOS Safari, Sep 29). */
private _passV6Trust;
/** The trust screen in front of a partner's grid: the partner's mark beside Configure's, who is asking, the strip of
* what Configure connects (hidden up to 800px tall), "What is Configure?", two promises, and Continue into the grid.
* Sign in goes straight to the phone. */
private _renderV6Trust;
/** Under the dock on every first screen: who is signed in (and "Not you?"), or the returning person's way in. */
private _renderV6SignInLine;
/** Offscreen connection rows carry the OAuth mechanics (popup, poll, settle); the pills are the UI. */
private _renderV6ConnectRows;
/** The paste sheet lives in ONE dialog-only card per screen that offers imports — the grid and
* the settled receipt (renders nothing until a provider is chosen) — so a card tap can drive it
* synchronously inside the gesture: the assistant window must open in the click, or WebKit
* and popup blockers turn it into nothing. */
private _renderV6ImportCard;
/** An agent lane's import claimed itself to the account: mark the card imported (a failure stays tappable). */
private _onV6SelfImported;
/** The setup links this page already said landed (with localStorage, this browser). */
private _saidLinkImports;
/** A setup link's save landed (ChatGPT's or Claude's link, another agent's): the card turns Imported, and the import is
* said the way a paste says it, once per link in this browser, however many of the ways back report it (the adopt, the
* tab's watch, the page Go back opens). Link imports fired nothing before (Oct 30: 524 returns, no import event).
* The browser remembers it said one only when capture queued it, so a page that could not send leaves it to the next. */
private _onLinkImported;
/**
* One event for every tap on the connect screens, named by `control`.
*
* The step events say someone reached the grid and left 40 s later; they cannot say the
* 40 s was "tapped ChatGPT, opened the sheet, copied the prompt, never came back". One
* event with a property beats a dozen event names: the controls change with the design,
* and a funnel that must learn a new name each time quietly stops matching.
*/
private _tap;
/** How long they have been here, and on this screen. The ending needs it as much as the
* middle does: bind → landing back on the partner is the number that decides what the
* partner's first message can already see (lead's import→Smry timing, ~8 s). */
private _journeyTiming;
private _refreshSetupPairing;
/** Any MCP-capable agent can connect through a copied message wherever ChatGPT and Claude can. */
private _agentSetupOffered;
private _agentSetupCard;
/** The original tab follows another agent's progress, and resumes this journey once it finishes. */
private _watchAgentSetup;
/** "Continue with your phone number" on a ChatGPT link: this tab signs in with its own number, then the link is
* attached to that account (the server refuses any other) and ChatGPT shows as imported from what it saved. */
private _chatgptAdoptPending;
/** How the person reached the phone fallback: already signed in here, or signing in now (the rollout counts it). */
private _chatgptAdoptVia;
/** What the phone fallback found, said on the grid (the sheet it started from has closed). */
private _linkNotice;
/** Whether this tab (its browser approved the install) carries on by itself now: as soon as ChatGPT has done its part
* (approved: it called a save, even when every fact was already saved; Devin review, Oct 21), with no wait for its
* later batches (Manuel, Oct 21: "the tab doesn't need to wait for ChatGPT to settle"; the server takes them as they
* land and builds the profile once they stop, externalUserService queueAdoptionFollowups), and only once the person is
* back on this tab: focus, not visibility, since ChatGPT's popup leaves this tab visible on a computer and carrying on
* behind it would leave its link back on "This sign-in already finished" (decoupled partners excepted). Never after the back link was opened
* (outcome): that link's own tab has the journey. Continue on the dialog goes at once. */
private _linkMayResume;
/** This browser may resume the journey (its install was approved here): go on to the resume path, as a back link
* would, without a phone step. Only this origin's hosted path for this journey. False when there is none yet. */
private _resumeLinkHere;
private _chatgptPhoneFallback;
/** Start over on a ChatGPT link this tab cannot take: the journey leaves this tab for good (memory and both storages,
* as a sign-out drops it) and a new one is prepared. Nothing changes on the server: ChatGPT's saves stay the person's,
* and the old back link still works where it was given. Ignored while a new journey is on its way (a double tap). */
private _restartChatgptLink;
private _adoptChatgptLink;
/** Each open renews the copied message's scoped code, so a message pasted a little later still works. */
private _refreshAgentPrompt;
private _preparePluginSetup;
private _preparePluginSetupAttempt;
private _openImport;
/**
* Before the phone the grid acts as whoever this link resolves to: the unlinked user, or the
* account this partner user linked on an earlier visit. Once a gesture has opened the link, ask
* ONCE what that account already holds, so an app it has reads Connected and a tap on it never
* opens a window only to hear "already connected" and close it again (Manuel's staging walk,
* Sep 22 17:53: "the connect buttons aren't working"; his Newly user was linked to his account,
* which had Gmail and Calendar). Never on load: the link is single-use, and only a gesture may
* open it (_ensureFlowOpened); the preview carries nothing personal (peekHandoff).
*/
private _flowToolsSeeded;
private _seedV6FromFlowSession;
/** Apps that hold more than one account (Manuel, Sep 22: "if I want to connect a second Gmail…
* should I be able to do that instead of it saying already connected?"). Gmail keeps a list of
* accounts with a default (gmailAccounts.ts), so a tap on a connected Gmail adds another one,
* exactly like the Gmail step's "Add another account". Calendar and the rest keep ONE account
* (toolSync markToolConnected / syncCalendar), so a second grant would not be read: their
* connected pill stays a no-op. */
static readonly V6_MULTI_ACCOUNT_APPS: ReadonlySet;
private _toggleApp;
/**
* Intent lives on the session (replace-not-append); the outcome is /finish's to report.
* Best-effort, but SERIALISED: two POSTs in flight can complete in either order and the
* server would keep whichever landed last — the older selection. One request at a time,
* each aborted after 10s so a straggler can never land after its successor; taps during a
* request coalesce into one follow-up carrying the latest list.
*/
private _selectionChain;
private _selectionDirty;
private _postConnectorSelection;
/** "Already use Configure? Sign in": the phone first, then the grid signed in. */
private _signInFirst;
/** The phone step in the connect lane's words: always on a partner's connect link; on an agent lane
* that showed the grid first, once the person signs in from it or brought something in there
* ("It saves what you brought in…" would be untrue for someone who only came to sign in). */
private _connectPhoneCopy;
private _signingInFirst;
private _onV6Continue;
/**
* A second tap on the app whose sign-in address is still on its way (the 1-3 s before Google's window or redirect
* exists) is ignored. Restarting then only threw away a link that was about to open and fetched another (prod, Oct 1:
* two taps 0.6 s apart made two Google links; Newly). Nothing is stuck yet, so the Sep 22 rule above has nothing to
* rescue. Bounded: after REPEAT_TAP_GRACE_MS a tap restarts as before, so a request that hangs never holds the person.
*/
static readonly REPEAT_TAP_GRACE_MS = 6000;
private _connectTappedAt;
private _linkOnItsWay;
private _v6Row;
private _settleApp;
/** Drop the pending connect: its row stops polling, its pill goes back to Connect, no error. */
private _abandonConnect;
private _connectApp;
/** The pill spins for this app until its row settles (connected, preserved or failed), 60 s at most. */
private _trackAppConnect;
private _sameTabReturnSeen;
private _pageIsSameTabReturn;
/**
* Back from a grant this tab ran on a phone: the page reloaded and knows nothing of the trip. Before the phone
* it opens its session again, so the code binds what the session holds (a return that never taps again would
* otherwise leave the grant on the provisional user). It also shows what that session already holds: the apps
* connected and the assistants imported before the trip. Without that, a mailbox connected on an earlier trip
* put the person back on "First, connect Gmail or Outlook". The link is open already, so nothing new is burned
* (open and peek take the cookie that holds the session). Signed in, the owner preload reads the account.
*/
private _restoreAfterReturn;
/** A phone came back from a grant it ran in this tab (the row resumed it from the URL the callback sent
* it to): the app's pill spins exactly as if it had just been tapped, and settles the same way. */
private _onV6AppResumed;
/** The row kept the account's working grant and turned the new one down: the same mailbox picked again, or one
* granted without mail access. Anywhere but a repair that is the app connected, settled at once (the pill spun the
* full 60 s, parity A47). A repair link asks for a fresh grant (a stored "connected" is what broke), and a kept
* grant leaves the broken mailbox broken: the pill stays "Reconnect", says why, and Continue still waits for it. */
private _onV6AppPreserved;
/** Mailboxes that proved the person's address though its mail was not shared (the Gmail box left unticked), on a
* flow that needs no mailbox access. They meet a required mailbox; they are not connected apps. Kept for this tab,
* so a phone's same-tab trip for another app (the page reloads) does not put the mailbox page back. */
private _emailOnlyApps;
static readonly EMAIL_UNCONFIRMED = "We couldn\u2019t confirm this email for your account. Try Outlook or another Gmail.";
/** Per partner: another partner's flow in this tab (one that does need the mail) never inherits the mark. */
private _emailOnlyKey;
private _readEmailOnly;
private _writeEmailOnly;
/** A mailbox grant the server refused ONLY for its mail (read_scope_missing) while handing back the address. */
private _emailOnlyShape;
/** Before the code, on a flow that asked for no mailbox access: that grant meets a required mailbox. After the code
* (the email step, _v6NeedsEmail) only the server can say whether it proved the address: a sign-in page judges it
* once the account is read (_emailOnlyAwaitsRead, _settleEmailOnlyAfterRead), never before; a page that reads no
* account then says at once that it could not confirm it (_mailboxNeedsNoAccessFailure). Anything else (a cancel,
* an error, no address) stays a failed connect. */
private _emailOnlyMeets;
/** The email step's own case: an email-only grant on a sign-in page whose flow-wide handler re-reads the account. */
private _emailOnlyAwaitsRead;
/** After that read: the address proven (the server kept it while refusing the mail) is the pass; not proven is the
* load-bearing assumption failing, said on the row and to the funnel. A read that failed says nothing either way:
* _confirmProfileMailbox's own "try again" stays. */
private _settleEmailOnlyAfterRead;
/** A flow that needs no mailbox access never asks for more permissions (Manuel, Sep 30: "make sure we're not asking
* for additional permissions"): a mailbox refused for its scopes there failed on the ADDRESS (unread, or not proven
* for this account), so its words say that and point at the ways that can work. */
private _mailboxNeedsNoAccessFailure;
/** This journey's arm in the Gmail permission experiment. Never throws: anything unexpected is the control, unenrolled. */
private _gmailScopeAssignment;
/** Gmail came back without its permission: the experiment decides what the row says. Records the exposure once. */
private _gmailScopeArmOnFailure;
private _onV6AppSettled;
/** /finish has answered: the receipt may claim rows and start the countdown. */
/** Rule: an empty answer and a broken contract must never look the same. Missing arrays are announced once per answer. */
private _contractMissingAnnouncedFor;
private _announceContractGaps;
/** /finish has answered: the receipt may claim rows and start the countdown. */
private _v6Settled;
/** What the receipt lists on an agent lane: what the account holds that this screen knows of — the imports and
* apps seeded from the account plus what the person brought in here. Same shape as /finish's answer. The server
* says whether each landed (_loadAgentSummary); the page's own lists stand in only when it could not. */
private _agentReceiptSummary;
private _localReceiptSummary;
/** The server's answer for an agent lane's receipt (parity A52/C24). Before it, the receipt was this page's own
* lists: a connect the bind lost, or an import the job failed, still showed a check, and the seed from the
* account only ever added. Read once the lane is done: the account's own connection state for the apps in view
* (/v1/me/tools/status, the preload's read) and the imports this page's session holds, with their status and
* count (GET /v1/flows/session, the shape /finish answers the partner lane). Past the deadline, or on any
* failure, the page's own lists, announced. */
private _agentSummary;
private _agentSummaryDone;
private _agentSummaryLoad;
/** Which lane a read belongs to: a new attempt (_resetV6Lane) moves it on, and a late answer is dropped. */
private _agentSummaryGen;
static readonly AGENT_SUMMARY_DEADLINE_MS = 3000;
/** How many receipt rows show before the rest fold behind "N more". */
static readonly RECEIPT_FOLD = 3;
/** The receipt's "more" as the person left it; null until they touch it (then it follows the rows). */
private _receiptOpen;
/** Set by a press on "more" that opened it: after that render, bring "Show less" into view above the button bar. */
private _revealReceiptMore;
private _revealMore;
/** The receipt opened its "more" by itself for a row that needed the person (not state: a latch the render reads). */
private _receiptAutoOpened;
private _loadAgentSummary;
private _readAgentSummary;
/** The receipt's one action on an agent lane: the page's own way out, once (the button and the countdown
* race; a window that will not close gives way to "You can close this tab now."). */
private _leaveByPageEnding;
/** A Close the browser refused. A page may close only a tab a script opened, or one another app opened fresh
* (MDN, window.close), and a second press is refused the same way, so the button gives way to the one thing
* left to do: Manuel's ending rule, Sep 25 ("You can close this tab now."). Every Close on the receipt ends
* here when it cannot close: the page's own ending, a partner's tab without a return address, a plain Close,
* and the Close of a session that cannot finish. (The header's X says it in its own dialog: _leaveNow.) */
private _closeFallback;
/** Bumped by a new attempt (sign-out, restart): a refusal timer from the attempt before says nothing. */
private _closeGen;
private _closeNote;
/** A plain Close: close this tab, or say the line when the browser will not. */
private _closeThisTab;
private _sayCloseFallback;
private _v6FinishFailed;
/** source_busy = the import is still being sorted; every other code = the finish did not happen. */
private _v6FinishBusy;
/** The receipt: rows of what the server says attached (if its answer lacks the fields, the local list — announced; a claim
* accepted after the answer is merged as "Importing"), one action, auto-return. */
private _renderV6Receipt;
/** What leaving now would lose: imports attached pre-identity and apps chosen or connected. */
private _v6AtStake;
/** The header's X (Manuel, Sep 22): on the receipt, or signed in, or with nothing at stake, it leaves
* at once; otherwise it asks first. The copy is the plain warning Manuel asked for in round 4 —
* leave now and the context is lost — and it deliberately does NOT advertise that the partner can
* still read what was connected: the person's own context is what is at stake here. */
requestLeave(): void;
/** The open confirm names what leaving would lose (imports and apps before the code), or asks plainly. */
private _leaveLoses;
/** The X's close was refused: its dialog says "You can close this tab now." */
private _leaveRefused;
/** Some close in this attempt (the X, the receipt's Close, the way back by closing) was refused by the browser. */
private _tabCloseRefused;
/** Back to the partner when there is a return, else to the site this tab came from, else close the window the
* partner opened. A close the browser
* refuses says "You can close this tab now." in the leave dialog, on whichever screen the X was pressed: the
* receipt's dock keeps its own ending, which may still work (a page's "Return to Atlas"). */
/** The site this tab came from, when no window opened it: by origin only, https only, never this page, never a
* sign-in provider (a same-tab Google sign-in leaves Google as referrer) and never one of our own redirect hops.
* The accounts page's partnerWayBack is the same rule. A window the partner opened closes back to it instead. */
private _cameFromUrl;
private _leaveNow;
private _renderLeaveConfirm;
/** Apps the person chose on screen 1 that have not connected yet (Manuel, Sep 22: "make sure all
* the connect pills work… don't make it fake at all"): while any remain, the receipt offers a real
* Connect and never auto-returns — leaving would turn the choice into nothing. */
private _v6PendingConnects;
/** The receipt's Connect: the same OAuth row screen 1 uses once signed in, started inside the tap
* (the row reserves its window synchronously). Stops the auto-return: the person is acting here. */
private _connectFromReceipt;
/** The receipt stays about two seconds (Manuel, Sep 22), shows the work inline on the button, then the page leaves. */
/** How long a finished agent lane waits for its page's ending before the receipt says it is taking longer. */
static readonly ENDING_WATCHDOG_MS = 30000;
static readonly RETURN_SPIN_MS = 5000;
static readonly RETURN_LEAVE_MS = 5800;
/** A chosen app still unconnected: the receipt waits this long before leaving, enough to tap Connect
* (Manuel, Sep 22 round 4: the auto-return must come back — it had been held while apps were pending). */
static readonly RETURN_PENDING_MS = 8000;
/** The plugin connect screen's receipt has no rows to read (Manuel, Oct 16: "just continue, and then redirect"): the
* check shows, then it goes back. */
static readonly RETURN_FOCUSED_MS = 900;
/** ChatGPT's install from a partner: the receipt says the one next step (reply "done" in the chat), so it stays long
* enough to read before ChatGPT's callback takes the tab (Oct 21 video: 0.9 s and nobody saw it). */
static readonly RETURN_GPT_PARTNER_MS = 4500;
_returnDelayMs(): number;
private _scheduleReturn;
/** The partner opened this tab itself (Newly's window.open) and gave no return URL: the way back is
* its own tab, reached by closing this one (Manuel, Sep 23: "it didn't redirect me to Newly" — a
* link without a return URL ended on a bare Close). Until a close is refused, that is the return. */
private _closeRefused;
private _returnsByClosing;
private _returnToPartner;
/** The dialog-only import card on the current screen (grid or settled receipt), if any. */
private _importCard;
/**
* The providers the import surfaces may offer: the session's sources when the
* page passed them, else '' so the cards fall back to their own default. Only
* known slugs survive; a list that normalises to nothing is treated as unset
* rather than rendering an empty chooser.
*/
private _importProviders;
/** The claim answers "importing" before the paste is read. An empty one settles within 2 s and a failed one within
* 26 s (prod, 7 days to Oct 31), so the page asks again until it knows. */
private _settleWatch;
private _watchImportSettle;
/** A claimed card's label: "Imported", unless the import brought nothing. */
private _v6ImportedLabel;
/** One line under the cards when the last import brought nothing: what happened, and that they may go on. */
private _v6ImportNothingLine;
private _claimStagedImport;
private _flowApi;
/** A flow session was opened on this page (a gesture needed it): there is pre-phone work to bind. */
private _flowOpened;
/** Which of this page's sessions a call was made under: a refusal answers for that session only. */
private _flowGen;
/** Open the flow session once: the cookie authorises everything after. A partner's link burns its
* handoff, so it opens on a gesture only (never on load); an agent lane mints this page's own session,
* which the mailbox page opens as it paints — the server hands back the open one THIS TAB already
* holds for this app, so a reload keeps its work (and no other tab or person on the browser gets it). */
private _ensureFlowOpened;
/** A partner link that cannot open is the partner's terminal (the page shows it). This page's own
* session failing fails only the tap that needed it: the card or pill says so, and the person can
* still sign in and do it from the signed-in grid. */
private _flowSessionFailed;
/** Why this page's own session last failed to open ('status_429', 'offline', …): a row's prepare() says it. */
private _flowOpenRefusal;
/** A connection row's prepare(): this page's session. Told only "false", the row said "unable to connect —
* check configuration" for a rate limit, an outage and a dropped network alike (a real row, Sep 25): a
* setup problem the person cannot fix. Handed the reason, it says it in its own words. */
private _openFlowForRow;
/** The server refused this page's own session: another tab on this browser opened one since (a session
* belongs to the tab that opened it, and the cookie now names theirs), or it expired. The next gesture
* opens a session of this tab's own. What this tab brought in before the phone lives on the session it
* can no longer reach, so the grid stops showing it as done. A partner's link is one session for its
* life, and a bound session is the account's: neither is touched. */
private _flowSessionLost;
private _emitPartnerFlowError;
/**
* The account the person just proved (fresh code or restored session) becomes
* the one the partner's handle is bound to. Idempotent: a session already
* bound answers already_verified and counts as bound. A handle bound to a
* different account is the one refusal, and it ends the flow on a partner
* terminal rather than routing anywhere.
*/
/** This link's session was linked to the account by a code entered HERE. From then on the person
* proved the number themselves, so there is no "Not you?" and no sign-out: signing out would
* leave an anonymous-looking grid on a session the server has already linked — its connects
* refused ("already verified", staging walk Sep 22) and its imports landing on the account
* that just left. Someone who arrived signed in from a saved cookie keeps both. */
private _boundThisLink;
get boundThisLink(): boolean;
/** The server holds this link bound to the account, by either path (the code, or a Done/restore). */
private _linkBound;
private _bindPartnerAccount;
/** An agent lane's own session, bound at the code when the grid held pre-phone work, so what the
* person imported or connected before the phone reaches the account they signed in with. Nothing
* held (no tap before the phone) is nothing to bind. A failure never blocks the sign-in: it is
* recorded, and the approve step tries once more (_mintAgentToken). */
private _bindHostedFlow;
/** The receipt: the session goes ready with or without imports. Runs where the mint runs. */
private _finishPartnerFlow;
private _startMachine;
private _mintStarted;
private _classifyInFlight;
/** The machine has left its boot states at least once for this actor. */
private _resolvedOnce;
/** Connection truth resolved with the session, handed to the connections step. */
private _ownerPreload;
/** The last account read that answered (never nulled by a re-read in flight): the receipt's fallback only. */
private _lastOwnerPreload;
/** What the account held at its last good read, for the receipt. A re-read in flight (the Gmail row's own confirm on
* the page a phone's Google trip returns to, or a connector change) blanks _ownerPreload until it answers, and a
* summary computed then listed no imports: "You're all set" without ChatGPT (Oct 7 review). Only this session's
* read stands in. */
private _accountReadForReceipt;
private _linkedEmitted;
private _lastTraceState;
private _flowTrace;
/** Last N machine transitions, oldest first — readable from the console
* (`$0.flowTrace()`) and attached to every emitted error. */
flowTrace(): Array<{
t: number;
from: string;
to: string;
event: string;
}>;
private _traceSummary;
private _send;
/** Machine context accessors for render/plan. */
private _machineFloor;
private _machineHasTag;
private _flowSessionFromSelf;
private _connectedMailboxEmail;
/** Surfaces where the mailbox step is a gate, not an offer: require-email
* sign-ins (the relying party signs the user in BY the address the
* connected account proves). Configure's own profile sign-up offers a
* mailbox and never requires one (Oct 5 2026; see needsRequiredMailbox). */
private get _mailboxRequired();
private _mailboxStillNeeded;
private _syncMailboxState;
/** A popup completion is only a prompt to read provider truth. Generic
* labels, typed identity email, and failed/cancelled grants cannot finish
* profile signup. */
private _confirmProfileMailbox;
/**
* Classify the entry session with THREE possible answers. A transport
* failure or 5xx is could-not-tell, never signed-out — conflating them is
* the "bounced back to the phone step" bug class (this exact conflation
* lived in the legacy `_checkProfileData` 401 handler).
*/
/** Resolve the connection truth BEFORE the connections step can paint: the
* same /v1/me + /v1/me/tools/status pair the connection list fetches for
* itself. Handing it over makes the first paint the final one. Any failure
* leaves null and the list fetches for itself (old behaviour) — never a
* hang, never a wrong-then-right paint on the happy path. */
/** AbortSignal with a deadline that works on every engine (AbortSignal.timeout
* is missing on older Safari/Firefox, and a missing signal meant NO cap). */
private _timeoutSignal;
/** The preload may only IMPROVE the first paint, never hold it: past this
* deadline the step paints and the list fetches for itself. */
private _preloadWithDeadline;
/** On the grid-first screens, a lane that signs people in BY email (an OIDC email scope, profile sign-up) routes
* on the account: whether it already holds a proven address. That route waits for the account read; the code
* screen holds its busy state meanwhile. Routing on the deadline's default ("no email") painted the mailbox page
* for a second, then stranded an existing account on the grid instead of the receipt (Manuel, prod, Sep 26). A
* read that fails is could-not-tell (the designed recovery), never "no email". Every other lane keeps the
* deadline: there the preload only improves the first paint. */
private _routesOnAccount;
private _preloadForRouting;
private _toolsStatusUnreadableSaid;
private _preloadOwnerState;
private _classifyEntry;
/** Pull the connected-tool facts out of a /v1/me payload for the session. */
private _adoptProfileState;
/** True only for the server's companion boolean, never a bare email string. */
private _identityEmailVerified;
start(): Promise;
refresh(): void;
getFixturePreviewState(): FixturePreviewState | null;
restoreFixturePreviewState(state: Partial): boolean;
useDifferentPhone(): Promise;
/** The ONLY path that destroys a session: the confirm modal's confirm. */
confirmChangeNumber(): Promise;
goBack(): Promise;
applyInit(data?: HostedInit): void;
/**
* The funnel's screen id for a step on the connect lane. The Pulse funnel
* (flowFunnel.ts) reads a journey's position as the furthest PATH index it
* reached, so the spine must be emitted under exactly these ids:
* connect_import → phone → otp → approving → connect_done, with
* approving (the finish in flight) as the last PATH step. A failed finish is
* its own id (connect_failed): rendered on the same screen, but an error
* emitted under the complete id would count as finished. Other lanes keep
* their step ids untouched.
*/
/** The funnel id; the connect mapping is pure (flow/screens.ts) so the lane's BFS test can pin
* that no reachable state emits a name the funnel does not know for connect. */
private _analyticsScreen;
/** v6 reactions to a step or finish change; split out so tests drive it without the whole lifecycle. */
private _afterStepChange;
protected willUpdate(changed: Map): void;
protected updated(changed: Map): void;
private _hostedViewName;
restoreSession(options?: {
checkProfile?: boolean;
}): boolean;
clearSession(): void;
private _resetFlowView;
private _apiBase;
private _telemetryContext;
private _componentOutcome;
private _recordMachineState;
private _recordFlowStarted;
private _recordStepView;
/** The last screen name sent to the shell, so a page change within one step is announced once. */
private _announcedScreen;
/**
* A page change INSIDE one step (the trust screen gives way to the grid on Continue; the email page to the grid once a
* mailbox lands). The step-level events only fired on a step change, so the page that went was never "completed" (its
* reading time was lost) and the page that came was never "viewed" (Reach by screen counted the grid only for visits
* that opened on it: half of a partner link's, once the trust screen A/B started, Oct 4). Both are recorded here, by
* screen name, as auth_step_viewed already names its step.
*/
private _recordScreenChange;
private _announceStep;
/** Mandatory-mailbox surfaces park on the mailbox step until an address is
* proven; BACK is guarded off there (machine `email.on.BACK`), so it must
* not be offered. */
private _backIsGuardedOff;
private _recordTerminalStep;
private _onPageHide;
private _recordFlowExit;
private _onVisibilityChange;
/** True when this flow started from a restored session rather than a
* fresh phone verification — the planned path (and therefore the progress
* indicator) differs between the two. */
private _restoredEntry;
/** The stages THIS flow will actually walk, given how it entered and what
* the link asked for. The progress indicator renders one segment per
* entry — the lines at the top must tell the truth per state, not always
* claim three steps (Aug 31 roadmap). */
private _stagePlan;
private _stageForStep;
private get _isSso();
private _normalizeMethods;
private _normalizeList;
private _supportsPhoneMethod;
/** Fixture rows for the connections step, honoring the `connectors`
* attribute so connector-scoped and reconnect previews render the SAME
* scoping the live flow would — a single-connector link shows one card,
* a reconnect link shows its named connectors broken. */
private _fixtureConnections;
private _journeyStorageKey;
private _requestedStageFromUrl;
private _hydrateJourneyResume;
private _persistJourneyResume;
private _clearJourneyResume;
private _validatedResumeStep;
private _requestedAuthenticatedStep;
private _oauthReturnUrl;
private _syncStageUrl;
private _writeSession;
private _clearStoredSession;
private _sessionBase;
/** The accounts origin whose session cookie this page may use: the accounts
* host itself, or a FIRST-PARTY SIBLING the accounts edge admits for
* /v1/auth/session/* (mirror of firstPartySessionSiblingOrigins in
* apps/web/server.mjs and siblingOrigins in the backend). Every other host,
* the OAuth authorize and MCP connect pages on api.* included, gets '' and
* never attempts a cookie restore, create or revoke there: the browser
* blocks those calls by CORS, and a blocked probe must not read as
* "Configure is unreachable" or "sign-out failed". */
private _firstPartyApiBase;
private _createFirstPartySession;
private _verifyFirstPartySession;
private _restoreFirstPartySession;
private _legacyProfileCookieDomain;
private _legacyProfileCookieAttributes;
private _clearLegacyProfileAuthCookie;
private _readSession;
private _stopUserTokenPersistence;
/** The number this page last texted a code to, and when (a send or a resend). Kept in memory only, for one rule:
* the same number refused by the provider's limit goes back to its code screen (_onPhoneSubmit). */
private _codeSentTo;
/** The code screen opened without a new code: its texted codes are the way in (configure-otp-input resend-limited). */
private _otpResendLimited;
/** How long codes already texted count as on their way: Prelude's verification window ("a few minutes",
* dashboard-configured). Past it, the limit message stays on the phone screen as before. */
static readonly CODE_SENT_FRESH_MS: number;
private _onOtpResent;
private _onPhoneSubmit;
private _onOtpChange;
/** Connect lane: the work after the code (first-party session, preload, the partner bind — which
* waits on the import's judge run) is not instant. Measured Sep 21: 20s on "Phone verified" read
* as the flow having stopped. While it runs the OTP screen says what is happening. */
private _postCodeBusy;
private _afterCodeLabel;
private _onOtpVerified;
private _afterCodeVerified;
/** Fold a /v1/me payload, the Gmail account list and the owner tool state
* into the flow's email-provider view. ONE parser for the post-resolve
* check and the pre-render preload. */
private _applyProfileData;
private _checkProfileData;
private _restoredSessionLacksPhoneEvidence;
private _fetchConnectedGmailAccounts;
private _fetchOwnerToolState;
private _isEmailLabel;
private _gmailAccountLabel;
private _mergeGmailAccounts;
/** A server-built list plus the pending rows it cannot know about. A real
* grant for a pending address retires that pending row for good. */
/** A real provider id for a row, or undefined for a pending/placeholder row. */
private _gmailRealId;
private _withPendingGmailAccounts;
/** Any connector change makes the boot-time preload stale: a list that
* remounts (Back from the access step) would paint the old truth. Drop it
* and refresh in the background; the live list already updated itself. */
private _invalidateOwnerPreload;
private _onToolConnected;
private _onToolDisconnected;
private _showOutlookLimitNotice;
private _onGmailAccountRemove;
private _onGmailAccountAdd;
private _onToolPreserved;
/** The mailbox the user just tried, rejected for lacking Gmail access: list
* it as pending with the consent link instead of dropping it. Pending rows
* live apart from the server list so every rebuild re-applies them. */
private _notePendingMailbox;
private _onToolError;
private _fixtureAccountsForState;
private _skipGmail;
private _onAddAccount;
private _refreshConnectedGmailAccounts;
private _resumeAfterPhoneVerification;
private _onTransferDeferred;
private _onConnectionsContinue;
private _onConnectionsSkip;
/** A child step (connections list, access editor) saw the token rejected
* mid-flow. Same road as every other auth loss: clear, bump the epoch,
* AUTH_LOST → sessionExpired. Never the phone step, never a dead retry. */
/** True when a bubbling event came from inside this element's own shadow
* tree. Anything else (host page scripts, other components) is not a
* child step and must not steer the machine. Events without a composed
* path (synthetic, tests) are trusted as direct calls. */
private _fromOwnChild;
private _onChildAuthRejected;
private _onProfileDeclined;
private _onProfileBack;
private _onShowProfile;
private _onProfileApproved;
private _connectorCompletionId;
private _completeConnectorOnly;
/**
* Mint an approval receipt from the durable accounts session. A restored
* session (cookie or the 24h localStorage blob) carries no live OTP
* receipt, so /v1/embed/approve would 403 the first connect to any NEW
* agent and bounce a signed-in user back to phone verification. The
* backend mints the same single-use receipt OTP verify does, gated on the
* HttpOnly session cookie + allowlisted first-party Origin, so consent
* collected by this flow's own approval UI still lands without re-OTP.
*/
private _fetchSessionReceipt;
/** Approve refused the person's token and the page asked for the phone again; cleared by a mint that succeeds. */
private _tokenLostAtApprove;
private _mintAgentToken;
/** Configure's own sign-up finishes with or without a mailbox (Oct 5 2026: it offers one and never requires one;
* the server's profile handoff no longer asks for one either). */
private _completeProfileSignup;
private _emitLinked;
private emitError;
private _fixtureAllowed;
private _fixtureEnabled;
private _renderProviderChoice;
private _handleDisclosureToggle;
private _renderVerifiedPhone;
/** The boot placeholder: grey line skeleton (title, subtitle, four icon +
* two-line rows). No text, no controls, no layout that a real step would
* contradict; it stands in for "the machine is resolving where you are". */
private _renderBootSkeleton;
render(): typeof nothing | lit_html.TemplateResult<1>;
private _renderScreen;
private _renderState;
}
type HandoffOutcome = 'started' | 'succeeded' | 'failed' | 'declined';
type HandoffDestination = 'profile' | 'browser' | 'opener' | 'message' | 'oauth' | 'mcp';
type HandoffDetails = {
status_code?: number;
error_code?: string;
};
/**
* Hosted shell controller — the ONE implementation of the chrome around the
* hosted auth flow: header rules (back / brand / sign-out / X), the truthful
* progress bars, the intro screen, and terminal visuals.
*
* Every hosted surface renders the same canonical template
* (apps/web/accounts/index.html — the OAuth authorize page is sliced from
* it server-side) and mounts the same `configure-hosted-auth-flow`. Before
* this module each surface re-implemented the shell behavior in its own
* inline controller, and they drifted: the OAuth copy was still driving bars
* through a CSS variable the shared stylesheet no longer had. Now the pages
* keep only their LAST step (OAuth approve/redirect, sign-in return code,
* embed postMessage) and delegate everything else here.
*
* Deliberately framework-free: it runs against the template's DOM ids so it
* can drive the page before any element upgrades, and so a page whose
* bundle failed to load can still show an honest fallback.
*/
type HostedStep = 'intro' | 'imports' | 'phone' | 'otp' | 'verified' | 'gmail' | 'email' | 'connections' | 'profile' | 'complete' | 'expired' | 'blocked' | 'unsupported' | string;
interface HostedTerminalOptions {
heading: string;
copy: string;
href?: string;
actionLabel?: string;
/**
* Page-owned action for the CTA when there is no href to follow — e.g.
* "Try again" after a failed last step. Rendered as a button.
*/
onAction?: () => void;
/**
* 'complete' (done, may offer Return), 'return' (a mid-flow exit), or
* 'error' (the last step failed: the finish is NOT counted in the bars and
* the card is announced assertively).
*/
mode?: 'complete' | 'return' | 'error';
hideBack?: boolean;
}
interface HostedShellOptions {
/** Whether this surface opens on the intro ("«Agent» uses Configure…"). */
useIntro: boolean;
/** A link scoped to one connector (mint or repair): no Back on entry. */
scoped: boolean;
/** The mounted flow element, when there is one. */
getFlow: () => FlowLike | null;
/** A non-phone step arrived while the intro is showing: skip the intro? */
revealOnStep?: (step: HostedStep) => boolean;
/** Page-specific last step: the X was pressed. */
/** Page-specific: Back pressed while a terminal is showing. Return true
* when handled; false lets the shell clear the terminal and go back. */
onTerminalBack?: () => boolean;
/** Hooks for page analytics. */
onStep?: (step: HostedStep, stage: string) => void;
onIntroReturned?: (from: string) => void;
onIntroContinued?: () => void;
onTerminalRendered?: (options: HostedTerminalOptions) => void;
/** Base document (tests). */
document?: Document;
}
/** A page's success ending, as the receipt carries it: the one action, and whether the page would
* have left by itself (the receipt then counts down, Uber's pacing, before doing it). */
interface HostedEnding {
label: string;
go: () => void;
auto?: boolean;
/** The countdown's line when leaving means something other than "Returning to …" (a window that closes). */
autoNote?: string;
/** How `go` leaves. A navigation keeps this page on screen until the next document answers, so the receipt
* stays "returning"; a close can be refused by the browser, after which the receipt says "You can close this
* tab now." in the button's place. */
leaves?: 'navigate' | 'close';
/** Wait this long (ms, at most 120 s) before the ending is offered: the receipt keeps "Finishing your connection…"
* up, then settles and counts down as usual. ChatGPT's install only, when the server asks for it. */
holdMs?: number;
}
interface FlowLike extends HTMLElement {
goBack?: () => void | Promise;
useDifferentPhone?: () => void;
/** Connect flow: the top-right X. Confirms when leaving would lose context; leaves at once otherwise. */
requestLeave?: () => void;
/** A partner's connect link (the page set import-first). */
importFirst?: boolean;
/** The grid comes before the phone on this lane (a partner's link, or an agent lane on the connect screens):
* the header's X leaves it, with the confirm when something would be lost. */
leavesByX?: boolean;
/** A code entered on this link bound the session to that account. */
boundThisLink?: boolean;
/** A screen with no step bars (the plugin connect screen, Oct 18). */
hidesProgress?: boolean;
/** Every lane on the connect screens ends on the agreed receipt; the page hands it its ending. */
acceptsEnding?: boolean;
presentEnding?: (ending: HostedEnding) => boolean;
/** The page's own card covers the flow, or no longer does: a receipt waiting for the page's ending stops waiting. */
setCoveredByPage?: (covered: boolean) => void;
_userToken?: string;
/** The number screen shows the shell's "Secured by Configure" instead of its own trust cards (ChatGPT's co-branded install). */
securedOnPhone?: boolean;
}
interface HostedShell {
readonly step: HostedStep;
readonly stage: string;
readonly plan: string[];
readonly terminal: boolean;
readonly terminalMode: string;
readonly introDismissed: boolean;
readonly introVisible: boolean;
setPlan(plan: unknown): void;
updateProgress(step: HostedStep): void;
updateStep(step: HostedStep, stage?: string): void;
showIntro(options?: {
focus?: boolean;
}): void;
showFlow(options?: {
focus?: boolean;
}): void;
/** Paint a terminal card in the flow slot; returns the element so the page
* can decorate its CTA (single-use codes etc.). */
renderTerminal(options: HostedTerminalOptions): HTMLElement | null;
/** A page's SUCCESS ending. On the connect screens the flow's receipt carries it (the rows of what was
* imported and connected, the check, this one action, the countdown) and nothing is painted over the
* flow; returns true. Everywhere else it does nothing and returns false: the page paints its own card
* and keeps its own navigation, exactly as before. */
finishWith(ending: HostedEnding, card?: HostedTerminalOptions): boolean;
/** Remove the terminal card and show the flow again. */
clearTerminal(): void;
/** Mark terminal state without painting (page-owned terminals). */
setTerminal(terminal: boolean, mode?: string): void;
/** Wire the flow's events; call once per mounted flow. */
attachFlow(flow: FlowLike): void;
/** Report the page-owned final operation separately from component approval. */
trackHandoff(outcome: HandoffOutcome, destination: HandoffDestination, details?: HandoffDetails): void;
}
declare function createHostedShell(options: HostedShellOptions): HostedShell;
declare function showGmailDisclosure(onContinue: () => void): void;
declare class ConfigureSingleConnector extends ConfigureBase {
toolId: string;
message: string;
name: string;
connected: boolean;
loading: boolean;
reconnectRequired: boolean;
error: string;
static styles: lit.CSSResult[];
private _getName;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureToolApproval extends ConfigureBase {
actionId: string;
tool: string;
params: ToolApprovalParams;
timeoutSeconds: number;
private _decided;
private _secondsLeft;
private _timer?;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
private _approve;
private _deny;
private _alwaysAllow;
private _getTitle;
private _getResultText;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureConfirmation extends ConfigureBase {
message: string;
confirmLabel: string;
cancelLabel: string;
private _decided;
static styles: lit.CSSResult[];
private _confirm;
private _cancel;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureAccessRequest extends ConfigureBase {
agent: string;
tool: string;
message: string;
description: string;
private _decided;
private _saving;
static styles: lit.CSSResult[];
private _allow;
private _deny;
private _removeAgentFromExactOverrides;
private _saveDecision;
private _showProfile;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureMemoryCard extends ConfigureBase {
memories: MemoryData[];
maxVisible: number;
showSettings: boolean;
showActions: boolean;
private _expanded;
static styles: lit.CSSResult[];
private _toggle;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigureRuntimeReading extends ConfigureBase {
label: string;
private _head;
private _hue;
private _timer?;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
private _dotStyle;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigurePersonalizationButton extends ConfigureBase {
placeholder: string;
variant: 'menu' | 'integration';
personalizationLabel: string;
imageLabel: string;
fileLabel: string;
connectors: string;
externalId: string;
hideImages: boolean;
hideFiles: boolean;
manual: boolean;
private _menuOpen;
private _linkOpen;
private _linked;
private _enabled;
private _linkFrame;
private _handleDocumentPointerDown;
private _handleDocumentKeydown;
static styles: lit.CSSResult[];
disconnectedCallback(): void;
connectedCallback(): void;
updated(changed: Map): void;
private _toggleMenu;
private _destroyLink;
private _closeLinkSurface;
private _emitToggle;
private _selectImage;
private _selectFile;
private _openPersonalization;
private _togglePersonalization;
private _icon;
render(): lit_html.TemplateResult<1>;
}
declare class ConfigurePersonalizationPage extends ConfigureBase {
brandLogoSrc: string;
static styles: lit.CSSResult[];
private _connect;
render(): lit_html.TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
'configure-personalization-page': ConfigurePersonalizationPage;
}
}
declare const EXPORT_PROMPT = "List everything you know about me. Before you answer, search your past chats with me (as many searches as you need: my work, my projects and app ideas, where I live, my family, my preferences), and also use what I asked you to remember (saved info). Include what you learned about me in those past chats, including projects and ideas I worked on with you, tools I use, and where I live and work. Use my own words where you can, especially for instructions and preferences.\n\nPut each item on its own line, starting with when you learned it in square brackets: [YYYY-MM-DD], [YYYY-MM], or [YYYY], whichever you know, or [unknown]. Group the lines under these five headers, each header on its own line exactly as written, and end with ---END--- on its own line:\n\n---SECTION:Instructions---\n---SECTION:Identity---\n---SECTION:Career---\n---SECTION:Projects---\n---SECTION:Preferences---\n\nInstructions is how I want you to respond; Identity is who I am, where I live, and my family; Career is my work; Projects is what I am building or planning; Preferences is what I like and how I do things.\n\nOnly write things you actually know about me. Never guess or make up an item, and never copy these instructions into the list. No bullets, numbering, bold, or code block. Leave a header empty if you know nothing for it.\n\nIf you have no saved info and no past-chat context about me, reply with only: NO_MEMORIES";
/** Provider URL builders */
declare const PROVIDER_URLS: Record string>;
/**
* Whether the provider's URL actually carries the prompt. Drives the one line
* of copy that tells the user what to expect -- "already written, send it" vs
* "copy it and paste it there" -- so a wrong value here reads as the page
* lying about what just happened.
*/
declare const PROVIDER_PREFILLS: Record;
/** Default labels per provider */
declare const PROVIDER_LABELS: Record;
/** Which prompt each provider uses */
declare const PROVIDER_PROMPTS: Record;
declare class ConfigureAuthModal extends ConfigureBase {
open: boolean;
connectors: string;
agent: string;
private _step;
private _phone;
private _error;
private _hasProfileData;
static styles: lit.CSSResult[];
connectedCallback(): void;
disconnectedCallback(): void;
private _onPhoneSubmit;
private _onOtpVerified;
private _checkProfileData;
private _onProfileApproved;
private _close;
private _continueFromConnections;
private _skipConnections;
private _backToConnections;
private _showProfile;
render(): typeof nothing | lit_html.TemplateResult<1>;
}
/** Exact-attempt account consent. Uses the existing phone components and durable Accounts session. */
declare class ConfigurePluginSetup extends ConfigureBase {
setupRef: string;
returning: boolean;
fixture: boolean;
handoffTicket: string;
/** Another agent's sign-in link: its MCP connect id, read once from the fragment. */
agentConnect: string;
private _agentConnect;
private _isAgent;
private _sourceLogo;
private _phase;
private _name;
private _provider;
private _agent;
private _delivery;
private _phone;
private _code;
private _error;
private _busy;
private _hasProof;
private _token;
private _handoffTicket;
private _consented;
private _closeRefused;
private _unavailable;
private _poll?;
static styles: lit.CSSResult[];
private _workbenchFixture;
connectedCallback(): void;
disconnectedCallback(): void;
private _adoptTried;
private _blips;
private _signedInHere;
private _linkPending;
private _proof;
private _api;
private _start;
private _connectionError;
private _verified;
private _approve;
private _returnStatus;
private _agentProgress;
/** Grey placeholders while the way back opens or waits, never the two marks flashing on their own (Manuel, Oct 19). */
private _skeleton;
private _returnToChat;
private _pairing;
render(): lit_html.TemplateResult<1>;
/** Where the person is coming from and where they are going, on every screen of the way back: the assistant's mark
* (ChatGPT, Claude, or the agent's own), then the partner's (Manuel, Oct 18: "should be the ChatGPT logo and the Newly
* logo", not the partner's beside Configure's). Until the details say which assistant, its circle stays plain. */
private _coPair;
private _relationship;
private _v6Check;
}
export { type AccessRequestDetail, type AuthenticatedDetail, ConfigureAccessRequest, ConfigureAuth, ConfigureAuthModal, ConfigureBase, ConfigureConfirmation, ConfigureConnectionList, ConfigureConnectionRow, ConfigureExportButton, ConfigureExportPrompt, ConfigureHostedAuthFlow, ConfigureMemoryCard, ConfigureMemoryImport, ConfigureOtpInput, ConfigurePersonalizationButton, ConfigurePersonalizationPage, ConfigurePhoneInput, ConfigurePluginSetup, ConfigureProfileEditor, ConfigureRuntimeReading, ConfigureSingleConnector, ConfigureSuccessCard, ConfigureToolApproval, type ConfirmationDetail, type ConnectionData, EXPORT_PROMPT, type ErrorDetail, type ExportClickDetail, type ExportProvider, type HostedShell, type HostedShellOptions, type HostedTerminalOptions, type IdentityUpdateDetail, type ImportCompleteDetail, type ImportErrorDetail, type ImportStartDetail, type MemoryData, type MemoryDeleteDetail, type MemoryEditDetail, type OtpVerifiedDetail, type OtpVerifyDetail, PROVIDER_LABELS, PROVIDER_PREFILLS, PROVIDER_PROMPTS, PROVIDER_URLS, type PersonalizationAssetSelectDetail, type PersonalizationMenuToggleDetail, type PersonalizationOpenDetail, type PersonalizationToggleDetail, type PhoneSubmitDetail, type ProfileApprovedDetail, type PromptCopiedDetail, type ToolApprovalDetail, type ToolApprovalParams, type ToolConnectDetail, type ToolDisconnectDetail, createHostedShell, showGmailDisclosure };