@agentrhq/webcmd 0.2.1 → 0.2.2

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 (52) hide show
  1. package/README.md +39 -24
  2. package/cli-manifest.json +504 -0
  3. package/clis/_shared/site-auth.js +6 -1
  4. package/clis/district/_lib.js +566 -0
  5. package/clis/district/auth.js +49 -0
  6. package/clis/district/checkout.js +278 -0
  7. package/clis/district/listings.js +158 -0
  8. package/clis/district/locations.js +211 -0
  9. package/clis/district/search.js +218 -0
  10. package/clis/district/seats.js +233 -0
  11. package/clis/district/set-location.js +82 -0
  12. package/clis/district/showtimes.js +433 -0
  13. package/clis/reddit/popular.js +12 -1
  14. package/clis/reddit/popular.test.js +12 -3
  15. package/dist/src/browser/bridge.d.ts +1 -0
  16. package/dist/src/browser/bridge.js +1 -1
  17. package/dist/src/browser/page.d.ts +4 -1
  18. package/dist/src/browser/page.js +12 -1
  19. package/dist/src/browser/protocol.d.ts +2 -0
  20. package/dist/src/browser/runtime/local-cloak/actions.js +1 -0
  21. package/dist/src/browser/runtime/local-cloak/session-manager.d.ts +2 -0
  22. package/dist/src/browser/runtime/local-cloak/session-manager.js +12 -2
  23. package/dist/src/browser/runtime/local-cloak/session-manager.test.js +58 -0
  24. package/dist/src/build-manifest.js +1 -0
  25. package/dist/src/build-manifest.test.js +34 -0
  26. package/dist/src/cli.js +111 -28
  27. package/dist/src/discovery.js +1 -0
  28. package/dist/src/engine.test.js +62 -0
  29. package/dist/src/execution.js +1 -1
  30. package/dist/src/manifest-types.d.ts +2 -0
  31. package/dist/src/registry.d.ts +10 -0
  32. package/dist/src/registry.js +5 -3
  33. package/dist/src/registry.test.js +25 -0
  34. package/dist/src/runtime.d.ts +2 -0
  35. package/dist/src/runtime.js +1 -0
  36. package/dist/src/skills.d.ts +23 -5
  37. package/dist/src/skills.js +87 -45
  38. package/dist/src/skills.test.js +80 -23
  39. package/package.json +2 -2
  40. package/skills/smart-search/SKILL.md +156 -0
  41. package/skills/smart-search/references/sources-ai.md +74 -0
  42. package/skills/smart-search/references/sources-info.md +43 -0
  43. package/skills/smart-search/references/sources-media.md +40 -0
  44. package/skills/smart-search/references/sources-other.md +32 -0
  45. package/skills/smart-search/references/sources-shopping.md +21 -0
  46. package/skills/smart-search/references/sources-social.md +36 -0
  47. package/skills/smart-search/references/sources-tech.md +38 -0
  48. package/skills/smart-search/references/sources-travel.md +26 -0
  49. package/skills/webcmd-adapter-author/SKILL.md +1 -0
  50. package/skills/webcmd-adapter-author/references/adapter-template.md +2 -0
  51. package/skills/webcmd-autofix/SKILL.md +8 -0
  52. package/skills/webcmd-sitemap-author/SKILL.md +1 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
  <img alt="Join the community on Discord" src="https://img.shields.io/badge/Join%20the%20community-7C3AED.svg?style=for-the-badge&logo=discord&logoColor=white&labelColor=000000&logoWidth=20">
15
15
  </a>
16
16
  <a href="https://x.com/agentrhq">
17
- <img alt="Follow AgentR on X" src="https://img.shields.io/badge/Follow%20%40agentrhq-000000.svg?style=for-the-badge&logo=x&logoColor=white&labelColor=000000&logoWidth=20">
17
+ <img alt="Follow AgentR on X" src="https://img.shields.io/badge/Built%20by%20%40agentrhq-000000.svg?style=for-the-badge&logo=x&logoColor=white&labelColor=000000&logoWidth=20">
18
18
  </a>
19
19
  </p>
20
20
 
@@ -24,14 +24,14 @@
24
24
 
