@xbrowser/cli 1.0.0 → 1.0.3
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/README.md +17 -26
- package/dist/{browser-DSVV4GHS.js → browser-5CTOA2WS.js} +4 -3
- package/dist/{browser-53KUFEEM.js → browser-ITLZZDHJ.js} +5 -5
- package/dist/{browser-GURRY444.js → browser-IUJXXNBT.js} +6 -3
- package/dist/{cdp-driver-MNPR3HZH.js → cdp-driver-4X3DK6PS.js} +339 -59
- package/dist/{cdp-driver-SSXUGXP6.js → cdp-driver-D6WMSMWX.js} +4 -3
- package/dist/chunk-2SVQTI2O.js +2794 -0
- package/dist/{chunk-IDVD44ED.js → chunk-6WOSXSCQ.js} +23 -7
- package/dist/{chunk-ZZ2TFWIV.js → chunk-ABXMBNQ6.js} +1 -1
- package/dist/{chunk-2MFXKN32.js → chunk-ACFE6PKF.js} +1013 -119
- package/dist/chunk-AMI64BSD.js +268 -0
- package/dist/{chunk-E4O5ZU3H.js → chunk-DKWR54XQ.js} +412 -98
- package/dist/{chunk-DTJRVA76.js → chunk-ETCO4SNK.js} +2 -2
- package/dist/chunk-GDKLH7ZY.js +8 -0
- package/dist/chunk-KFQGP6VL.js +33 -0
- package/dist/{chunk-2BQZIT3S.js → chunk-LRBSUKUZ.js} +85 -2497
- package/dist/{chunk-ITKPSIP7.js → chunk-MDAPTB7C.js} +6 -25
- package/dist/{chunk-42RPMJ76.js → chunk-N2JFPWMI.js} +342 -60
- package/dist/chunk-OZKD3W4X.js +417 -0
- package/dist/{chunk-T4J4C2NZ.js → chunk-TNEN6VQ2.js} +17 -4
- package/dist/{chunk-YKOHDEFV.js → chunk-TWWOIJM7.js} +74 -38
- package/dist/chunk-WJRE55TN.js +83 -0
- package/dist/cli.js +1558 -1122
- package/dist/{convert-EGFYNICZ.js → convert-LB3GJTLR.js} +3 -3
- package/dist/{convert-EKQVHKB4.js → convert-R3XXYKC6.js} +2 -2
- package/dist/{daemon-client-YAVQ343A.js → daemon-client-3JOKX2L2.js} +3 -2
- package/dist/{daemon-client-3VM7VU7O.js → daemon-client-DIEHGP5B.js} +28 -74
- package/dist/daemon-main.js +2296 -1722
- package/dist/{extract-JUOQQX4V.js → extract-2ZFW2MX7.js} +1 -1
- package/dist/{extract-L2IW3IUB.js → extract-BSYBM4MR.js} +1 -1
- package/dist/{filter-HC4RA7JY.js → filter-KCFO4RSV.js} +1 -1
- package/dist/{filter-VID2GGZ7.js → filter-T7DSZ2X7.js} +1 -1
- package/dist/{human-interaction-W753RVJB.js → human-interaction-UKAS5ZXV.js} +2 -2
- package/dist/index.d.ts +166 -109
- package/dist/index.js +2668 -1742
- package/dist/launcher-L2JNDB2H.js +20 -0
- package/dist/{launcher-KA7J32K5.js → launcher-OZXJQPNG.js} +1 -1
- package/dist/{network-store-66A2RATI.js → network-store-XGZ25FFC.js} +1 -1
- package/dist/{network-store-BN6QEZ7R.js → network-store-YVDNUREI.js} +1 -1
- package/dist/{parse-action-dsl-T3DYC33D.js → parse-action-dsl-UM333TL2.js} +1 -1
- package/dist/{proxy-WKGUCH2C.js → proxy-C6CK3UH5.js} +2 -2
- package/dist/session-recorder-RTDGURIJ.js +8 -0
- package/dist/session-recorder-YI7YYM36.js +7 -0
- package/dist/session-replayer-MY27H4DX.js +276 -0
- package/dist/site-knowledge-SYC6VCDB.js +23 -0
- package/package.json +5 -4
- package/dist/screenshot-CWAWMXVA.js +0 -28
- package/dist/session-recorder-MA75PKTQ.js +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Tip, CommandContext, CommandScope, XCLIAPI, Core, PluginInstance, PluginStatus } from '@dyyz1993/xcli-core';
|
|
2
|
+
export { PluginStatus, parseCommandArgs, readCommandFile, readStdin, registerCommandDefinition, splitCommand } from '@dyyz1993/xcli-core';
|
|
1
3
|
import { EventEmitter } from 'events';
|
|
2
4
|
import { Server } from 'http';
|
|
3
|
-
import { CommandContext, CommandScope, XCLIAPI, Core, PluginInstance, PluginStatus } from '@dyyz1993/xcli-core';
|
|
4
|
-
export { PluginStatus } from '@dyyz1993/xcli-core';
|
|
5
5
|
import { ZodType, ZodTypeDef, z } from 'zod';
|
|
6
6
|
|
|
7
7
|
declare const version: any;
|
|
@@ -19,6 +19,14 @@ interface XBBrowser {
|
|
|
19
19
|
close(): Promise<void>;
|
|
20
20
|
newContext(opts?: XBContextOptions): Promise<XBContext>;
|
|
21
21
|
contexts(): XBContext[];
|
|
22
|
+
/**
|
|
23
|
+
* Discover existing browser contexts and pages from the CDP browser.
|
|
24
|
+
* Required when connecting via CDP tunnel (cdp-tunnel) where
|
|
25
|
+
* auto-attach events are unreliable. After this call, `contexts()`
|
|
26
|
+
* returns the user's actual browser contexts (with their existing
|
|
27
|
+
* cookies and login state) instead of an empty list.
|
|
28
|
+
*/
|
|
29
|
+
discoverContexts(): Promise<void>;
|
|
22
30
|
on(event: string, handler: Function): void;
|
|
23
31
|
off(event: string, handler: Function): void;
|
|
24
32
|
}
|
|
@@ -173,6 +181,10 @@ interface XBPage {
|
|
|
173
181
|
dragAndDrop(source: string, target: string): Promise<void>;
|
|
174
182
|
on(event: string, handler: Function): void;
|
|
175
183
|
off(event: string, handler: Function): void;
|
|
184
|
+
waitForEvent(event: string, opts?: {
|
|
185
|
+
timeout?: number;
|
|
186
|
+
predicate?: (...args: unknown[]) => boolean;
|
|
187
|
+
}): Promise<unknown>;
|
|
176
188
|
_cdpSend<T = unknown>(method: string, params?: Record<string, unknown>): Promise<T>;
|
|
177
189
|
_subscribe(event: string, handler: (params: unknown) => void): () => void;
|
|
178
190
|
close(): Promise<void>;
|
|
@@ -455,6 +467,9 @@ type WSMessage = {
|
|
|
455
467
|
success: boolean;
|
|
456
468
|
fileName: string;
|
|
457
469
|
error?: string;
|
|
470
|
+
} | {
|
|
471
|
+
type: 'file_input_clicked';
|
|
472
|
+
selector: string;
|
|
458
473
|
} | {
|
|
459
474
|
type: 'file_list_result';
|
|
460
475
|
path: string;
|
|
@@ -471,6 +486,9 @@ type WSMessage = {
|
|
|
471
486
|
mimeType: string;
|
|
472
487
|
data: string;
|
|
473
488
|
error?: string;
|
|
489
|
+
} | {
|
|
490
|
+
type: 'views_update';
|
|
491
|
+
views: ViewInfo[];
|
|
474
492
|
} | {
|
|
475
493
|
type: 'error';
|
|
476
494
|
data: {
|
|
@@ -479,6 +497,16 @@ type WSMessage = {
|
|
|
479
497
|
availableSessions?: string[];
|
|
480
498
|
};
|
|
481
499
|
};
|
|
500
|
+
interface ViewInfo {
|
|
501
|
+
id: string;
|
|
502
|
+
label: string;
|
|
503
|
+
rect: {
|
|
504
|
+
x: number;
|
|
505
|
+
y: number;
|
|
506
|
+
width: number;
|
|
507
|
+
height: number;
|
|
508
|
+
};
|
|
509
|
+
}
|
|
482
510
|
/**
|
|
483
511
|
* Inbound WebSocket message types received from clients.
|
|
484
512
|
*/
|
|
@@ -537,6 +565,16 @@ type WSInboundMessage = {
|
|
|
537
565
|
selector: string;
|
|
538
566
|
} | {
|
|
539
567
|
type: 'focus_clear';
|
|
568
|
+
} | {
|
|
569
|
+
type: 'input_blur';
|
|
570
|
+
} | {
|
|
571
|
+
type: 'select_view';
|
|
572
|
+
rect: {
|
|
573
|
+
x: number;
|
|
574
|
+
y: number;
|
|
575
|
+
width: number;
|
|
576
|
+
height: number;
|
|
577
|
+
} | null;
|
|
540
578
|
};
|
|
541
579
|
/**
|
|
542
580
|
* A screencast frame message with binary image data.
|
|
@@ -587,28 +625,22 @@ interface StatusMessage {
|
|
|
587
625
|
*
|
|
588
626
|
* **Lazy screencast**: Screencast capture only starts when the first WS client
|
|
589
627
|
* binds to a session, and stops when the last client for that session disconnects.
|
|
628
|
+
*
|
|
629
|
+
* Responsibilities are delegated to:
|
|
630
|
+
* - **SessionManager**: client/session lifecycle, capturer start/stop, element monitors
|
|
631
|
+
* - **StreamCoordinator**: frame processing, stream state, crop management
|
|
632
|
+
* - **MessageDispatcher**: inbound message routing to typed handlers
|
|
590
633
|
*/
|
|
591
634
|
declare class WSServer extends EventEmitter {
|
|
592
635
|
private port;
|
|
593
636
|
private host;
|
|
594
|
-
private clients;
|
|
595
|
-
private sessionClients;
|
|
596
|
-
private screencasts;
|
|
597
637
|
private wsServer;
|
|
598
638
|
private isRunning;
|
|
599
|
-
private
|
|
600
|
-
private
|
|
601
|
-
private
|
|
602
|
-
private lastFrameData;
|
|
603
|
-
private lastFrameViewport;
|
|
604
|
-
private sessionCrops;
|
|
639
|
+
private readonly streamCoordinator;
|
|
640
|
+
private readonly sessionManager;
|
|
641
|
+
private readonly messageDispatcher;
|
|
605
642
|
constructor(config?: WSServerConfig);
|
|
606
|
-
private
|
|
607
|
-
/**
|
|
608
|
-
* Register a session page for screencast streaming.
|
|
609
|
-
* Call this when a session is created. The capturer will only start
|
|
610
|
-
* when a WS client binds to this session.
|
|
611
|
-
*/
|
|
643
|
+
private setupSessionManagerEvents;
|
|
612
644
|
registerSession(sessionId: string, page: XBPage, options?: {
|
|
613
645
|
interval?: number;
|
|
614
646
|
quality?: number;
|
|
@@ -616,42 +648,23 @@ declare class WSServer extends EventEmitter {
|
|
|
616
648
|
width?: number;
|
|
617
649
|
height?: number;
|
|
618
650
|
}): void;
|
|
619
|
-
/**
|
|
620
|
-
* Unregister a session. Stops screencast if running.
|
|
621
|
-
*/
|
|
622
651
|
unregisterSession(sessionId: string): void;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
652
|
+
pauseScreencast(sessionId: string): Promise<void>;
|
|
653
|
+
resumeScreencast(sessionId: string): Promise<void>;
|
|
654
|
+
private startScreencastIfNeeded;
|
|
655
|
+
private stopScreencastIfNeeded;
|
|
656
|
+
bindClientToSession(clientId: string, sessionId: string): void;
|
|
657
|
+
private sendBoundStatus;
|
|
626
658
|
start(): Promise<void>;
|
|
627
|
-
/**
|
|
628
|
-
* Attach to an existing HTTP server via WS upgrade.
|
|
629
|
-
* Shares the same port as the HTTP server (e.g., daemon port 9224).
|
|
630
|
-
* The WS path defaults to `/preview`.
|
|
631
|
-
*/
|
|
632
659
|
attachToServer(httpServer: Server, path?: string): Promise<void>;
|
|
633
|
-
|
|
634
|
-
* Set up the connection handler for incoming WS connections.
|
|
635
|
-
* When attached to an HTTP server, the third argument carries the sessionId
|
|
636
|
-
* extracted from the URL path (e.g., /preview/default).
|
|
637
|
-
*/
|
|
660
|
+
stop(): Promise<void>;
|
|
638
661
|
private setupConnectionHandler;
|
|
639
|
-
/**
|
|
640
|
-
* Lazy screencast: start when first client binds, stop when last unbinds.
|
|
641
|
-
*/
|
|
642
|
-
private startScreencastIfNeeded;
|
|
643
|
-
private stopScreencastIfNeeded;
|
|
644
|
-
pauseScreencast(sessionId: string): Promise<void>;
|
|
645
|
-
resumeScreencast(sessionId: string): Promise<void>;
|
|
646
|
-
private sendToClient;
|
|
647
|
-
private getClientPage;
|
|
648
662
|
private handleInboundMessage;
|
|
649
|
-
|
|
650
|
-
|
|
663
|
+
private handleClientDisconnect;
|
|
664
|
+
private sendToClient;
|
|
651
665
|
broadcastToSession(sessionId: string, message: WSMessage): void;
|
|
652
666
|
broadcast(message: WSMessage): void;
|
|
653
667
|
broadcastBinaryToSession(sessionId: string, payload: Buffer): void;
|
|
654
|
-
private handleClientDisconnect;
|
|
655
668
|
getClientCount(): number;
|
|
656
669
|
getSessionClientCount(sessionId: string): number;
|
|
657
670
|
getRunning(): boolean;
|
|
@@ -670,7 +683,7 @@ interface ExecutionResult {
|
|
|
670
683
|
data: unknown;
|
|
671
684
|
message?: string;
|
|
672
685
|
duration: number;
|
|
673
|
-
tips?:
|
|
686
|
+
tips?: Tip[];
|
|
674
687
|
hookOutputs?: HookOutput[];
|
|
675
688
|
}
|
|
676
689
|
/**
|
|
@@ -683,7 +696,7 @@ interface ChainStepResult {
|
|
|
683
696
|
data: unknown;
|
|
684
697
|
message?: string;
|
|
685
698
|
duration: number;
|
|
686
|
-
tips?:
|
|
699
|
+
tips?: Tip[];
|
|
687
700
|
hookOutputs?: HookOutput[];
|
|
688
701
|
}
|
|
689
702
|
/**
|
|
@@ -1256,23 +1269,6 @@ interface AISearchResult {
|
|
|
1256
1269
|
*/
|
|
1257
1270
|
declare function routeCommand(argv: string[], stdinCommands?: string[]): Promise<void>;
|
|
1258
1271
|
|
|
1259
|
-
/**
|
|
1260
|
-
* Read non-empty, non-comment lines from stdin.
|
|
1261
|
-
*
|
|
1262
|
-
* Returns an empty array when stdin is a TTY. Lines starting with `#` are
|
|
1263
|
-
* treated as comments and skipped.
|
|
1264
|
-
*
|
|
1265
|
-
* @returns Array of trimmed, non-comment lines.
|
|
1266
|
-
*/
|
|
1267
|
-
declare function readStdin(): Promise<string[]>;
|
|
1268
|
-
/**
|
|
1269
|
-
* Read a command file and return non-empty, non-comment lines.
|
|
1270
|
-
*
|
|
1271
|
-
* @param filePath - Path to the file to read.
|
|
1272
|
-
* @returns Array of trimmed, non-comment lines.
|
|
1273
|
-
*/
|
|
1274
|
-
declare function readCommandFile(filePath: string): string[];
|
|
1275
|
-
|
|
1276
1272
|
/**
|
|
1277
1273
|
* Open a new browser session, navigate to the given URL, and persist session metadata.
|
|
1278
1274
|
*
|
|
@@ -1636,7 +1632,7 @@ interface ClickContext {
|
|
|
1636
1632
|
}
|
|
1637
1633
|
interface UserAction {
|
|
1638
1634
|
id: number;
|
|
1639
|
-
type: 'click' | 'input' | 'change' | 'keydown' | 'submit' | 'scroll';
|
|
1635
|
+
type: 'click' | 'input' | 'change' | 'keydown' | 'submit' | 'scroll' | 'navigation' | 'goto' | 'cdp-fill' | 'cdp-click' | 'cdp-eval' | 'filechooser' | 'dblclick' | 'contextmenu' | 'hover' | 'drag' | 'resize' | 'clipboard' | 'touch' | 'focus' | 'visibility';
|
|
1640
1636
|
timestamp: number;
|
|
1641
1637
|
url: string;
|
|
1642
1638
|
pageTitle: string;
|
|
@@ -1644,6 +1640,21 @@ interface UserAction {
|
|
|
1644
1640
|
tag: string;
|
|
1645
1641
|
selector?: string;
|
|
1646
1642
|
text: string;
|
|
1643
|
+
/** Which strategy from generateUniqueSelector produced this selector */
|
|
1644
|
+
strategy?: string;
|
|
1645
|
+
/** Reliability rating from generateUniqueSelector: high / medium / low */
|
|
1646
|
+
confidence?: 'high' | 'medium' | 'low';
|
|
1647
|
+
/** Text-based fallback for low-confidence selectors (e.g. menu items) */
|
|
1648
|
+
textFallback?: {
|
|
1649
|
+
type: 'text';
|
|
1650
|
+
value: string;
|
|
1651
|
+
selector: string;
|
|
1652
|
+
};
|
|
1653
|
+
/** Popup/menu context when element is inside a dropdown */
|
|
1654
|
+
popup?: {
|
|
1655
|
+
containerSelector: string;
|
|
1656
|
+
containerText: string;
|
|
1657
|
+
};
|
|
1647
1658
|
role?: string;
|
|
1648
1659
|
type?: string;
|
|
1649
1660
|
placeholder?: string;
|
|
@@ -1658,6 +1669,77 @@ interface UserAction {
|
|
|
1658
1669
|
scrollY?: number;
|
|
1659
1670
|
/** Click context: popover/dropdown/menu items captured 200ms after click */
|
|
1660
1671
|
clickContext?: ClickContext;
|
|
1672
|
+
/** File upload info (type=filechooser only) */
|
|
1673
|
+
files?: {
|
|
1674
|
+
names: string[];
|
|
1675
|
+
count: number;
|
|
1676
|
+
isMultiple: boolean;
|
|
1677
|
+
fileData?: Array<{
|
|
1678
|
+
name: string;
|
|
1679
|
+
type: string;
|
|
1680
|
+
size: number;
|
|
1681
|
+
dataUrl: string | null;
|
|
1682
|
+
}>;
|
|
1683
|
+
};
|
|
1684
|
+
/** Drag & drop info (type=drag only) */
|
|
1685
|
+
drag?: {
|
|
1686
|
+
fromX: number;
|
|
1687
|
+
fromY: number;
|
|
1688
|
+
toX: number;
|
|
1689
|
+
toY: number;
|
|
1690
|
+
/** Source element description */
|
|
1691
|
+
source?: {
|
|
1692
|
+
tag: string;
|
|
1693
|
+
selector?: string;
|
|
1694
|
+
text: string;
|
|
1695
|
+
};
|
|
1696
|
+
/** Target (drop zone) element description */
|
|
1697
|
+
target?: {
|
|
1698
|
+
tag: string;
|
|
1699
|
+
selector?: string;
|
|
1700
|
+
text: string;
|
|
1701
|
+
};
|
|
1702
|
+
};
|
|
1703
|
+
/** Resize info (type=resize only) */
|
|
1704
|
+
resize?: {
|
|
1705
|
+
width: number;
|
|
1706
|
+
height: number;
|
|
1707
|
+
};
|
|
1708
|
+
/** Clipboard info (type=clipboard only) */
|
|
1709
|
+
clipboard?: {
|
|
1710
|
+
operation: 'copy' | 'paste' | 'cut';
|
|
1711
|
+
textPreview?: string;
|
|
1712
|
+
};
|
|
1713
|
+
/** Touch info (type=touch only) */
|
|
1714
|
+
touch?: {
|
|
1715
|
+
touchType: 'start' | 'move' | 'end';
|
|
1716
|
+
touches: Array<{
|
|
1717
|
+
x: number;
|
|
1718
|
+
y: number;
|
|
1719
|
+
}>;
|
|
1720
|
+
};
|
|
1721
|
+
/** Focus info (type=focus only) */
|
|
1722
|
+
focus?: {
|
|
1723
|
+
focusType: 'focus' | 'blur';
|
|
1724
|
+
};
|
|
1725
|
+
/** Visibility info (type=visibility only) */
|
|
1726
|
+
visibility?: {
|
|
1727
|
+
state: 'visible' | 'hidden';
|
|
1728
|
+
};
|
|
1729
|
+
/** Mouse trajectory from previous action's position to this action's position.
|
|
1730
|
+
* Captured as simplified waypoints with relative timestamps for realistic replay. */
|
|
1731
|
+
trajectory?: {
|
|
1732
|
+
/** Waypoints: [x, y, deltaMs from previous point] */
|
|
1733
|
+
points: Array<{
|
|
1734
|
+
x: number;
|
|
1735
|
+
y: number;
|
|
1736
|
+
dt: number;
|
|
1737
|
+
}>;
|
|
1738
|
+
/** Total distance in pixels (approximate) */
|
|
1739
|
+
distance: number;
|
|
1740
|
+
/** Total duration in ms */
|
|
1741
|
+
duration: number;
|
|
1742
|
+
};
|
|
1661
1743
|
}
|
|
1662
1744
|
interface NetworkEntry {
|
|
1663
1745
|
id: number;
|
|
@@ -1758,10 +1840,24 @@ declare class SessionRecorder {
|
|
|
1758
1840
|
private flushTimer;
|
|
1759
1841
|
private lastActionTs;
|
|
1760
1842
|
private activePages;
|
|
1843
|
+
private lastKnownUrl;
|
|
1844
|
+
/** Dedup window: after a CDP command action, ignore matching action signals within this window */
|
|
1845
|
+
private cdpActionDedup;
|
|
1846
|
+
/** Network dedup: last request key for short-window dedup */
|
|
1847
|
+
private _lastRequestKey;
|
|
1848
|
+
private _lastRequestTs;
|
|
1761
1849
|
private _isRecording;
|
|
1762
1850
|
constructor(context: XBContext, page: XBPage, sessionName: string);
|
|
1763
1851
|
get isRecording(): boolean;
|
|
1764
1852
|
get actionCount(): number;
|
|
1853
|
+
/** Record an action triggered by a CDP command (e.g. xbrowser fill/click/goto) */
|
|
1854
|
+
recordCommandAction(action: {
|
|
1855
|
+
type: string;
|
|
1856
|
+
selector?: string;
|
|
1857
|
+
value?: string;
|
|
1858
|
+
url?: string;
|
|
1859
|
+
element?: UserAction['element'];
|
|
1860
|
+
}): void;
|
|
1765
1861
|
get networkCount(): number;
|
|
1766
1862
|
getLiveData(): RecordingData;
|
|
1767
1863
|
addManualCheckpoint(type: string, hint: string, selector?: string): CheckpointEntry;
|
|
@@ -1788,6 +1884,7 @@ declare class SessionRecorder {
|
|
|
1788
1884
|
private handleNewPage;
|
|
1789
1885
|
private handleFrameNavigated;
|
|
1790
1886
|
private handleDialog;
|
|
1887
|
+
private handleFileChooser;
|
|
1791
1888
|
private pollActions;
|
|
1792
1889
|
private flushPendingActions;
|
|
1793
1890
|
/**
|
|
@@ -1831,7 +1928,7 @@ interface PlaybackResult {
|
|
|
1831
1928
|
totalEvents: number;
|
|
1832
1929
|
errors: Array<{
|
|
1833
1930
|
eventIndex: number;
|
|
1834
|
-
event
|
|
1931
|
+
event?: RecordedEvent;
|
|
1835
1932
|
error: string;
|
|
1836
1933
|
}>;
|
|
1837
1934
|
}
|
|
@@ -2230,49 +2327,8 @@ interface ParseOptions {
|
|
|
2230
2327
|
* @param input - The raw command chain string.
|
|
2231
2328
|
* @param options - Parse options; `fileMode` treats single `|` as a pipeline separator.
|
|
2232
2329
|
* @returns Array of parsed pipelines, each with commands and a chain type.
|
|
2233
|
-
*
|
|
2234
|
-
* @example
|
|
2235
|
-
* ```ts
|
|
2236
|
-
* const pipelines = parseCommandChain('goto https://example.com && click #btn');
|
|
2237
|
-
* // [{ pipeline: ['goto https://example.com', 'click #btn'], type: 'and' }]
|
|
2238
|
-
* ```
|
|
2239
2330
|
*/
|
|
2240
2331
|
declare function parseCommandChain(input: string, options?: ParseOptions): ParsedPipeline[];
|
|
2241
|
-
/**
|
|
2242
|
-
* Split a command string into whitespace-separated tokens, respecting quotes.
|
|
2243
|
-
*
|
|
2244
|
-
* @param cmdStr - The raw command string (e.g. `"click '#my-btn'"`).
|
|
2245
|
-
* @returns Array of string tokens.
|
|
2246
|
-
*/
|
|
2247
|
-
declare function splitCommand(cmdStr: string): string[];
|
|
2248
|
-
/**
|
|
2249
|
-
* Parse positional and flagged arguments into a parameter object.
|
|
2250
|
-
*
|
|
2251
|
-
* Supports `--key value`, `-s value` (short flags), and positional arguments
|
|
2252
|
-
* mapped via registered command definitions. Values are automatically coerced
|
|
2253
|
-
* to boolean, number, or string.
|
|
2254
|
-
*
|
|
2255
|
-
* @param name - The command name (used to look up positional parameter names).
|
|
2256
|
-
* @param args - Array of argument strings.
|
|
2257
|
-
* @returns An object with the command name and parsed params.
|
|
2258
|
-
*
|
|
2259
|
-
* @example
|
|
2260
|
-
* ```ts
|
|
2261
|
-
* const { params } = parseCommandArgs('fill', ['#email', 'hello']);
|
|
2262
|
-
* // { command: 'fill', params: { selector: '#email', value: 'hello' } }
|
|
2263
|
-
* ```
|
|
2264
|
-
*/
|
|
2265
|
-
declare function parseCommandArgs(name: string, args: string[]): {
|
|
2266
|
-
command: string;
|
|
2267
|
-
params: Record<string, unknown>;
|
|
2268
|
-
};
|
|
2269
|
-
/**
|
|
2270
|
-
* Register positional parameter names for a command used by {@link parseCommandArgs}.
|
|
2271
|
-
*
|
|
2272
|
-
* @param name - The command name.
|
|
2273
|
-
* @param positional - Ordered array of positional parameter names.
|
|
2274
|
-
*/
|
|
2275
|
-
declare function registerCommandDefinition(name: string, positional: string[]): void;
|
|
2276
2332
|
|
|
2277
2333
|
declare function normalizeSelector(input: string): string;
|
|
2278
2334
|
|
|
@@ -2399,7 +2455,8 @@ declare function generateJSScript(recording: Recording): string;
|
|
|
2399
2455
|
* Generate a Python replay script from a recording.
|
|
2400
2456
|
*
|
|
2401
2457
|
* @param recording - The recording session to convert.
|
|
2402
|
-
* @returns A self-contained Python script string using Playwright async API
|
|
2458
|
+
* @returns A self-contained Python script string using Playwright async API
|
|
2459
|
+
* (requires: pip install playwright && playwright install chromium).
|
|
2403
2460
|
*/
|
|
2404
2461
|
declare function generatePythonScript(recording: Recording): string;
|
|
2405
2462
|
/**
|
|
@@ -2789,4 +2846,4 @@ declare function advise(decision: DecisionResult, originalMethod: string): Advis
|
|
|
2789
2846
|
/** Convenience factory: create and start a CDP interceptor proxy with defaults. */
|
|
2790
2847
|
declare function createCDPInterceptor(config: CDPInterceptorConfig): Promise<CDPInterceptorProxy>;
|
|
2791
2848
|
|
|
2792
|
-
export { type APIRequest, type APIResponse, type AdvisoryResult, type AgentActionInput, type AgentActionResult, type AgentObservation, type AgentTarget, type AgentWaitInput, type AgentWaitResult, type AnalysisResult, BROWSER_SCOPE, type BatchCollectResult, type BrowserCommandContext, type BrowserCommandDefinition, type BrowserLaunchOptions, type BuiltinCommand, type BuiltinContext, type CDPError, type CDPInterceptorConfig, CDPInterceptorProxy, type CDPInterceptorRule, type CDPInterceptorStats, type CDPLogEntry, type CDPMessage, type CDPRequest, type CDPResponse, type CaptchaDetectionResult, CaptchaDetector, type ChainExecutionResult, type ChainRequest, type ChainStepResult, type CollectResult, type CollectorConfig, type CommandMessage, type CompanyInfo, type ContextChange, type DaemonInfo, DataCollector, DataStorage, type DecisionAction, type DecisionResult, type DomainStat, type ElementRef, type ExecRequest, type ExecutionResult, HTTPServer, type HTTPServerConfig, type HTTPServerError, HumanInteractionManager, type InstallOptions, type InstalledPlugin, type ManagedSession, type MessageDirection, type NetworkEntry, type ParsedPipeline, PlaybackEngine, type PlaybackOptions, type PlaybackResult, PluginInstaller, type PluginLoaderOptions, type RecordedEvent, RecorderController, type RecorderStatus, type Recording, type RecordingControlFile, type RecordingData, type RecordingEvent, type RecordingSession, type RecordingStep, type RecordingSummary, type RegisteredCommand, ResultAnalyzer, type RuleContext, type RuleEngine, type ScopeDefinition, type ScopeLevel, ScreencastCapturer, type ScreencastFrame, type ScreencastMessage, type ScreencastOptions, type SearchResult, type ManagedSession as SessionInfo, SessionRecorder, type StatusMessage, type StorageConfig, type UserAction, type ViolationSeverity, type WSInboundMessage, type WSMessage, WSServer, type WSServerConfig, type WaitForHumanOptions, type WaitForHumanResult, WebhookNotifier, type WebhookPayload, XBrowserPluginLoader, actOnPage, advise, allBuiltins, assertPageScope, attachWaitForHuman, automationSignalsRule, checkBrowserScope, routeCommand as cliRoute, closeAllSessions as closeAllBrowserSessions, closeAllSessions, closeSession, closeSessionByName, createCDPInterceptor, createRuleEngine, createSession, destroyBrowser, destroyBrowser as destroySessionManager, domMutationRule, emulationOverrideRule, eventSimulationRule, executeChain, executeCommand, extractAndSave, extractRecording, filterRecording, findSession, findSession as findSessionInfo, fingerprintingRule, generateBashScript, generateJSScript, generatePythonScript, getAllSessions as getAllBrowserSessions, getAllCommands, getBrowser, getBuiltin, getCaptchaConfig, getCommand, getCommandNames, getCompanyType, getDaemonProcessStatus, getPageScreenHash, getPlatformName, getSessionPage, getWSServerFromCache, inputKeystrokeRule, isChainInput, getAllSessions as listAllBrowserSessions, listSessions, mouseTrajectoryRule, networkAnomalyRule, normalizeSelector, observePage, openSession, pageLifecycleRule,
|
|
2849
|
+
export { type APIRequest, type APIResponse, type AdvisoryResult, type AgentActionInput, type AgentActionResult, type AgentObservation, type AgentTarget, type AgentWaitInput, type AgentWaitResult, type AnalysisResult, BROWSER_SCOPE, type BatchCollectResult, type BrowserCommandContext, type BrowserCommandDefinition, type BrowserLaunchOptions, type BuiltinCommand, type BuiltinContext, type CDPError, type CDPInterceptorConfig, CDPInterceptorProxy, type CDPInterceptorRule, type CDPInterceptorStats, type CDPLogEntry, type CDPMessage, type CDPRequest, type CDPResponse, type CaptchaDetectionResult, CaptchaDetector, type ChainExecutionResult, type ChainRequest, type ChainStepResult, type CollectResult, type CollectorConfig, type CommandMessage, type CompanyInfo, type ContextChange, type DaemonInfo, DataCollector, DataStorage, type DecisionAction, type DecisionResult, type DomainStat, type ElementRef, type ExecRequest, type ExecutionResult, HTTPServer, type HTTPServerConfig, type HTTPServerError, HumanInteractionManager, type InstallOptions, type InstalledPlugin, type ManagedSession, type MessageDirection, type NetworkEntry, type ParsedPipeline, PlaybackEngine, type PlaybackOptions, type PlaybackResult, PluginInstaller, type PluginLoaderOptions, type RecordedEvent, RecorderController, type RecorderStatus, type Recording, type RecordingControlFile, type RecordingData, type RecordingEvent, type RecordingSession, type RecordingStep, type RecordingSummary, type RegisteredCommand, ResultAnalyzer, type RuleContext, type RuleEngine, type ScopeDefinition, type ScopeLevel, ScreencastCapturer, type ScreencastFrame, type ScreencastMessage, type ScreencastOptions, type SearchResult, type ManagedSession as SessionInfo, SessionRecorder, type StatusMessage, type StorageConfig, type UserAction, type ViolationSeverity, type WSInboundMessage, type WSMessage, WSServer, type WSServerConfig, type WaitForHumanOptions, type WaitForHumanResult, WebhookNotifier, type WebhookPayload, XBrowserPluginLoader, actOnPage, advise, allBuiltins, assertPageScope, attachWaitForHuman, automationSignalsRule, checkBrowserScope, routeCommand as cliRoute, closeAllSessions as closeAllBrowserSessions, closeAllSessions, closeSession, closeSessionByName, createCDPInterceptor, createRuleEngine, createSession, destroyBrowser, destroyBrowser as destroySessionManager, domMutationRule, emulationOverrideRule, eventSimulationRule, executeChain, executeCommand, extractAndSave, extractRecording, filterRecording, findSession, findSession as findSessionInfo, fingerprintingRule, generateBashScript, generateJSScript, generatePythonScript, getAllSessions as getAllBrowserSessions, getAllCommands, getBrowser, getBuiltin, getCaptchaConfig, getCommand, getCommandNames, getCompanyType, getDaemonProcessStatus, getPageScreenHash, getPlatformName, getSessionPage, getWSServerFromCache, inputKeystrokeRule, isChainInput, getAllSessions as listAllBrowserSessions, listSessions, mouseTrajectoryRule, networkAnomalyRule, normalizeSelector, observePage, openSession, pageLifecycleRule, parseCommandChain, parseExcludeTypes, printExtractSummary, registerCommand, resetForTesting, setWSServer, setWSServerCache, startDaemonProcess, stopDaemonProcess, version, waitForPage };
|