@iblai/iblai-js 2.2.6 → 2.2.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/grader-tab-helpers.d.ts +138 -0
- package/dist/data-layer/playwright/index.d.ts +2 -0
- package/dist/playwright/index.cjs +326 -0
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.ts +140 -2
- package/dist/playwright/index.esm.js +313 -1
- package/dist/playwright/index.esm.js.map +1 -1
- package/dist/playwright/playwright/grader-tab-helpers.d.ts +138 -0
- package/dist/playwright/playwright/index.d.ts +2 -0
- package/dist/security/playwright/grader-tab-helpers.d.ts +138 -0
- package/dist/security/playwright/index.d.ts +2 -0
- package/dist/web-containers/playwright/grader-tab-helpers.d.ts +138 -0
- package/dist/web-containers/playwright/index.d.ts +2 -0
- package/dist/web-containers/source/index.esm.js +452 -0
- package/dist/web-containers/source/next/index.esm.js +995 -2
- package/dist/web-utils/playwright/grader-tab-helpers.d.ts +138 -0
- package/dist/web-utils/playwright/index.d.ts +2 -0
- package/package.json +5 -5
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Grader tab helpers — Playwright bindings for the standalone
|
|
4
|
+
* `AgentGraderTab` component from `@iblai/web-containers`.
|
|
5
|
+
*
|
|
6
|
+
* The tab is a peer to Tools/LLM/Memory/etc in the edit-agent modal. Its
|
|
7
|
+
* master toggle attaches/detaches the "Grading" tool on the agent; the gated
|
|
8
|
+
* content splits into two sub-tabs — Grading setup (configuration form) and
|
|
9
|
+
* Rubric (criteria table with modal-based add/edit/delete behind a
|
|
10
|
+
* three-dots row menu).
|
|
11
|
+
*
|
|
12
|
+
* Selector policy (flakiness-proof by construction):
|
|
13
|
+
* - Every query is scoped dialog-first: resolve the edit-agent dialog, then
|
|
14
|
+
* the tab body, then the sub-element — never a bare page-wide match. The
|
|
15
|
+
* criterion/delete modals portal outside that dialog, so they are located
|
|
16
|
+
* by their own testids and all fills happen within the modal locator.
|
|
17
|
+
* - Stable hooks only: `data-testid`, role + accessible name, labels.
|
|
18
|
+
* No CSS class or structural selectors.
|
|
19
|
+
* - No `waitForTimeout` / `networkidle`. Progress is gated on UI state that
|
|
20
|
+
* only exists after the awaited transition: sub-tab section testids, a
|
|
21
|
+
* modal closing after a persisted mutation, a rubric row
|
|
22
|
+
* appearing/disappearing after the list refetch.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GRADER_LABELS: {
|
|
25
|
+
readonly tabName: "Grader";
|
|
26
|
+
readonly capabilityToggle: "Grading";
|
|
27
|
+
readonly subTabs: {
|
|
28
|
+
readonly setup: "Grading setup";
|
|
29
|
+
readonly rubric: "Rubric";
|
|
30
|
+
};
|
|
31
|
+
readonly addButton: "Add criterion";
|
|
32
|
+
readonly menu: {
|
|
33
|
+
/** aria-label template for a row's three-dots trigger. */
|
|
34
|
+
readonly actionsAria: (name: string) => string;
|
|
35
|
+
readonly edit: "Edit";
|
|
36
|
+
readonly delete: "Delete";
|
|
37
|
+
};
|
|
38
|
+
readonly modal: {
|
|
39
|
+
readonly fields: {
|
|
40
|
+
readonly name: "Name";
|
|
41
|
+
readonly criteria: "Criteria";
|
|
42
|
+
readonly points: "Points";
|
|
43
|
+
};
|
|
44
|
+
readonly cancel: "Cancel";
|
|
45
|
+
};
|
|
46
|
+
readonly toasts: {
|
|
47
|
+
readonly toggleOn: "Grading turned on";
|
|
48
|
+
readonly toggleOff: "Grading turned off — your rubric is kept for next time";
|
|
49
|
+
};
|
|
50
|
+
readonly gradingModeOptions: {
|
|
51
|
+
readonly submission: "A submission";
|
|
52
|
+
readonly conversation: "The conversation";
|
|
53
|
+
};
|
|
54
|
+
readonly feedbackModeOptions: {
|
|
55
|
+
readonly overall: "Overall feedback only";
|
|
56
|
+
readonly per_criteria: "Feedback per criterion";
|
|
57
|
+
readonly both: "Overall + per criterion";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type GraderSubTab = keyof typeof GRADER_LABELS.subTabs;
|
|
61
|
+
export type GraderGradingMode = keyof typeof GRADER_LABELS.gradingModeOptions;
|
|
62
|
+
export type GraderFeedbackMode = keyof typeof GRADER_LABELS.feedbackModeOptions;
|
|
63
|
+
export interface GraderCriterionInput {
|
|
64
|
+
name: string;
|
|
65
|
+
criteria: string;
|
|
66
|
+
points: number;
|
|
67
|
+
}
|
|
68
|
+
/** The Grader tab's body, scoped through the edit-agent dialog. */
|
|
69
|
+
export declare function graderTabBody(page: Page): Locator;
|
|
70
|
+
/**
|
|
71
|
+
* Returns false if the Grader tab isn't currently rendered in the
|
|
72
|
+
* edit-agent dialog (host didn't register it, or RBAC hid it).
|
|
73
|
+
*/
|
|
74
|
+
export declare function isGraderTabVisible(page: Page): Promise<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* Switch to the Grader top-level tab. Assumes the edit-agent dialog is
|
|
77
|
+
* open. Completion is gated on the tab body's testid, not on timing.
|
|
78
|
+
*/
|
|
79
|
+
export declare function switchToGraderTab(page: Page): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Switch between the Grader tab's two sub-tabs. Completion is gated on the
|
|
82
|
+
* target section's testid rendering.
|
|
83
|
+
*/
|
|
84
|
+
export declare function switchToGraderSubTab(page: Page, subTab: GraderSubTab): Promise<void>;
|
|
85
|
+
/** Read the current on/off state of the Grading capability toggle. */
|
|
86
|
+
export declare function isGradingEnabled(page: Page): Promise<boolean>;
|
|
87
|
+
/**
|
|
88
|
+
* Idempotently set the Grading capability toggle. Waits for the success
|
|
89
|
+
* toast (which only fires after the settings PATCH resolves — the switch
|
|
90
|
+
* itself flips optimistically and would roll back on failure) and then for
|
|
91
|
+
* the gated content to reflect the new state.
|
|
92
|
+
*/
|
|
93
|
+
export declare function setGradingEnabled(page: Page, enabled: boolean): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Fill and persist the Grading setup form (switches to the setup sub-tab
|
|
96
|
+
* first). Only the provided fields are changed. Completion is gated on the
|
|
97
|
+
* Save button returning to disabled: after the config POST/PATCH resolves,
|
|
98
|
+
* the form rehydrates from the server copy and stops being dirty.
|
|
99
|
+
*/
|
|
100
|
+
export declare function saveGraderConfig(page: Page, values: {
|
|
101
|
+
instructions?: string;
|
|
102
|
+
gradingMode?: GraderGradingMode;
|
|
103
|
+
feedbackMode?: GraderFeedbackMode;
|
|
104
|
+
}): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Add a rubric criterion through the Add-criterion modal (switches to the
|
|
107
|
+
* Rubric sub-tab first). Requires a saved grader configuration — the Add
|
|
108
|
+
* button is disabled until one exists. Completion is gated on the modal
|
|
109
|
+
* closing and the new row rendering after the list refetch.
|
|
110
|
+
*/
|
|
111
|
+
export declare function addGraderCriterion(page: Page, criterion: GraderCriterionInput): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Edit an existing rubric criterion via its row's three-dots menu → Edit
|
|
114
|
+
* modal. The row is located by its current name; all three fields are
|
|
115
|
+
* rewritten. Completion is gated on the modal closing and the updated row
|
|
116
|
+
* rendering.
|
|
117
|
+
*/
|
|
118
|
+
export declare function editGraderCriterion(page: Page, currentName: string, updates: GraderCriterionInput): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Delete a rubric criterion via its row's three-dots menu → confirmation
|
|
121
|
+
* modal. Completion is gated on the modal closing and the row disappearing
|
|
122
|
+
* after the server delete + list refetch.
|
|
123
|
+
*/
|
|
124
|
+
export declare function deleteGraderCriterion(page: Page, name: string): Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Assert the last remaining criterion's Delete menu action is disabled and
|
|
127
|
+
* the explanatory hint is shown — the backend refuses to delete the final
|
|
128
|
+
* row, so the UI must block it too. Closes the menu again before returning.
|
|
129
|
+
*/
|
|
130
|
+
export declare function expectLastCriterionDeleteDisabled(page: Page, name: string): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Assert whether the amber misconfiguration banner is shown (grading on
|
|
133
|
+
* with no config yet, or with an empty rubric). The banner sits above the
|
|
134
|
+
* sub-tabs, so no sub-tab switch is needed.
|
|
135
|
+
*/
|
|
136
|
+
export declare function expectGraderMisconfiguredWarning(page: Page, visible: boolean): Promise<void>;
|
|
137
|
+
/** Assert the rubric's live "total possible points" readout (Rubric sub-tab). */
|
|
138
|
+
export declare function expectGraderTotalPoints(page: Page, total: number): Promise<void>;
|
|
@@ -29,6 +29,8 @@ export { VOICE_LABELS, isVoiceTabVisible, switchToVoiceTab, switchToVoiceSubTab,
|
|
|
29
29
|
export type { VoiceProvider, CallMode, TtsProvider, SttProvider, LlmProvider, } from './voice-tab-helpers';
|
|
30
30
|
export { SCREENSHARE_LABELS, isScreenShareTabVisible, switchToScreenShareTab, openScreenSharePromptEditor, setScreenSharePrompt, saveScreenSharePrompts, expectScreenShareDisabledHint, } from './screenshare-tab-helpers';
|
|
31
31
|
export type { ScreenSharePromptField } from './screenshare-tab-helpers';
|
|
32
|
+
export { graderTabBody, isGraderTabVisible, switchToGraderTab, switchToGraderSubTab, isGradingEnabled, setGradingEnabled, saveGraderConfig, addGraderCriterion, editGraderCriterion, deleteGraderCriterion, expectLastCriterionDeleteDisabled, expectGraderMisconfiguredWarning, expectGraderTotalPoints, GRADER_LABELS, } from './grader-tab-helpers';
|
|
33
|
+
export type { GraderCriterionInput, GraderGradingMode, GraderFeedbackMode, GraderSubTab, } from './grader-tab-helpers';
|
|
32
34
|
export { billingPlanSection, billingCreditsSection, billingAutoRechargeSection, getBillingPlanLabel, getBillingAutoRechargeStatus, waitForBillingTabReady, expectBillingPlanSection, expectBillingCreditsSection, expectBillingAutoRechargeSection, expectBillingTabForFreePlan, expectBillingTabForTrialPlan, expectBillingTabForPremiumPlan, expectBillingTabForCurrentPlan, clickBillingUpgrade, clickBillingAddCredits, clickBillingManageBilling, clickBillingManageUsage, } from './billing-tab-helpers';
|
|
33
35
|
export type { BillingAutoRechargeStatus } from './billing-tab-helpers';
|
|
34
36
|
export { TASKS_LABELS, isTasksTabVisible, switchToTasksTab, getScheduleTaskButton, getSearchInput, getTaskRow, expectTotalTasks, expectCompletedTasks, expectFailedTasks, expectTasksEmpty, expectTaskInList, expectTaskNotInList, selectTaskInList, expectTaskStatus, searchTasks, openScheduleTaskDialog, scheduleTask, expectScheduleStartTimeInPastError, deleteTask, expectLogsForTask, expectNoLogsForSelectedTask, openFirstLogDetails, expectLogDetailsStatus, } from './tasks-tab-helpers';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iblai/iblai-js",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
"axios": "1.13.6",
|
|
77
77
|
"dotenv": "16.6.1",
|
|
78
78
|
"winston": "3.19.0",
|
|
79
|
-
"@iblai/data-layer": "1.11.
|
|
80
|
-
"@iblai/
|
|
81
|
-
"@iblai/web-
|
|
82
|
-
"@iblai/
|
|
79
|
+
"@iblai/data-layer": "1.11.2",
|
|
80
|
+
"@iblai/mcp": "1.8.5",
|
|
81
|
+
"@iblai/web-containers": "1.15.9",
|
|
82
|
+
"@iblai/web-utils": "2.1.7"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@radix-ui/react-dialog": "^1.1.7",
|