@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,266 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ /**
3
+ * Check if the Sandbox tab is visible in the edit-mentor modal.
4
+ * Returns true if the tab exists and is visible (i.e. mentor has is_claw_enabled === true).
5
+ */
6
+ export declare function isSandboxTabVisible(page: Page): Promise<boolean>;
7
+ /**
8
+ * Switch to the Sandbox tab inside the edit-mentor modal.
9
+ * Assumes the modal is already open and the user has permission to see the tab.
10
+ */
11
+ export declare function switchToSandboxTab(page: Page): Promise<void>;
12
+ /**
13
+ * Switch to the Skills tab inside the edit-mentor modal.
14
+ */
15
+ export declare function switchToSkillsTab(page: Page): Promise<void>;
16
+ /**
17
+ * Verify the instance table is visible with all expected column headers.
18
+ * Should be called when the mentor has no connected sandbox instance.
19
+ */
20
+ export declare function verifyInstanceTableVisible(page: Page): Promise<void>;
21
+ /**
22
+ * Get the number of rows currently displayed in the instance table (excluding empty-state rows).
23
+ */
24
+ export declare function getInstanceRowCount(page: Page): Promise<number>;
25
+ /**
26
+ * Verify the empty state is shown when there are no instances.
27
+ */
28
+ export declare function verifyInstanceTableEmpty(page: Page): Promise<void>;
29
+ /**
30
+ * Filter the instance table by search query (name or URL).
31
+ */
32
+ export declare function searchInstances(page: Page, query: string): Promise<void>;
33
+ /**
34
+ * Clear the instance table search query.
35
+ */
36
+ export declare function clearInstanceSearch(page: Page): Promise<void>;
37
+ /**
38
+ * Open the Actions dropdown menu for a specific instance row.
39
+ * Returns the dropdown menu locator.
40
+ */
41
+ export declare function openInstanceActionsMenu(page: Page, instanceName: string): Promise<Locator>;
42
+ /**
43
+ * Open the "New Instance" dialog by clicking the Add Instance button.
44
+ * Returns the dialog locator.
45
+ */
46
+ export declare function openNewInstanceDialog(page: Page): Promise<Locator>;
47
+ /**
48
+ * Fill the New Instance form and submit it.
49
+ * @param name - Display name for the instance
50
+ * @param serverUrl - Fully qualified https URL
51
+ * @param clawType - 'openclaw' (default) or 'ironclaw'
52
+ * @param gatewayToken - Optional auth token
53
+ */
54
+ export declare function createInstance(page: Page, { name, serverUrl, clawType, gatewayToken, }: {
55
+ name: string;
56
+ serverUrl: string;
57
+ clawType?: 'openclaw' | 'ironclaw';
58
+ gatewayToken?: string;
59
+ }): Promise<void>;
60
+ /**
61
+ * Cancel the New Instance dialog without submitting.
62
+ */
63
+ export declare function cancelNewInstanceDialog(page: Page): Promise<void>;
64
+ /**
65
+ * Open the Edit dialog for an instance from its Actions menu.
66
+ * Returns the edit dialog locator.
67
+ */
68
+ export declare function openEditInstanceDialog(page: Page, instanceName: string): Promise<Locator>;
69
+ /**
70
+ * Edit an existing instance with new values.
71
+ * @param instanceName - The current name of the instance to edit
72
+ * @param updates - Fields to update
73
+ */
74
+ export declare function editInstance(page: Page, instanceName: string, updates: {
75
+ name?: string;
76
+ serverUrl?: string;
77
+ clawType?: 'openclaw' | 'ironclaw';
78
+ }): Promise<void>;
79
+ /**
80
+ * Delete an instance via the Actions menu, confirming the deletion dialog.
81
+ */
82
+ export declare function deleteInstance(page: Page, instanceName: string): Promise<void>;
83
+ /**
84
+ * Open the delete confirmation dialog and cancel it without deleting.
85
+ */
86
+ export declare function cancelDeleteInstance(page: Page, instanceName: string): Promise<void>;
87
+ /**
88
+ * Connect the current mentor to an instance via the Actions menu.
89
+ */
90
+ export declare function connectToInstance(page: Page, instanceName: string): Promise<void>;
91
+ /**
92
+ * Disconnect the current mentor from its connected instance,
93
+ * confirming the disconnect dialog.
94
+ */
95
+ export declare function disconnectInstance(page: Page): Promise<void>;
96
+ /**
97
+ * Open the disconnect confirmation dialog and cancel it.
98
+ */
99
+ export declare function cancelDisconnectInstance(page: Page): Promise<void>;
100
+ /**
101
+ * Open an instance's actions menu and click "Run checks". Resolves once the
102
+ * health-check + connectivity-test toasts have surfaced (success or error).
103
+ */
104
+ export declare function runInstanceChecks(page: Page, instanceName: string): Promise<void>;
105
+ /**
106
+ * Trigger the "Run checks" button on the connected-instance card. Used for the
107
+ * connected-state flow rather than the table dropdown.
108
+ */
109
+ export declare function runConnectedInstanceChecks(page: Page): Promise<void>;
110
+ /**
111
+ * Read the canonical health label rendered by `StatusDot` for the given row.
112
+ * Returns "Healthy" / "Unhealthy" / null (em-dash for unknown).
113
+ */
114
+ export declare function getInstanceHealthLabel(page: Page, instanceName: string): Promise<'Healthy' | 'Unhealthy' | null>;
115
+ /**
116
+ * Read the canonical status label rendered by `StatusDot` for the given row.
117
+ * Returns "Active" / "Error" / null (em-dash for unknown).
118
+ */
119
+ export declare function getInstanceStatusLabel(page: Page, instanceName: string): Promise<'Active' | 'Error' | null>;
120
+ /**
121
+ * Verify that the Connect dropdown item is blocked (dimmed + cursor-not-allowed)
122
+ * because the instance status is unhealthy. Hovering should reveal the unhealthy
123
+ * tooltip explaining why.
124
+ */
125
+ export declare function verifyConnectDisabledForUnhealthy(page: Page, instanceName: string): Promise<void>;
126
+ /**
127
+ * Verify the Connected Instance card shows the expected fields.
128
+ * The URL field shows the full server_url; other fields are status/health/last-check.
129
+ */
130
+ export declare function verifyConnectedInstanceCard(page: Page): Promise<void>;
131
+ /**
132
+ * Toggle the Auto Push on Save switch.
133
+ * Returns the new checked state.
134
+ */
135
+ export declare function toggleAutoPush(page: Page): Promise<boolean>;
136
+ /**
137
+ * Click the Push button to push the current configuration to the worker.
138
+ */
139
+ export declare function pushConfiguration(page: Page): Promise<void>;
140
+ /**
141
+ * Open the LLM provider picker by clicking Change (or Select Model) in the Model row.
142
+ * Returns the picker dialog locator.
143
+ */
144
+ export declare function openLLMProviderPicker(page: Page): Promise<Locator>;
145
+ /**
146
+ * Pick an LLM provider + model combination via the provider picker flow.
147
+ * @param providerName - The provider key (e.g. 'anthropic', 'openai')
148
+ * @param modelName - The model name (e.g. 'claude-sonnet-4-5-20250929')
149
+ */
150
+ export declare function selectLLMModel(page: Page, providerName: string, modelName: string): Promise<void>;
151
+ /**
152
+ * Get the currently-selected model identifier shown next to the Model row.
153
+ * Returns null if no model is set (button reads "Select Model").
154
+ */
155
+ export declare function getCurrentModel(page: Page): Promise<string | null>;
156
+ declare const AGENT_PROMPT_LABELS: readonly ["Identity", "Soul", "User Context", "Tools", "Agents", "Bootstrap", "Heartbeat", "Memory"];
157
+ export type AgentPromptField = (typeof AGENT_PROMPT_LABELS)[number];
158
+ /**
159
+ * Verify that all 8 agent config prompt fields are visible in the Prompts tab.
160
+ * Only renders when the mentor has enable_claw === true on its settings.
161
+ *
162
+ * Note: PATCH on the agent-config endpoint is upsert — there's no separate
163
+ * "Create Agent Config" button anymore. The first edit on any field bootstraps
164
+ * the row.
165
+ */
166
+ export declare function verifyAgentConfigPromptsVisible(page: Page): Promise<void>;
167
+ /**
168
+ * Open the edit modal for a specific agent prompt field (e.g. Identity, Soul).
169
+ */
170
+ export declare function openAgentPromptEditModal(page: Page, field: AgentPromptField): Promise<Locator>;
171
+ /**
172
+ * Edit an agent prompt field (opens the modal, types content, saves).
173
+ */
174
+ export declare function editAgentPrompt(page: Page, field: AgentPromptField, content: string): Promise<void>;
175
+ /**
176
+ * Verify the Skills tab content is loaded (either showing skill rows or the empty state).
177
+ */
178
+ export declare function verifySkillsTabVisible(page: Page): Promise<void>;
179
+ /**
180
+ * Verify that the "No skills available" empty state is shown.
181
+ */
182
+ export declare function verifySkillsEmptyState(page: Page): Promise<void>;
183
+ /**
184
+ * Count the number of skill rows rendered in the Skills tab.
185
+ * Each row represents an available (enabled) platform skill.
186
+ */
187
+ export declare function getSkillRowCount(page: Page): Promise<number>;
188
+ /**
189
+ * Verify that a specific skill row is visible in the Skills tab.
190
+ */
191
+ export declare function verifySkillVisible(page: Page, skillName: string): Promise<void>;
192
+ /**
193
+ * Check if a specific skill is currently enabled for the mentor.
194
+ */
195
+ export declare function isSkillEnabled(page: Page, skillName: string): Promise<boolean>;
196
+ /**
197
+ * Enable a skill for the current mentor by toggling it on.
198
+ * No-op if already enabled. Waits for the success toast.
199
+ */
200
+ export declare function enableSkill(page: Page, skillName: string): Promise<void>;
201
+ /**
202
+ * Disable a skill for the current mentor by toggling it off.
203
+ * No-op if already disabled. Waits for the success toast.
204
+ */
205
+ export declare function disableSkill(page: Page, skillName: string): Promise<void>;
206
+ /**
207
+ * Toggle a skill's enabled state (flips whatever the current state is).
208
+ * Returns the new checked state.
209
+ */
210
+ export declare function toggleSkill(page: Page, skillName: string): Promise<boolean>;
211
+ export interface SkillFormValues {
212
+ name: string;
213
+ slug: string;
214
+ description?: string;
215
+ version?: string;
216
+ instruction?: string;
217
+ }
218
+ /**
219
+ * Open the "New Skill" dialog by clicking the New Skill button in the Skills tab.
220
+ * Returns the dialog locator.
221
+ */
222
+ export declare function openNewSkillDialog(page: Page): Promise<Locator>;
223
+ /**
224
+ * Create a new platform-level skill via the Skills tab.
225
+ */
226
+ export declare function createSkill(page: Page, values: SkillFormValues): Promise<void>;
227
+ /**
228
+ * Open the Actions dropdown for a specific skill row.
229
+ * Returns the dropdown menu locator.
230
+ */
231
+ export declare function openSkillActionsMenu(page: Page, skillName: string): Promise<Locator>;
232
+ /**
233
+ * Open the Edit Skill dialog from the actions menu.
234
+ * Returns the dialog locator.
235
+ */
236
+ export declare function openEditSkillDialog(page: Page, skillName: string): Promise<Locator>;
237
+ /**
238
+ * Edit an existing platform-level skill.
239
+ * @param skillName - The current name of the skill to edit
240
+ * @param updates - Fields to update on the skill
241
+ */
242
+ export declare function editSkill(page: Page, skillName: string, updates: Partial<SkillFormValues>): Promise<void>;
243
+ /**
244
+ * Delete a platform-level skill, confirming the deletion dialog.
245
+ */
246
+ export declare function deleteSkill(page: Page, skillName: string): Promise<void>;
247
+ /**
248
+ * Open the delete confirmation for a skill and cancel it (no deletion).
249
+ */
250
+ export declare function cancelDeleteSkill(page: Page, skillName: string): Promise<void>;
251
+ /**
252
+ * Full workflow: open Sandbox tab, create a new instance, connect the mentor to it.
253
+ * Returns when the mentor is successfully connected.
254
+ */
255
+ export declare function setupSandboxInstance(page: Page, instance: {
256
+ name: string;
257
+ serverUrl: string;
258
+ clawType?: 'openclaw' | 'ironclaw';
259
+ gatewayToken?: string;
260
+ }): Promise<void>;
261
+ /**
262
+ * Full workflow: open Sandbox tab, disconnect the current instance (if any),
263
+ * then delete it from the table.
264
+ */
265
+ export declare function teardownSandboxInstance(page: Page, instanceName: string): Promise<void>;
266
+ export {};
@@ -0,0 +1,73 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ export type CreditBalancePlan = 'Free' | 'Trial' | 'Premium';
3
+ /**
4
+ * Reads `current_tenant` from localStorage and returns its `show_paywall` flag.
5
+ * Returns false if the entry is missing, malformed, or the flag is unset.
6
+ */
7
+ export declare function getCurrentTenantShowPaywall(page: Page): Promise<boolean>;
8
+ /** Locator for the credit-balance trigger button (icon in the nav). */
9
+ export declare function creditBalanceTrigger(page: Page): Locator;
10
+ /** Locator for the credit-balance dropdown panel (rendered in a Radix portal). */
11
+ export declare function creditBalancePanel(page: Page): Locator;
12
+ /** Locator for the plan badge (Free / Trial / Premium) inside the open panel. */
13
+ export declare function creditBalancePlanBadge(page: Page): Locator;
14
+ /**
15
+ * Asserts the credit-balance trigger is visible iff the current tenant has
16
+ * `show_paywall=true`. Returns the resolved expectation so callers can branch.
17
+ */
18
+ export declare function expectCreditBalanceVisibilityForTenant(page: Page): Promise<{
19
+ shouldBeVisible: boolean;
20
+ }>;
21
+ /**
22
+ * Opens the credit-balance dropdown if not already open, waits for the panel
23
+ * to be visible, and waits for the initial "Loading credits..." placeholder to
24
+ * clear so callers can immediately read content. Idempotent — safe to call
25
+ * when the panel is already up.
26
+ */
27
+ export declare function openCreditBalanceDropdown(page: Page): Promise<Locator>;
28
+ /**
29
+ * Waits for the "Loading credits..." placeholder to disappear from the open
30
+ * panel. Resolves in the success path (real content rendered) or the error
31
+ * path ("Unable to load credit balance." rendered) — both replace the loading
32
+ * row. Returns immediately if the placeholder was never present.
33
+ */
34
+ export declare function waitForCreditBalanceLoaded(page: Page): Promise<void>;
35
+ /** Closes the credit-balance dropdown via Escape and waits for it to detach. */
36
+ export declare function closeCreditBalanceDropdown(page: Page): Promise<void>;
37
+ /**
38
+ * Reads the plan label text from the open panel. Returns null if the badge is
39
+ * not rendered (e.g. billing data still loading or errored).
40
+ */
41
+ export declare function getCreditBalancePlanLabel(page: Page): Promise<CreditBalancePlan | null>;
42
+ /**
43
+ * Reads the "Remaining" credits value from the open panel ("X,XXX Credits").
44
+ * Returns null when the row is not rendered or unparseable.
45
+ */
46
+ export declare function getCreditBalanceRemaining(page: Page): Promise<number | null>;
47
+ /**
48
+ * Free plan UI: Upgrade Plan only. No payment buttons. No auto-recharge section.
49
+ */
50
+ export declare function expectCreditBalancePanelForFreePlan(page: Page): Promise<void>;
51
+ /**
52
+ * Trial plan UI: Upgrade Plan only. No Manage Usage / Add Credits / Manage Billing.
53
+ */
54
+ export declare function expectCreditBalancePanelForTrialPlan(page: Page): Promise<void>;
55
+ /**
56
+ * Premium plan UI: Upgrade Plan must NOT appear.
57
+ * - With payment method: Manage Usage + Add Credits both visible; Manage Billing hidden.
58
+ * - Without payment method: Manage Billing visible; Manage Usage + Add Credits hidden.
59
+ */
60
+ export declare function expectCreditBalancePanelForPremiumPlan(page: Page, options: {
61
+ hasPaymentMethod: boolean;
62
+ }): Promise<void>;
63
+ /**
64
+ * Convenience: opens the dropdown, detects the active plan from the badge,
65
+ * and runs the matching state assertions on the already-open panel. Returns
66
+ * the detected plan label.
67
+ *
68
+ * For Premium plans you may pass `hasPaymentMethod` to assert the specific
69
+ * sub-state; if omitted on Premium, only the "no Upgrade Plan button" check runs.
70
+ */
71
+ export declare function expectCreditBalanceForCurrentPlan(page: Page, options?: {
72
+ hasPaymentMethod?: boolean;
73
+ }): Promise<CreditBalancePlan>;
@@ -0,0 +1,12 @@
1
+ import { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult } from '@playwright/test/reporter';
2
+ export default class CustomReporter implements Reporter {
3
+ onBegin(config: FullConfig, suite: Suite): void;
4
+ onTestBegin(test: TestCase): void;
5
+ onTestEnd(test: TestCase, result: TestResult): void;
6
+ onTimeout(timeout: number): void;
7
+ onEnd(result: FullResult): Promise<{
8
+ status?: FullResult['status'];
9
+ } | undefined | void> | void;
10
+ onStdOut(chunk: string | Buffer, test: void | TestCase, result: void | TestResult): void;
11
+ onStdErr(chunk: string | Buffer, test: void | TestCase, result: void | TestResult): void;
12
+ }
@@ -0,0 +1,24 @@
1
+ export type AuthFlowType = 'username_password' | 'magic_link' | 'sso' | 'direct_sso';
2
+ export interface EnvConfig {
3
+ skillHost: string;
4
+ authHost: string;
5
+ analyticsHost: string;
6
+ mentorHost: string;
7
+ mentorNextjsHost: string;
8
+ authNextjsHost: string;
9
+ playwrightUsername: string;
10
+ playwrightPassword: string;
11
+ inviteUsername: string;
12
+ inviteUserPassword: string;
13
+ authFlow: AuthFlowType;
14
+ authIdp: string;
15
+ enableStripeTest: boolean;
16
+ iblMentorDisabledTabs: string;
17
+ embedUrl: string;
18
+ wcagRange: string;
19
+ }
20
+ /**
21
+ * Create an environment configuration object from process.env with optional overrides.
22
+ * Each app can call this with their specific defaults.
23
+ */
24
+ export declare function createEnvConfig(overrides?: Partial<EnvConfig>): EnvConfig;