@iblai/iblai-js 1.26.9 → 1.26.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/data-layer/security/index.d.ts +1 -0
  2. package/dist/data-layer/security/next.d.ts +1 -0
  3. package/dist/playwright/security/index.d.ts +1 -0
  4. package/dist/playwright/security/next.d.ts +1 -0
  5. package/dist/security/data-layer/index.d.ts +1 -0
  6. package/dist/security/index.d.ts +1 -0
  7. package/dist/security/index.esm.js +2 -0
  8. package/dist/security/index.esm.js.map +1 -0
  9. package/dist/security/index.js +13 -0
  10. package/dist/security/index.js.map +1 -0
  11. package/dist/security/next.d.ts +1 -0
  12. package/dist/security/next.esm.js +2 -0
  13. package/dist/security/next.esm.js.map +1 -0
  14. package/dist/security/next.js +13 -0
  15. package/dist/security/next.js.map +1 -0
  16. package/dist/security/playwright/audit-log-helpers.d.ts +119 -0
  17. package/dist/security/playwright/auth-flow-builder.d.ts +13 -0
  18. package/dist/security/playwright/auth-helpers.d.ts +10 -0
  19. package/dist/security/playwright/auth-setup.d.ts +34 -0
  20. package/dist/security/playwright/billing-tab-helpers.d.ts +88 -0
  21. package/dist/security/playwright/chat-privacy-helpers.d.ts +127 -0
  22. package/dist/security/playwright/claw-sandbox-helpers.d.ts +266 -0
  23. package/dist/security/playwright/credit-balance-helpers.d.ts +73 -0
  24. package/dist/security/playwright/custom-reporter.d.ts +12 -0
  25. package/dist/security/playwright/env-config.d.ts +24 -0
  26. package/dist/security/playwright/evaluation-tab-helpers.d.ts +396 -0
  27. package/dist/security/playwright/helpers.d.ts +11 -0
  28. package/dist/security/playwright/index.d.ts +39 -0
  29. package/dist/security/playwright/logger.d.ts +3 -0
  30. package/dist/security/playwright/lti-tab-helpers.d.ts +270 -0
  31. package/dist/security/playwright/mail-client.d.ts +46 -0
  32. package/dist/security/playwright/memory-test-helpers.d.ts +66 -0
  33. package/dist/security/playwright/navigation.d.ts +26 -0
  34. package/dist/security/playwright/page-helpers.d.ts +38 -0
  35. package/dist/security/playwright/playwright-config.d.ts +81 -0
  36. package/dist/security/playwright/privacy-tab-helpers.d.ts +95 -0
  37. package/dist/security/playwright/report-download.d.ts +71 -0
  38. package/dist/security/playwright/screenshare-tab-helpers.d.ts +57 -0
  39. package/dist/security/playwright/shared-test-helpers.d.ts +37 -0
  40. package/dist/security/playwright/tasks-tab-helpers.d.ts +177 -0
  41. package/dist/security/playwright/voice-tab-helpers.d.ts +194 -0
  42. package/dist/security/security/index.d.ts +1 -0
  43. package/dist/security/security/next.d.ts +1 -0
  44. package/dist/security/web-containers/index.d.ts +1 -0
  45. package/dist/security/web-containers/next.d.ts +1 -0
  46. package/dist/security/web-containers/sso.d.ts +1 -0
  47. package/dist/security/web-utils/auth.d.ts +1 -0
  48. package/dist/security/web-utils/index.d.ts +1 -0
  49. package/dist/web-containers/security/index.d.ts +1 -0
  50. package/dist/web-containers/security/next.d.ts +1 -0
  51. package/dist/web-utils/security/index.d.ts +1 -0
  52. package/dist/web-utils/security/next.d.ts +1 -0
  53. package/package.json +13 -3