25
25
  WebCMD learns the navigational context of websites as agents use them, then compiles that knowledge into deterministic commands for faster, cheaper, more reliable browser automation. The goal is simple: stop making agents rediscover the same sites on every run and cut browser-agent token spend by up to 90%.
26
26
 
27
- On top of vanilla browser interactions, WebCMD adds 3 layers of learnings. Each layer collapses cost and variance for the layer above it.
27
+ On top of live browser control, WebCMD adds 3 layers of learnings. Each layer collapses cost and variance for the layer above it.
28
28
 
29
29
  | Layer | Scenario | What Webcmd Helps With |
30
30
  | --- | --- | --- |
31
31
  | 1. Live browser control | The site is unfamiliar. | Use `webcmd browser` to inspect, click, type, extract, capture network calls, and complete the task in a real browser. |
32
32
  | 2. Sitemap memory | The site is familiar, but the action space is not fully known. | Capture an agent-facing sitemap of observed pages, states, actions, workflows, APIs, pitfalls, and fallback paths. |
33
- | 3. CLI authoring | The action space is known, but the path is still too variable for one fixed sequence. | Explicitly author a reusable `webcmd <site> <command>` adapter with structured output, so future agents spend tokens on the task instead of navigation. |
34
- | 4. Custom CLI commands | The workflow is deterministic enough to stop browsing. | Extend the CLI with a tailored command so the workflow runs instantly with the least amount of tokens. |
33
+ | 3. CLI authoring | The action space is known, but the path is still too variable for one fixed sequence. | Explicitly author a reusable `webcmd <site>` adapter with structured output, so future agents spend tokens on the task instead of navigation. |
34
+ | 4. Extend existing CLIs | The workflow is deterministic enough to stop browsing. | Extend the `webcmd <site>` adapter with a tailored command so the workflow runs instantly with the least amount of tokens. |
35
35
 
36
36
 
37
37
  ## Quick Start
@@ -51,7 +51,7 @@ npm install -g @agentrhq/webcmd
51
51
  webcmd doctor
52
52
  ```
53
53
 
54
- `doctor` checks the Webcmd browser bridge: daemon status, runtime wiring, profile selection, and a live connectivity probe. Pure public adapters and local passthrough commands do not need a green browser check, but `COOKIE`, `INTERCEPT`, `UI`, and `webcmd browser` workflows do.
54
+ `doctor` checks the Webcmd browser bridge: daemon status, browser runtime installation, profile selection, and a live connectivity probe. Pure public adapters and local passthrough commands do not need a green browser check, but `COOKIE`, `INTERCEPT`, `UI`, and `webcmd browser` workflows do.
55
55
 
56
56
  ### 3. Discover commands
57
57
 
@@ -64,7 +64,7 @@ webcmd reddit hot --help
64
64
 
65
65
  `webcmd list -f json` is the source of truth for agents. It emits one row per command with the site, command name, arguments, output columns, browser requirement, and strategy.
66
66
 
67
- ### 4. Run your first adapters
67
+ ### 4. Run your first command
68
68
 
69
69
  ```bash
70
70
  webcmd hackernews top --limit 5
@@ -80,23 +80,20 @@ Use Webcmd directly when you want a reliable command instead of a live browser s
80
80
  webcmd list
81
81
  webcmd <site> --help
82
82
  webcmd <site> <command> --help
83
- webcmd <site> <command> -f json
83
+ webcmd <site> <command> -f yaml
84
84
  ```
85
85
 
86
86
  The everyday surface is intentionally small:
87
87
 
88
88
  - `webcmd list` shows every registered adapter and external command.
89
89
  - `webcmd <site> <command> ...` runs a built-in, plugin, or private adapter.
90
- - `webcmd external register <name>` exposes a local CLI through the same discovery surface.
91
- - `webcmd doctor` diagnoses browser connectivity for authenticated or UI-driven commands.
92
90
 
93
91
  For example:
94
92
 
95
93
  ```bash
96
94
  webcmd hackernews top --limit 10
97
95
  webcmd reddit subreddit programming --limit 10
98
- webcmd github whoami
99
- webcmd gh pr list --limit 5
96
+ webcmd twitter whoami
100
97
  ```
101
98
 
102
99
  Adapter commands are tagged by strategy:
@@ -119,19 +116,23 @@ webcmd hackernews top -f md
119
116
  webcmd hackernews top -f csv
120
117
  ```
