@ranganathmk/trq 0.1.0

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 ADDED
@@ -0,0 +1,61 @@
1
+ # trq
2
+
3
+ Record browser sessions, replay them, resume mid-session. CLI + Electron GUI in one install.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g trq
9
+ ```
10
+
11
+ This installs the `trq` binary globally and pulls Electron + Puppeteer as runtime dependencies.
12
+
13
+ ## CLI
14
+
15
+ ```bash
16
+ trq new my-flow --url https://example.com # start recording a new session
17
+ trq list # list all sessions
18
+ trq show my-flow # print recorded events
19
+ trq play my-flow # replay end-to-end (headful Chrome)
20
+ trq play my-flow --to 5 --slow # replay up to step 5, slowly
21
+ trq resume my-flow # replay then keep recording from the end
22
+ trq config show my-flow # inspect the session's config.json
23
+ trq config set my-flow viewport '{"width":1280,"height":720}'
24
+ trq config unset my-flow viewport
25
+ trq studio # launch the Electron GUI
26
+ trq --help
27
+ ```
28
+
29
+ ## Studio (GUI)
30
+
31
+ ```bash
32
+ trq studio
33
+ ```
34
+
35
+ Opens the Electron desktop app with:
36
+
37
+ - Session sidebar + record / play / resume / debug controls
38
+ - Live events log with right-click edit / delete / insert / branch
39
+ - Element inspector with selector ladder + quality badges
40
+ - Pause-at-failure UI: retry / skip / edit / stop on a step failure, with auto-suggested fresh selectors
41
+
42
+ ## Sessions
43
+
44
+ Stored in `./sessions/` by default. Override with:
45
+
46
+ ```bash
47
+ TRQ_SESSIONS_DIR=/path/to/dir trq list
48
+ ```
49
+
50
+ ## Environment variables
51
+
52
+ | Var | Effect |
53
+ |---|---|
54
+ | `TRQ_SESSIONS_DIR` | Override session storage dir. Default: `$CWD/sessions`. |
55
+ | `TRQ_DEBUG_REPLAY` | When set, print per-step URL log + page-side selector-resolve diagnostics. |
56
+ | `TRQ_DEBUG_CDP` | Mirror raw CDP traffic to stdout. |
57
+ | `TRQ_DEBUG_LAYOUT` | Print BrowserView layout reflows. |
58
+
59
+ ## License
60
+
61
+ MIT
package/bin/trq.mjs ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ // trq CLI entry. Imports the bundled @trq/core dispatcher from dist/cli.mjs
3
+ // (produced by packages/cli/build.mjs) so the published `trq` package is
4
+ // fully self-contained — no separate @trq/core registry entry needed.
5
+ //
6
+ // Sets TRQ_STUDIO_PATH so the `studio` subcommand knows where the bundled
7
+ // Electron app lives inside this package, regardless of where npm placed
8
+ // it on a global install.
9
+ import path from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+ const here = path.dirname(fileURLToPath(import.meta.url));
12
+ process.env.TRQ_STUDIO_PATH = process.env.TRQ_STUDIO_PATH
13
+ ?? path.resolve(here, '../dist/studio');
14
+ await import('../dist/cli.mjs');