@@ -0,0 +1 @@
1
+ export * from '@iblai/web-utils/security';
@@ -0,0 +1 @@
1
+ export * from '@iblai/web-utils/security/next';
@@ -0,0 +1 @@
1
+ export * from '@iblai/web-utils/security';
@@ -0,0 +1 @@
1
+ export * from '@iblai/web-utils/security/next';
@@ -0,0 +1 @@
1
+ export * from '@iblai/data-layer';
@@ -0,0 +1 @@
1
+ export * from '@iblai/web-utils/security';
@@ -0,0 +1,2 @@
1
+ export * from '@iblai/web-utils/security';
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var security = require('@iblai/web-utils/security');
4
+
5
+
6
+
7
+ Object.keys(security).forEach(function (k) {
8
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
+ enumerable: true,
10
+ get: function () { return security[k]; }
11
+ });
12
+ });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ export * from '@iblai/web-utils/security/next';
@@ -0,0 +1,2 @@
1
+ export * from '@iblai/web-utils/security/next';
2
+ //# sourceMappingURL=next.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var next = require('@iblai/web-utils/security/next');
4
+
5
+
6
+
7
+ Object.keys(next).forEach(function (k) {
8
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
9
+ enumerable: true,
10
+ get: function () { return next[k]; }
11
+ });
12
+ });
13
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,119 @@
1
+ import { Page } from '@playwright/test';
2
+ /**
3
+ * Navigate to the Audit tab within the Analytics section.
4
+ * Assumes the user is already on the analytics page (any tab).
5
+ */
6
+ export declare function navigateToAuditLog(page: Page): Promise<void>;
7
+ /**
8
+ * Verify the audit log table is visible with correct headers.
9
+ */
10
+ export declare function verifyAuditLogTableVisible(page: Page): Promise<void>;
11
+ /**
12
+ * Get the number of rows currently displayed in the audit log table.
13
+ * Returns 0 if no table body rows are found.
14
+ */
15
+ export declare function getAuditLogRowCount(page: Page): Promise<number>;
16
+ /**
17
+ * Verify that audit log entries contain expected data structure
18
+ * (person name in first cell, action description in second, timestamp in third).
19
+ */
20
+ export declare function verifyAuditLogEntryStructure(page: Page): Promise<void>;
21
+ /**
22
+ * Verify the empty state is displayed when there are no audit log entries.
23
+ */
24
+ export declare function verifyAuditLogEmptyState(page: Page): Promise<void>;
25
+ /**
26
+ * Verify the 403 permission error state is displayed.
27
+ */
28
+ export declare function verifyAuditLogPermissionError(page: Page): Promise<void>;
29
+ /**
30
+ * Verify the generic error state is displayed.
31
+ */
32
+ export declare function verifyAuditLogGenericError(page: Page): Promise<void>;
33
+ /**
34
+ * Verify the loading spinner is displayed while audit logs are being fetched.
35
+ */
36
+ export declare function verifyAuditLogLoading(page: Page): Promise<void>;
37
+ /**
38
+ * Wait for the audit log data to finish loading.
39
+ * Waits for either table data, empty state, or error state to appear.
40
+ */
41
+ export declare function waitForAuditLogDataLoaded(page: Page, timeout?: number): Promise<void>;
42
+ /**
43
+ * Filter audit log entries by action type.
44
+ * @param action - One of 'All Actions', 'Create', 'Update', or 'Delete'
45
+ */
46
+ export declare function filterByAction(page: Page, action: 'All Actions' | 'Create' | 'Update' | 'Delete'): Promise<void>;
47
+ /**
48
+ * Filter audit log entries by actor/person using the search combobox.
49
+ * @param actorName - The username to filter by, or empty string to clear the filter
50
+ */
51
+ export declare function filterByActor(page: Page, actorName: string): Promise<void>;
52
+ /**
53
+ * Get the list of actors available in the actor filter dropdown.
54
+ * Opens the dropdown, reads the options, then closes it.
55
+ */
56
+ export declare function getAvailableActors(page: Page): Promise<string[]>;
57
+ /**
58
+ * Open the date range picker and select a date range.
59
+ * @param fromDate - Start date to select
60
+ * @param toDate - End date to select
61
+ */
62
+ export declare function filterByDateRange(page: Page, fromDate: Date, toDate: Date): Promise<void>;
63
+ /**
64
+ * Clear the date range filter by clicking the date picker and resetting.
65
+ */
66
+ export declare function clearDateRangeFilter(page: Page): Promise<void>;
67
+ /**
68
+ * Get the current pagination info text (e.g., "Showing 1 to 20 of 45 results").
69
+ * Returns null if pagination is not visible.
70
+ */
71
+ export declare function getPaginationInfo(page: Page): Promise<string | null>;
72
+ /**
73
+ * Navigate to the next page of audit log results.
74
+ */
75
+ export declare function goToNextPage(page: Page): Promise<void>;
76
+ /**
77
+ * Navigate to the previous page of audit log results.
78
+ */
79
+ export declare function goToPreviousPage(page: Page): Promise<void>;
80
+ /**
81
+ * Navigate to the first page of audit log results.
82
+ */
83
+ export declare function goToFirstPage(page: Page): Promise<void>;
84
+ /**
85
+ * Navigate to the last page of audit log results.
86
+ * Finds the highest numbered page link in the pagination.
87
+ */
88
+ export declare function goToLastPage(page: Page): Promise<void>;
89
+ /**
90
+ * Navigate to a specific page number by clicking its page button.
91
+ */
92
+ export declare function goToPage(page: Page, pageNumber: number): Promise<void>;
93
+ /**
94
+ * Verify the current page is highlighted/active in pagination.
95
+ */
96
+ export declare function verifyCurrentPage(page: Page, expectedPage: number): Promise<void>;
97
+ /**
98
+ * Check if the next page button is disabled (i.e., we're on the last page).
99
+ */
100
+ export declare function isOnLastPage(page: Page): Promise<boolean>;
101
+ /**
102
+ * Check if the previous page button is disabled (i.e., we're on the first page).
103
+ */
104
+ export declare function isOnFirstPage(page: Page): Promise<boolean>;
105
+ /**
106
+ * Full workflow: Navigate to audit log tab, wait for data to load,
107
+ * and verify the table is visible. Use this as a test setup helper.
108
+ */
109
+ export declare function navigateToAuditLogAndWaitForData(page: Page): Promise<void>;
110
+ /**
111
+ * Verify audit log entries are displayed after applying action filter.
112
+ * Returns the row count after filtering.
113
+ */
114
+ export declare function filterByActionAndVerify(page: Page, action: 'All Actions' | 'Create' | 'Update' | 'Delete'): Promise<number>;
115
+ /**
116
+ * Verify audit log entries are displayed after applying actor filter.
117
+ * Returns the row count after filtering.
118
+ */
119
+ export declare function filterByActorAndVerify(page: Page, actorName: string): Promise<number>;
@@ -0,0 +1,13 @@
1
+ import { Page } from '@playwright/test';
2
+ import { StepFn } from './helpers';
3
+ export declare class AuthFlowBuilder {
4
+ flow: string;
5
+ idp: string;
6
+ authHost: string;
7
+ constructor(flow?: string, idp?: string, authHost?: string);
8
+ run(page: Page, step: StepFn, username: string, password: string, hostUrl: string, authUrl: string, postLoginUrlMatcher?: (url: URL) => boolean): Promise<void>;
9
+ usernamePasswordFlow(page: Page, username: string, password: string, hostUrl: string, authUrl: string, postLoginUrlMatcher?: (url: URL) => boolean): Promise<void>;
10
+ magicLinkFlow(page: Page): Promise<void>;
11
+ ssoFlow(page: Page, username: string, password: string, hostUrl: string, authUrl: string): Promise<void>;
12
+ directSsoFlow(page: Page, step: StepFn, username: string, password: string, hostUrl: string, authUrl: string): Promise<void>;
13
+ }
@@ -0,0 +1,10 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ export interface SignUpCredentials {
3
+ email: string;
4
+ password: string;
5
+ }
6
+ export declare function signUpWithEmailAndPassword(page: Page, authHost: string, postSignUpUrl: string, credentials?: SignUpCredentials, alreadyInSignupPage?: boolean): Promise<void>;
7
+ export declare function loginWithEmailAndPassword(page: Page, username: string, password: string, hostUrl: string, postLoginUrlMatcher?: (url: URL) => boolean): Promise<void>;
8
+ export declare function loginWithMicrosoftIdp(page: Page, username: string, password: string): Promise<void>;
9
+ export declare function canChatWithEmbedMentor(page: Page, openChatButton: Locator): Promise<void>;
10
+ export declare function getMentorIdFromUrl(url: string): string | null;
@@ -0,0 +1,34 @@
1
+ export interface AuthSetupConfig {
2
+ /** The app's host URL (e.g., https://mentor.example.com) */
3
+ hostUrl: string;
4
+ /** The auth service host URL (e.g., https://auth.example.com) */
5
+ authHost: string;
6
+ /** App name used in the login redirect URL (e.g., 'mentor', 'skills') */
7
+ appName: string;
8
+ /** Function to match the post-login URL to confirm authentication succeeded */
9
+ postLoginUrlMatcher: (url: URL) => boolean;
10
+ /** Auth flow type. Defaults to reading AUTH_FLOW env var or 'username_password' */
11
+ authFlow?: 'username_password' | 'magic_link' | 'sso' | 'direct_sso';
12
+ /** Auth IDP name for SSO flows */
13
+ authIdp?: string;
14
+ }
15
+ /**
16
+ * Creates a Playwright setup test function for authentication.
17
+ * Use this as the test body in your auth.setup.ts file:
18
+ *
19
+ * ```ts
20
+ * import { test as setup } from '@iblai/iblai-js/playwright';
21
+ * import { createAuthSetup } from '@iblai/iblai-js/playwright';
22
+ *
23
+ * setup('authenticate', createAuthSetup({
24
+ * hostUrl: process.env.MENTOR_NEXTJS_HOST || '',
25
+ * authHost: process.env.AUTH_HOST || '',
26
+ * appName: 'mentor',
27
+ * postLoginUrlMatcher: (url) => url.href.includes('/platform/'),
28
+ * }));
29
+ * ```
30
+ */
31
+ export declare function createAuthSetup(config: AuthSetupConfig): ({ browser, step }: {
32
+ browser: any;
33
+ step: any;
34
+ }, testInfo: any) => Promise<void>;
@@ -0,0 +1,88 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ import type { CreditBalancePlan } from './credit-balance-helpers';
3
+ export type BillingAutoRechargeStatus = 'Enabled' | 'Disabled';
4
+ /** Locator for the Plan section card on the BillingTab. */
5
+ export declare function billingPlanSection(page: Page): Locator;
6
+ /** Locator for the Credits section card on the BillingTab. */
7
+ export declare function billingCreditsSection(page: Page): Locator;
8
+ /** Locator for the Auto Recharge section card on the BillingTab.
9
+ * This section is only rendered for non-Free plans with a payment method on file.
10
+ */
11
+ export declare function billingAutoRechargeSection(page: Page): Locator;
12
+ /** Reads the plan label (Free / Trial / Premium) from the Plan section. */
13
+ export declare function getBillingPlanLabel(page: Page): Promise<CreditBalancePlan | null>;
14
+ /** Reads the auto-recharge status badge (Enabled / Disabled) when the section is rendered. */
15
+ export declare function getBillingAutoRechargeStatus(page: Page): Promise<BillingAutoRechargeStatus | null>;
16
+ /** Waits for the BillingTab loading skeletons to clear by waiting for the Plan
17
+ * section card to mount. */
18
+ export declare function waitForBillingTabReady(page: Page): Promise<void>;
19
+ /**
20
+ * Asserts the Plan section state for a given plan. Verifies:
21
+ * - The plan label text matches `options.plan`
22
+ * - The "Current" pill is visible
23
+ * - The Upgrade button is visible iff the plan is not Premium
24
+ */
25
+ export declare function expectBillingPlanSection(page: Page, options: {
26
+ plan: CreditBalancePlan;
27
+ }): Promise<void>;
28
+ /**
29
+ * Asserts the Credits section state. Always verifies the "Available" stat row.
30
+ * The action button rule mirrors the component:
31
+ * - Free plan → no Add Credits / Manage Billing button
32
+ * - Non-Free + hasPaymentMethod=true → "Add Credits" visible, "Manage Billing" absent
33
+ * - Non-Free + hasPaymentMethod=false → "Manage Billing" visible, "Add Credits" absent
34
+ * - Non-Free with hasPaymentMethod omitted → only the "Available" row is asserted
35
+ */
36
+ export declare function expectBillingCreditsSection(page: Page, options: {
37
+ plan: CreditBalancePlan;
38
+ hasPaymentMethod?: boolean;
39
+ }): Promise<void>;
40
+ /**
41
+ * Asserts the Auto Recharge section visibility. Section is rendered only when
42
+ * `hasPaymentMethod && !isFreePlan` in the component. Pass `expectVisible: false`
43
+ * to assert the section is absent. When visible and `status` is provided, also
44
+ * asserts the Enabled/Disabled badge text.
45
+ */
46
+ export declare function expectBillingAutoRechargeSection(page: Page, options: {
47
+ expectVisible: boolean;
48
+ status?: BillingAutoRechargeStatus;
49
+ }): Promise<void>;
50
+ /**
51
+ * Free plan: Plan="Free" with Upgrade visible; Credits section has no action;
52
+ * Auto Recharge section is hidden entirely (regardless of has_payment_method).
53
+ */
54
+ export declare function expectBillingTabForFreePlan(page: Page): Promise<void>;
55
+ /**
56
+ * Trial plan: Plan="Trial" with Upgrade visible; Credits action depends on
57
+ * `hasPaymentMethod` (Add Credits when true, Manage Billing when false);
58
+ * Auto Recharge section is rendered iff `hasPaymentMethod` is true.
59
+ */
60
+ export declare function expectBillingTabForTrialPlan(page: Page, options: {
61
+ hasPaymentMethod: boolean;
62
+ }): Promise<void>;
63
+ /**
64
+ * Premium plan: Plan="Premium" with Upgrade hidden; Credits action depends on
65
+ * `hasPaymentMethod` (Add Credits when true, Manage Billing when false);
66
+ * Auto Recharge section is rendered iff `hasPaymentMethod` is true.
67
+ */
68
+ export declare function expectBillingTabForPremiumPlan(page: Page, options: {
69
+ hasPaymentMethod: boolean;
70
+ }): Promise<void>;
71
+ /**
72
+ * Convenience: detects the active plan from the Plan section badge and runs
73
+ * the matching state assertions. Returns the detected plan.
74
+ *
75
+ * For non-Free plans, pass `hasPaymentMethod` to assert the Credits/Auto Recharge
76
+ * sub-states; if omitted, only the Plan section + base Credits row is verified.
77
+ */
78
+ export declare function expectBillingTabForCurrentPlan(page: Page, options?: {
79
+ hasPaymentMethod?: boolean;
80
+ }): Promise<CreditBalancePlan>;
81
+ /** Clicks the Upgrade button in the Plan section (visible only on non-Premium plans). */
82
+ export declare function clickBillingUpgrade(page: Page): Promise<void>;
83
+ /** Clicks the Add Credits button in the Credits section (non-Free + has payment method). */
84
+ export declare function clickBillingAddCredits(page: Page): Promise<void>;
85
+ /** Clicks the Manage Billing button in the Credits section (non-Free + no payment method). */
86
+ export declare function clickBillingManageBilling(page: Page): Promise<void>;
87
+ /** Clicks the Manage Usage button in the Auto Recharge section. */
88
+ export declare function clickBillingManageUsage(page: Page): Promise<void>;
@@ -0,0 +1,127 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ /**
3
+ * Chat-privacy Playwright bindings.
4
+ *
5
+ * Three surfaces, three groups of helpers:
6
+ *
7
+ * 1. **Header toggle** — the nav-bar `ChatPrivacyToggle` (`<HatGlasses />`
8
+ * icon-button that morphs into the "Private Mode" pill).
9
+ * 2. **User profile** — the "Private Mode" tab in `UserProfileModal`
10
+ * (three radio-card options: Normal / Anonymized / Disabled).
11
+ * 3. **Tenant admin** — the "Allow users to control chat privacy" row in
12
+ * the Advanced settings tab (`<Switch>`).
13
+ *
14
+ * All selectors target stable hooks — primarily `data-testid` plus the
15
+ * `data-state` / `data-source` / `aria-pressed` attributes the components
16
+ * already expose. Avoid asserting on visible copy directly (it changes);
17
+ * the label maps below are kept for readable assertions on the rare cases
18
+ * where copy IS the thing we want to lock.
19
+ */
20
+ export declare const CHAT_PRIVACY_LABELS: {
21
+ readonly toggle: {
22
+ /** Title of the mid-session confirmation dialog. */
23
+ readonly dialogTitle: "Enable Private Mode for this chat?";
24
+ /** Label on the dialog's confirm button (matches both idle + busy state via regex). */
25
+ readonly dialogConfirm: RegExp;
26
+ };
27
+ readonly profileTab: {
28
+ /** Tab name in the user profile modal sidebar. */
29
+ readonly tabName: "Private Mode";
30
+ /** Section heading inside the tab body. */
31
+ readonly sectionHeading: "Default Private Mode";
32
+ /** Label text on each radio card. Kept in case the test wants to assert
33
+ * copy explicitly — the click + read paths use the testid instead. */
34
+ readonly cards: {
35
+ readonly normal: "Normal";
36
+ readonly anonymized: "Anonymized";
37
+ readonly disabled: "Disabled";
38
+ };
39
+ };
40
+ readonly tenantToggle: {
41
+ /** Visible row label. */
42
+ readonly rowLabel: "Allow users to control chat privacy";
43
+ };
44
+ };
45
+ /** The four `effective.source` values the chat-privacy resolver returns. */
46
+ export type ChatPrivacySource = 'mentor' | 'tenant' | 'user' | 'session' | 'default';
47
+ /** The user-pickable modes on the profile tab. */
48
+ export type ChatPrivacyMode = 'normal' | 'anonymized' | 'disabled';
49
+ /** `data-state` on the header toggle. */
50
+ export type ChatPrivacyToggleState = 'on' | 'off';
51
+ /**
52
+ * Locator for the nav-bar Private-Mode toggle. The toggle is hidden below
53
+ * the `md` breakpoint — assertions in mobile contexts should use
54
+ * `expectChatPrivacyToggleVisible(scope, false)`.
55
+ */
56
+ export declare function getChatPrivacyToggle(scope: Page | Locator): Locator;
57
+ export declare function expectChatPrivacyToggleVisible(scope: Page | Locator, visible: boolean): Promise<void>;
58
+ /**
59
+ * Assert the toggle is on / off via `data-state` (driven by the resolved
60
+ * effective mode + the local optimistic overlay).
61
+ */
62
+ export declare function expectChatPrivacyState(scope: Page | Locator, state: ChatPrivacyToggleState): Promise<void>;
63
+ /**
64
+ * Assert the resolved precedence-source via `data-source` (mentor / tenant
65
+ * / user / session / default). Useful for verifying the chat-privacy-
66
+ * effective endpoint resolved to the expected tier.
67
+ */
68
+ export declare function expectChatPrivacySource(scope: Page | Locator, source: ChatPrivacySource): Promise<void>;
69
+ /**
70
+ * Lock state is signalled via `aria-disabled` (the component uses
71
+ * `aria-disabled` instead of native `disabled` so the source-aware tooltip
72
+ * stays reachable on the locked pill).
73
+ */
74
+ export declare function expectChatPrivacyLocked(scope: Page | Locator, locked: boolean): Promise<void>;
75
+ /**
76
+ * Click the toggle. Covers two scenarios:
77
+ * - Off → on (with no user messages) → starts a fresh private session.
78
+ * - On (user-initiated, no user messages) → starts a fresh normal session.
79
+ * Use `confirmEnableChatPrivacyMidSession` for the mid-conversation flow.
80
+ */
81
+ export declare function clickChatPrivacyToggle(scope: Page | Locator): Promise<void>;
82
+ /** Locator for the AlertDialog content that the mid-session enable opens. */
83
+ export declare function getChatPrivacyConfirmDialog(scope: Page | Locator): Locator;
84
+ export declare function expectChatPrivacyConfirmDialogOpen(scope: Page | Locator, open: boolean): Promise<void>;
85
+ /**
86
+ * Mid-conversation enable flow:
87
+ * 1. Click the toggle (opens the confirm dialog).
88
+ * 2. Click the "Enable Private Mode" action.
89
+ * The session-level disable-chathistory POST is one-way per spec; the
90
+ * helper resolves once the dialog closes after a successful confirm.
91
+ */
92
+ export declare function confirmEnableChatPrivacyMidSession(scope: Page | Locator): Promise<void>;
93
+ /** Cancel the confirm dialog without enabling. */
94
+ export declare function cancelEnableChatPrivacyMidSession(scope: Page | Locator): Promise<void>;
95
+ /**
96
+ * Switch to the Private Mode tab inside the user profile modal. Assumes
97
+ * the modal is already open. The tab only appears when the tenant has
98
+ * `allow_user_chat_privacy_control` on, so a `false` return from
99
+ * `isPrivateModeTabVisible` is a meaningful state, not an error.
100
+ */
101
+ export declare function isPrivateModeTabVisible(page: Page): Promise<boolean>;
102
+ export declare function switchToPrivateModeTab(page: Page): Promise<void>;
103
+ /** Locator for one of the three radio cards. */
104
+ export declare function getPrivateModeCard(scope: Page | Locator, mode: ChatPrivacyMode): Locator;
105
+ /**
106
+ * Pick a mode by clicking its card. Resolves once the card flips into
107
+ * the selected state via `aria-pressed="true"` — i.e. the mutation came
108
+ * back and the local pending state caught up.
109
+ */
110
+ export declare function selectPrivateMode(scope: Page | Locator, mode: ChatPrivacyMode): Promise<void>;
111
+ /** Assert which mode is currently selected. Uses `aria-pressed` + `data-state`. */
112
+ export declare function expectPrivateModeSelected(scope: Page | Locator, mode: ChatPrivacyMode): Promise<void>;
113
+ /** Assert every card is rendered. Useful as a "tab loaded" sanity check. */
114
+ export declare function expectPrivateModeTabReady(scope: Page | Locator): Promise<void>;
115
+ /** Locator for the tenant-wide "Allow users to control chat privacy" switch. */
116
+ export declare function getTenantChatPrivacySwitch(scope: Page | Locator): Locator;
117
+ /** Locator for the surrounding row (useful for scoping label / spinner queries). */
118
+ export declare function getTenantChatPrivacyRow(scope: Page | Locator): Locator;
119
+ export declare function expectTenantChatPrivacyVisible(scope: Page | Locator, visible: boolean): Promise<void>;
120
+ /** Assert the tenant gate's current state via `aria-checked` on the Radix switch. */
121
+ export declare function expectTenantChatPrivacyEnabled(scope: Page | Locator, enabled: boolean): Promise<void>;
122
+ /**
123
+ * Flip the tenant gate to the desired state. Idempotent — does nothing if
124
+ * the switch is already in the target state. Backend rejects this for
125
+ * non-admins (403) and the component surfaces an error toast in that case.
126
+ */
127
+ export declare function setTenantChatPrivacyEnabled(scope: Page | Locator, enabled: boolean): Promise<void>;