121
118
 
122
- Agents usually want `-f json`; humans usually want the default table.
119
+ Agents usually want `-f json`; humans usually want table (default) or yaml.
123
120
 
124
121
  ## For AI Agents
125
122
 
126
123
  Webcmd is designed to be driven by coding agents such as Codex, Claude Code, Cursor, and similar tools.
127
124
 
128
- Install Webcmd skills into the agent environment with your agent's skill manager:
125
+ ## Install skills (also refreshes existing installs)
126
+
127
+ Install Webcmd skills into your agent environment:
129
128
 
130
129
  ```bash
131
- npx skills add agentrhq/webcmd
130
+ webcmd skills install
132
131
  ```
133
132
 
134
- Or install/copy only the skills you need from [`skills/`](./skills/) into your agent's skills root. These skills teach agents when to use adapters, when to drive the browser, how to author new adapters, and how to repair failing commands.
133
+ The installer asks whether to install globally or locally, then asks for the coding agent (`agents`, `codex`, `claude`) or a custom skills path. For scripts, pass flags such as `--scope project --provider codex` or `--path ./my-skills`.
134
+
135
+ ### Which skill to use
135
136
 
136
137
  | Skill | When to use |
137
138
  |-------|-------------|
@@ -153,20 +154,34 @@ webcmd <site> <command> --trace retain-on-failure -f json
153
154
 
154
155
  Start with adapters. Fall back to `webcmd browser` only when no adapter covers the task or you are teaching Webcmd a new site flow.
155
156
 
156
- ## Browser Automation
157
+ ## Live Browser Interaction
158
+
159
+ `webcmd browser` gives agents a stable, structured interface to a real browser. Every command takes a session name immediately after `browser` — the session is required, so `webcmd browser tab list` without one is an error:
160
+
161
+ ```bash
162
+ webcmd browser <session> open https://example.com
163
+ ```
164
+
165
+ ### Tabs and page IDs
157
166
 
158
- `webcmd browser` gives agents a stable, structured interface to a real browser. Commands use a session name immediately after `browser`:
167
+ `webcmd browser work open <url>` and `webcmd browser work tab new [url]` both return a page ID in the `page` field:
159
168
 
160
169
  ```bash
161
- webcmd browser work open https://example.com
162
- webcmd browser work state
163
- webcmd browser work click --role link --name "Learn more"
164
- webcmd browser work type --role textbox --name Email "you@example.com"
165
- webcmd browser work keys Enter
166
- webcmd browser work extract
167
- webcmd browser work close
170
+ $ webcmd browser work open https://reddit.com
171
+ {
172
+ "url": "https://reddit.com",
173
+ "page": "page-1783484232033-8"
174
+ }
168
175
  ```
169
176
 
177
+ Use `webcmd browser work tab list` to inspect all tabs — each entry carries its page ID (`id`/`page`), the owning `session` (adapter sessions appear as `site:<name>`), and whether it is the currently `selected` tab. Pass `--tab <pageId>` to route a single command to a specific tab:
178
+
179
+ ```bash
180
+ webcmd browser work open https://example.com --tab page-1783484232033-8
181
+ ```
182
+
183
+ `tab new` creates a tab without changing the session's default tab; only `tab select <pageId>` promotes a tab to the default for later untargeted commands in the same session.
184
+
170
185
  Useful browser primitives include:
171
186
 
172
187
  | Area | Commands |
package/cli-manifest.json CHANGED
@@ -6912,6 +6912,510 @@
6912
6912
  "sourceFile": "discord-app/threads.js",
6913
6913
  "navigateBefore": true
6914
6914
  },
