@iblai/iblai-js 1.8.5 → 1.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-layer/playwright/claw-sandbox-helpers.d.ts +266 -0
- package/dist/data-layer/playwright/index.d.ts +2 -0
- package/dist/playwright/index.cjs +865 -0
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.ts +267 -2
- package/dist/playwright/index.esm.js +816 -1
- package/dist/playwright/index.esm.js.map +1 -1
- package/dist/playwright/playwright/claw-sandbox-helpers.d.ts +266 -0
- package/dist/playwright/playwright/index.d.ts +2 -0
- package/dist/web-containers/playwright/claw-sandbox-helpers.d.ts +266 -0
- package/dist/web-containers/playwright/index.d.ts +2 -0
- package/dist/web-containers/source/index.esm.js +943 -125
- package/dist/web-containers/source/next/index.esm.js +69 -69
- package/dist/web-utils/playwright/claw-sandbox-helpers.d.ts +266 -0
- package/dist/web-utils/playwright/index.d.ts +2 -0
- package/package.json +6 -5
|
@@ -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 {};
|
|
@@ -16,6 +16,8 @@ export type { EnvConfig, AuthFlowType } from './env-config';
|
|
|
16
16
|
export { buildReportUrl, parseReportUrlParams, navigateToReportDownload, verifyPreparingPhase, verifyDownloadingPhase, verifyDonePhase, verifyErrorPhase, clickBackHome, clickDownloadAgain, clickManualDownloadLink, waitForReportDownload, } from './report-download';
|
|
17
17
|
export type { ReportDownloadOptions } from './report-download';
|
|
18
18
|
export { isMemoryTabVisible, switchToMemoryTab, verifyMemoryTabSettings, verifyMemoryTabMemoriesList, openAddMemoryDialog, toggleMemorySwitch, addMemory, deleteFirstMemory, deleteMemoryByContent, archiveFirstMemory, archiveMemoryByContent, getMemoryCount, verifyMemoryExists, verifyMemoryNotExists, } from './memory-test-helpers';
|
|
19
|
+
export { isSandboxTabVisible, switchToSandboxTab, switchToSkillsTab, verifyInstanceTableVisible, getInstanceRowCount, verifyInstanceTableEmpty, searchInstances, clearInstanceSearch, openInstanceActionsMenu, openNewInstanceDialog, createInstance, cancelNewInstanceDialog, openEditInstanceDialog, editInstance, deleteInstance, cancelDeleteInstance, connectToInstance, disconnectInstance, cancelDisconnectInstance, runInstanceChecks, runConnectedInstanceChecks, getInstanceHealthLabel, getInstanceStatusLabel, verifyConnectDisabledForUnhealthy, verifyConnectedInstanceCard, toggleAutoPush, pushConfiguration, openLLMProviderPicker, selectLLMModel, getCurrentModel, verifyAgentConfigPromptsVisible, openAgentPromptEditModal, editAgentPrompt, verifySkillsTabVisible, verifySkillsEmptyState, getSkillRowCount, verifySkillVisible, isSkillEnabled, enableSkill, disableSkill, toggleSkill, openNewSkillDialog, createSkill, openSkillActionsMenu, openEditSkillDialog, editSkill, deleteSkill, cancelDeleteSkill, setupSandboxInstance, teardownSandboxInstance, } from './claw-sandbox-helpers';
|
|
20
|
+
export type { AgentPromptField, SkillFormValues } from './claw-sandbox-helpers';
|
|
19
21
|
export { navigateToAuditLog, verifyAuditLogTableVisible, getAuditLogRowCount, verifyAuditLogEntryStructure, verifyAuditLogEmptyState, verifyAuditLogPermissionError, verifyAuditLogGenericError, verifyAuditLogLoading, waitForAuditLogDataLoaded, filterByAction, filterByActor, getAvailableActors, filterByDateRange, clearDateRangeFilter, getPaginationInfo, goToNextPage, goToPreviousPage, goToFirstPage, goToLastPage, goToPage, verifyCurrentPage, isOnLastPage, isOnFirstPage, navigateToAuditLogAndWaitForData, filterByActionAndVerify, filterByActorAndVerify, } from './audit-log-helpers';
|
|
20
22
|
export { getCurrentTenantShowPaywall, creditBalanceTrigger, creditBalancePanel, creditBalancePlanBadge, expectCreditBalanceVisibilityForTenant, openCreditBalanceDropdown, waitForCreditBalanceLoaded, closeCreditBalanceDropdown, getCreditBalancePlanLabel, getCreditBalanceRemaining, expectCreditBalancePanelForFreePlan, expectCreditBalancePanelForTrialPlan, expectCreditBalancePanelForPremiumPlan, expectCreditBalanceForCurrentPlan, } from './credit-balance-helpers';
|
|
21
23
|
export type { CreditBalancePlan } from './credit-balance-helpers';
|