6915
+ {
6916
+ "site": "district",
6917
+ "name": "checkout",
6918
+ "description": "Select District movie seats and stop at the payment handoff page",
6919
+ "access": "write",
6920
+ "domain": "www.district.in",
6921
+ "strategy": "cookie",
6922
+ "browser": true,
6923
+ "args": [
6924
+ {
6925
+ "name": "show",
6926
+ "type": "str",
6927
+ "required": true,
6928
+ "positional": true,
6929
+ "help": "District seat-layout URL or showId from district showtimes"
6930
+ },
6931
+ {
6932
+ "name": "seats",
6933
+ "type": "str",
6934
+ "required": true,
6935
+ "help": "Comma-separated seat labels to select, e.g. I22,I21"
6936
+ },
6937
+ {
6938
+ "name": "format-id",
6939
+ "type": "str",
6940
+ "required": false,
6941
+ "help": "District formatId from showtimes; required when show is a showId"
6942
+ },
6943
+ {
6944
+ "name": "content-id",
6945
+ "type": "str",
6946
+ "required": false,
6947
+ "help": "District content id; required when show is a showId"
6948
+ },
6949
+ {
6950
+ "name": "timeout",
6951
+ "type": "int",
6952
+ "default": 45,
6953
+ "required": false,
6954
+ "help": "Maximum seconds to wait for selection and review page"
6955
+ }
6956
+ ],
6957
+ "columns": [
6958
+ "status",
6959
+ "movie",
6960
+ "cinema",
6961
+ "date",
6962
+ "time",
6963
+ "seats",
6964
+ "ticketCount",
6965
+ "orderAmount",
6966
+ "bookingCharge",
6967
+ "total",
6968
+ "paymentUrl",
6969
+ "showId"
6970
+ ],
6971
+ "type": "js",
6972
+ "modulePath": "district/checkout.js",
6973
+ "sourceFile": "district/checkout.js",
6974
+ "navigateBefore": false,
6975
+ "siteSession": "persistent",
6976
+ "freshPage": true,
6977
+ "defaultWindowMode": "foreground"
6978
+ },
6979
+ {
6980
+ "site": "district",
6981
+ "name": "listings",
6982
+ "aliases": [
6983
+ "ls"
6984
+ ],
6985
+ "description": "List public District by Zomato movies, events, and nearby going-out cards",
6986
+ "access": "read",
6987
+ "domain": "www.district.in",
6988
+ "strategy": "public",
6989
+ "browser": false,
6990
+ "args": [
6991
+ {
6992
+ "name": "input",
6993
+ "type": "str",
6994
+ "default": "home",
6995
+ "required": false,
6996
+ "positional": true,
6997
+ "help": "home, movies, events, a district.in URL, or a District path"
6998
+ },
6999
+ {
7000
+ "name": "limit",
7001
+ "type": "int",
7002
+ "default": 20,
7003
+ "required": false,
7004
+ "help": "Maximum rows to return (1-100)"
7005
+ }
7006
+ ],
7007
+ "columns": [
7008
+ "rank",
7009
+ "title",
7010
+ "category",
7011
+ "date",
7012
+ "venue",
7013
+ "price",
7014
+ "url"
7015
+ ],
7016
+ "type": "js",
7017
+ "modulePath": "district/listings.js",
7018
+ "sourceFile": "district/listings.js"
7019
+ },
7020
+ {
7021
+ "site": "district",
7022
+ "name": "locations",
7023
+ "aliases": [
7024
+ "location-search"
7025
+ ],
7026
+ "description": "Search District-supported cities, areas, malls, and places for booking filters",
7027
+ "access": "read",
7028
+ "domain": "www.district.in",
7029
+ "strategy": "public",
7030
+ "browser": false,
7031
+ "args": [
7032
+ {
7033
+ "name": "query",
7034
+ "type": "str",
7035
+ "required": true,
7036
+ "positional": true,
7037
+ "help": "City, area, mall, or locality, for example \"bangalore\" or \"indiranagar\""
7038
+ },
7039
+ {
7040
+ "name": "limit",
7041
+ "type": "int",
7042
+ "default": 10,
7043
+ "required": false,
7044
+ "help": "Maximum location rows to return (1-50)"
7045
+ }
7046
+ ],
7047
+ "columns": [
7048
+ "rank",
7049
+ "name",
7050
+ "kind",
7051
+ "city",
7052
+ "state",
7053
+ "cityKey",
7054
+ "cityId",
7055
+ "placeId",
7056
+ "lat",
7057
+ "lng",
7058
+ "distanceKm",
7059
+ "source"
7060
+ ],
7061
+ "type": "js",
7062
+ "modulePath": "district/locations.js",
7063
+ "sourceFile": "district/locations.js"
7064
+ },
7065
+ {
7066
+ "site": "district",
7067
+ "name": "login",
7068
+ "description": "Open district login and wait until the browser session is authenticated",
7069
+ "access": "write",
7070
+ "domain": "www.district.in",
7071
+ "strategy": "cookie",
7072
+ "browser": true,
7073
+ "args": [
7074
+ {
7075
+ "name": "timeout",
7076
+ "type": "int",
7077
+ "default": 300,
7078
+ "required": false,
7079
+ "help": "Maximum seconds to wait for the user to finish login"
7080
+ }
7081
+ ],
7082
+ "columns": [
7083
+ "status",
7084
+ "logged_in",
7085
+ "site",
7086
+ "user_id",
7087
+ "name",
7088
+ "phone_number",
7089
+ "email"
7090
+ ],
7091
+ "type": "js",
7092
+ "modulePath": "district/auth.js",
7093
+ "sourceFile": "district/auth.js",
7094
+ "navigateBefore": false,
7095
+ "siteSession": "persistent",
7096
+ "defaultWindowMode": "foreground"
7097
+ },
7098
+ {
7099
+ "site": "district",
7100
+ "name": "search",
7101
+ "aliases": [
7102
+ "s"
7103
+ ],
7104
+ "description": "Search District by Zomato across movies, events, dining, stores, activities, and play",
7105
+ "access": "read",
7106
+ "domain": "www.district.in",
7107
+ "strategy": "public",
7108
+ "browser": false,
7109
+ "args": [
7110
+ {
7111
+ "name": "query",
7112
+ "type": "str",
7113
+ "required": true,
7114
+ "positional": true,
7115
+ "help": "Search query, for example \"hamlet\" or \"arijit\""
7116
+ },
7117
+ {
7118
+ "name": "limit",
7119
+ "type": "int",
7120
+ "default": 20,
7121
+ "required": false,
7122
+ "help": "Maximum rows to return (1-100)"
7123
+ },
7124
+ {
7125
+ "name": "tab",
7126
+ "type": "str",
7127
+ "default": "all",
7128
+ "required": false,
7129
+ "help": "Search tab: all, dining, events, movies, stores, activities, or play"
7130
+ }
7131
+ ],
7132
+ "columns": [
7133
+ "rank",
7134
+ "title",
7135
+ "category",
7136
+ "date",
7137
+ "venue",
7138
+ "price",
7139
+ "url"
7140
+ ],
7141
+ "type": "js",
7142
+ "modulePath": "district/search.js",
7143
+ "sourceFile": "district/search.js"
7144
+ },
7145
+ {
7146
+ "site": "district",
7147
+ "name": "seats",
7148
+ "description": "List available seats for a District movie showtime",
7149
+ "access": "read",
7150
+ "domain": "www.district.in",
7151
+ "strategy": "cookie",
7152
+ "browser": true,
7153
+ "args": [
7154
+ {
7155
+ "name": "show",
7156
+ "type": "str",
7157
+ "required": true,
7158
+ "positional": true,
7159
+ "help": "District seat-layout URL or showId from district showtimes"
7160
+ },
7161
+ {
7162
+ "name": "format-id",
7163
+ "type": "str",
7164
+ "required": false,
7165
+ "help": "District formatId from showtimes; required when show is a showId"
7166
+ },
7167
+ {
7168
+ "name": "content-id",
7169
+ "type": "str",
7170
+ "required": false,
7171
+ "help": "District content id; required when show is a showId"
7172
+ },
7173
+ {
7174
+ "name": "class",
7175
+ "type": "str",
7176
+ "required": false,
7177
+ "help": "Optional seat class filter, e.g. premium, premium xl, or recliner"
7178
+ },
7179
+ {
7180
+ "name": "count",
7181
+ "type": "int",
7182
+ "required": false,
7183
+ "help": "Number of seats to choose (1-10); without count, seats are listed normally"
7184
+ },
7185
+ {
7186
+ "name": "together",
7187
+ "type": "str",
7188
+ "required": false,
7189
+ "help": "Require selected seats to be adjacent when count is provided"
7190
+ },
7191
+ {
7192
+ "name": "max-price",
7193
+ "type": "float",
7194
+ "required": false,
7195
+ "help": "Maximum price per seat"
7196
+ },
7197
+ {
7198
+ "name": "limit",
7199
+ "type": "int",
7200
+ "default": 100,
7201
+ "required": false,
7202
+ "help": "Maximum seats to return (1-300)"
7203
+ },
7204
+ {
7205
+ "name": "timeout",
7206
+ "type": "int",
7207
+ "default": 30,
7208
+ "required": false,
7209
+ "help": "Maximum seconds to wait for the seat map to render"
7210
+ }
7211
+ ],
7212
+ "columns": [
7213
+ "rank",
7214
+ "seat",
7215
+ "row",
7216
+ "number",
7217
+ "column",
7218
+ "seatClass",
7219
+ "price",
7220
+ "status",
7221
+ "flags",
7222
+ "showId",
7223
+ "formatId",
7224
+ "url"
7225
+ ],
7226
+ "type": "js",
7227
+ "modulePath": "district/seats.js",
7228
+ "sourceFile": "district/seats.js",
7229
+ "navigateBefore": false,
7230
+ "siteSession": "persistent",
7231
+ "defaultWindowMode": "foreground"
7232
+ },
7233
+ {
7234
+ "site": "district",
7235
+ "name": "set-location",
7236
+ "aliases": [
7237
+ "setlocation"
7238
+ ],
7239
+ "description": "Set the District browser session location for movie booking filters",
7240
+ "access": "write",
7241
+ "domain": "www.district.in",
7242
+ "strategy": "cookie",
7243
+ "browser": true,
7244
+ "args": [
7245
+ {
7246
+ "name": "location",
7247
+ "type": "str",
7248
+ "required": true,
7249
+ "positional": true,
7250
+ "help": "City, area, mall, or locality, for example \"Bangalore\" or \"Indiranagar\""
7251
+ },
7252
+ {
7253
+ "name": "rank",
7254
+ "type": "int",
7255
+ "default": 1,
7256
+ "required": false,
7257
+ "help": "Pick the Nth District location result (1-20), default: 1"
7258
+ },
7259
+ {
7260
+ "name": "timeout",
7261
+ "type": "int",
7262
+ "default": 45,
7263
+ "required": false,
7264
+ "help": "Maximum seconds to wait for the picker and location change"
7265
+ }
7266
+ ],
7267
+ "columns": [
7268
+ "status",
7269
+ "name",
7270
+ "city",
7271
+ "state",
7272
+ "cityKey",
7273
+ "cityId",
7274
+ "placeId",
7275
+ "subzoneId",
7276
+ "lat",
7277
+ "lng",
7278
+ "availableTabs",
7279
+ "source"
7280
+ ],
7281
+ "type": "js",
7282
+ "modulePath": "district/set-location.js",
7283
+ "sourceFile": "district/set-location.js",
7284
+ "navigateBefore": false,
7285
+ "siteSession": "persistent",
7286
+ "defaultWindowMode": "foreground"
7287
+ },
7288
+ {
7289
+ "site": "district",
7290
+ "name": "showtimes",
7291
+ "aliases": [
7292
+ "shows"
7293
+ ],
7294
+ "description": "List District movie showtimes with location, time, cinema, language, price, and format filters",
7295
+ "access": "read",
7296
+ "domain": "www.district.in",
7297
+ "strategy": "cookie",
7298
+ "browser": true,
7299
+ "args": [
7300
+ {
7301
+ "name": "movie",
7302
+ "type": "str",
7303
+ "required": true,
7304
+ "positional": true,
7305
+ "help": "Movie name or District movie URL"
7306
+ },
7307
+ {
7308
+ "name": "date",
7309
+ "type": "str",
7310
+ "required": false,
7311
+ "help": "Show date in YYYY-MM-DD format; defaults to District selected date"
7312
+ },
7313
+ {
7314
+ "name": "city",
7315
+ "type": "str",
7316
+ "required": false,
7317
+ "help": "District city name/key, for example Bangalore or Bengaluru"
7318
+ },
7319
+ {
7320
+ "name": "near",
7321
+ "type": "str",
7322
+ "required": false,
7323
+ "help": "Area, mall, or locality to search near, for example Indiranagar"
7324
+ },
7325
+ {
7326
+ "name": "city-key",
7327
+ "type": "str",
7328
+ "required": false,
7329
+ "help": "Legacy District city key override, for example bengaluru"
7330
+ },
7331
+ {
7332
+ "name": "after",
7333
+ "type": "str",
7334
+ "required": false,
7335
+ "help": "Only shows at or after HH:MM, 24-hour time"
7336
+ },
7337
+ {
7338
+ "name": "before",
7339
+ "type": "str",
7340
+ "required": false,
7341
+ "help": "Only shows at or before HH:MM, 24-hour time"
7342
+ },
7343
+ {
7344
+ "name": "cinema",
7345
+ "type": "str",
7346
+ "required": false,
7347
+ "help": "Filter cinema/theatre name, for example PVR, INOX, Orion"
7348
+ },
7349
+ {
7350
+ "name": "language",
7351
+ "type": "str",
7352
+ "required": false,
7353
+ "help": "Filter movie language, for example English, Hindi, Kannada"
7354
+ },
7355
+ {
7356
+ "name": "max-price",
7357
+ "type": "float",
7358
+ "required": false,
7359
+ "help": "Only shows with at least one ticket class at or below this price"
7360
+ },
7361
+ {
7362
+ "name": "quality",
7363
+ "type": "str",
7364
+ "required": false,
7365
+ "help": "Generic format/quality filter, for example 2D, 3D, IMAX, IMAX 3D, 4DX"
7366
+ },
7367
+ {
7368
+ "name": "limit",
7369
+ "type": "int",
7370
+ "default": 50,
7371
+ "required": false,
7372
+ "help": "Maximum showtime rows to return (1-200)"
7373
+ }
7374
+ ],
7375
+ "columns": [
7376
+ "rank",
7377
+ "movie",
7378
+ "language",
7379
+ "date",
7380
+ "time",
7381
+ "cinema",
7382
+ "format",
7383
+ "priceRange",
7384
+ "available",
7385
+ "showId",
7386
+ "formatId",
7387
+ "url"
7388
+ ],
7389
+ "type": "js",
7390
+ "modulePath": "district/showtimes.js",
7391
+ "sourceFile": "district/showtimes.js",
7392
+ "navigateBefore": false,
7393
+ "siteSession": "persistent",
7394
+ "defaultWindowMode": "foreground"
7395
+ },
7396
+ {
7397
+ "site": "district",
7398
+ "name": "whoami",
7399
+ "description": "Show the current logged-in district account",
7400
+ "access": "read",
7401
+ "domain": "www.district.in",
7402
+ "strategy": "cookie",
7403
+ "browser": true,
7404
+ "args": [],
7405
+ "columns": [
7406
+ "logged_in",
7407
+ "site",
7408
+ "user_id",
7409
+ "name",
7410
+ "phone_number",
7411
+ "email"
7412
+ ],
7413
+ "type": "js",
7414
+ "modulePath": "district/auth.js",
7415
+ "sourceFile": "district/auth.js",
7416
+ "navigateBefore": false,
7417
+ "siteSession": "persistent"
7418
+ },
6915
7419
  {
6916
7420
  "site": "dockerhub",
6917
7421
  "name": "image",
@@ -46,6 +46,11 @@ export function registerSiteAuthCommands(config) {
46
46
  if (!config?.site || !config?.domain || !config?.loginUrl || typeof config.verify !== 'function') {
47
47
  throw new Error('registerSiteAuthCommands requires site, domain, loginUrl, and verify(page)');
48
48
  }
49
+ // Sites whose login is a modal/flow rather than a page can pass
50
+ // openLogin(page) to bring the login UI up; default is a plain navigation.
51
+ const openLogin = typeof config.openLogin === 'function'
52
+ ? config.openLogin
53
+ : async (page) => { await page.goto(config.loginUrl); };
49
54
 
50
55
  cli({
51
56
  site: config.site,
@@ -92,7 +97,7 @@ export function registerSiteAuthCommands(config) {
92
97
  if (!isAuthRequired(error)) throw error;
93
98
  }
94
99
 
95
- await page.goto(config.loginUrl);
100
+ await openLogin(page);
96
101
  const timeoutSeconds = Number(kwargs.timeout ?? DEFAULT_TIMEOUT_SECONDS);
97
102
  const deadline = Date.now() + timeoutSeconds * 1000;
98
103
  let lastAuthMessage = '';