@agentrhq/webcmd 0.2.0 → 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 (78) hide show
  1. package/README.md +58 -31
  2. package/cli-manifest.json +506 -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/clis/twitter/delete.js +14 -6
  16. package/clis/twitter/delete.test.js +74 -1
  17. package/clis/twitter/timeline.js +3 -1
  18. package/clis/twitter/timeline.test.js +4 -0
  19. package/dist/src/browser/bridge-readiness.test.js +1 -1
  20. package/dist/src/browser/bridge.d.ts +2 -0
  21. package/dist/src/browser/bridge.js +6 -4
  22. package/dist/src/browser/cdp.d.ts +1 -0
  23. package/dist/src/browser/daemon-client.d.ts +1 -0
  24. package/dist/src/browser/daemon-client.js +7 -2
  25. package/dist/src/browser/daemon-client.test.js +33 -30
  26. package/dist/src/browser/daemon-transport.js +3 -19
  27. package/dist/src/browser/page.d.ts +5 -1
  28. package/dist/src/browser/page.js +16 -1
  29. package/dist/src/browser/profile.d.ts +9 -0
  30. package/dist/src/browser/profile.js +18 -7
  31. package/dist/src/browser/profile.test.d.ts +1 -0
  32. package/dist/src/browser/profile.test.js +44 -0
  33. package/dist/src/browser/protocol.d.ts +3 -0
  34. package/dist/src/browser/runtime/local-cloak/actions.js +25 -10
  35. package/dist/src/browser/runtime/local-cloak/session-manager.d.ts +3 -0
  36. package/dist/src/browser/runtime/local-cloak/session-manager.js +15 -2
  37. package/dist/src/browser/runtime/local-cloak/session-manager.test.js +145 -0
  38. package/dist/src/build-manifest.js +1 -0
  39. package/dist/src/build-manifest.test.js +34 -0
  40. package/dist/src/cli.js +133 -45
  41. package/dist/src/cli.test.js +2 -2
  42. package/dist/src/commands/daemon.test.js +13 -13
  43. package/dist/src/constants.d.ts +2 -3
  44. package/dist/src/constants.js +3 -10
  45. package/dist/src/daemon.js +1 -5
  46. package/dist/src/discovery.js +1 -0
  47. package/dist/src/doctor.js +12 -0
  48. package/dist/src/doctor.test.js +30 -3
  49. package/dist/src/engine.test.js +62 -0
  50. package/dist/src/execution.js +5 -3
  51. package/dist/src/external.js +19 -1
  52. package/dist/src/external.test.js +37 -1
  53. package/dist/src/main.js +0 -5
  54. package/dist/src/manifest-types.d.ts +2 -0
  55. package/dist/src/node-network.test.js +3 -3
  56. package/dist/src/registry.d.ts +10 -0
  57. package/dist/src/registry.js +5 -3
  58. package/dist/src/registry.test.js +25 -0
  59. package/dist/src/runtime-identity.test.js +0 -8
  60. package/dist/src/runtime.d.ts +4 -0
  61. package/dist/src/runtime.js +2 -0
  62. package/dist/src/skills.d.ts +23 -5
  63. package/dist/src/skills.js +87 -45
  64. package/dist/src/skills.test.js +80 -23
  65. package/package.json +3 -3
  66. package/skills/smart-search/SKILL.md +156 -0
  67. package/skills/smart-search/references/sources-ai.md +74 -0
  68. package/skills/smart-search/references/sources-info.md +43 -0
  69. package/skills/smart-search/references/sources-media.md +40 -0
  70. package/skills/smart-search/references/sources-other.md +32 -0
  71. package/skills/smart-search/references/sources-shopping.md +21 -0
  72. package/skills/smart-search/references/sources-social.md +36 -0
  73. package/skills/smart-search/references/sources-tech.md +38 -0
  74. package/skills/smart-search/references/sources-travel.md +26 -0
  75. package/skills/webcmd-adapter-author/SKILL.md +1 -0
  76. package/skills/webcmd-adapter-author/references/adapter-template.md +2 -0
  77. package/skills/webcmd-autofix/SKILL.md +8 -0
  78. package/skills/webcmd-sitemap-author/SKILL.md +1 -1
@@ -0,0 +1,32 @@
1
+ # Other Vertical Sources
2
+
3
+ Use for jobs, finance, books, dictionaries, and other cases that do not fit the earlier categories.
4
+
5
+ ## Sites
6
+
7
+ ### linkedin
8
+
9
+ - Use for: global jobs, English-language job listings, and multinational-company hiring
10
+ - Before use, run: `webcmd linkedin -h`
11
+
12
+ ### yahoo
13
+
14
+ - Use for: finance, market data, stock quotes, and company finance pages
15
+ - Before use, run: `webcmd yahoo -h`
16
+
17
+ ### github
18
+
19
+ - Use for: open-source project discovery, repository signals, issues, pull requests, and releases
20
+ - Before use, run: `webcmd github -h`
21
+
22
+ ### dictionary
23
+
24
+ - Use for: English word meanings and basic dictionary lookup
25
+ - Before use, run: `webcmd dictionary -h`
26
+
27
+ ## Routing Hints
28
+
29
+ - For jobs, prefer `linkedin`
30
+ - For finance and market data, prefer `yahoo`
31
+ - For open-source project signals, prefer `github`
32
+ - For English word definitions, prefer `dictionary`
@@ -0,0 +1,21 @@
1
+ # Shopping
2
+
3
+ Use for product search, prices, deals, reputation, and regional e-commerce results.
4
+
5
+ ## Sites
6
+
7
+ ### amazon
8
+
9
+ - Use for: global product search, price references, and English-language e-commerce
10
+ - Before use, run: `webcmd amazon -h`
11
+
12
+ ### coupang
13
+
14
+ - Use for: Korean e-commerce product search
15
+ - Before use, run: `webcmd coupang -h`
16
+
17
+ ## Routing Hints
18
+
19
+ - If the user names a platform, use that platform directly
20
+ - If no platform is named, prefer `amazon` for global products and `coupang` for Korean e-commerce
21
+ - If product research starts with an AI source, add an e-commerce site afterward for actual product results
@@ -0,0 +1,36 @@
1
+ # Social Media
2
+
3
+ Use when raw posts, raw user results, or community discussions are needed.
4
+
5
+ ## Sites
6
+
7
+ ### twitter
8
+
9
+ - Use for: Twitter/X posts, authors, real-time discussion, and public reactions
10
+ - Before use, run: `webcmd twitter -h`
11
+
12
+ ### reddit
13
+
14
+ - Use for: community Q&A, experience posts, recommendations, comparisons, and subreddit discussions
15
+ - Before use, run: `webcmd reddit -h`
16
+
17
+ ### instagram
18
+
19
+ - Use for: account search, image-first social signals, creators, and profile clues
20
+ - Before use, run: `webcmd instagram -h`
21
+
22
+ ### facebook
23
+
24
+ - Use for: pages, people, post clues, and public social presence
25
+ - Before use, run: `webcmd facebook -h`
26
+
27
+ ### bluesky
28
+
29
+ - Use for: Bluesky users and account search
30
+ - Before use, run: `webcmd bluesky -h`
31
+
32
+ ## Routing Hints
33
+
34
+ - If the user explicitly names a platform, use that platform directly
35
+ - If the user only asks what people are saying on social media, start with `grok`
36
+ - If an AI answer only summarizes and does not provide raw posts, switch to the relevant social site
@@ -0,0 +1,38 @@
1
+ # Technology And Research
2
+
3
+ Use for technical questions, research papers, developer discussion, and open-source community information.
4
+
5
+ ## Sites
6
+
7
+ ### arxiv
8
+
9
+ - Use for: papers, research, models, algorithms, and academic background
10
+ - Before use, run: `webcmd arxiv -h`
11
+
12
+ ### stackoverflow
13
+
14
+ - Use for: specific errors, API usage, code patterns, and implementation details
15
+ - Before use, run: `webcmd stackoverflow -h`
16
+
17
+ ### hackernews
18
+
19
+ - Use for: technical community discussion, developer opinions, startup topics, and product discussion
20
+ - Before use, run: `webcmd hackernews -h`
21
+
22
+ ### reddit
23
+
24
+ - Use for: community Q&A, experience posts, recommendations, and comparison discussions
25
+ - Before use, run: `webcmd reddit -h`
26
+
27
+ ### github
28
+
29
+ - Use for: repositories, issues, pull requests, releases, code search, and open-source project signals
30
+ - Before use, run: `webcmd github -h`
31
+
32
+ ## Routing Hints
33
+
34
+ - If the user explicitly asks for papers or research, prefer `arxiv`
35
+ - If the user asks about an error or API usage, prefer `stackoverflow`
36
+ - If the user wants community discussion or developer viewpoints, prefer `hackernews` or `reddit`
37
+ - If the user wants open-source project evidence, prefer `github`
38
+ - If the user did not name a site, start with `gemini` or `grok`, then add these specialized sources when needed
@@ -0,0 +1,26 @@
1
+ # Travel
2
+
3
+ Use for destinations, attractions, hotel ideas, and travel leads.
4
+
5
+ ## Sites
6
+
7
+ ### google
8
+
9
+ - Use for: broad destination, attraction, hotel, and itinerary discovery across the web
10
+ - Before use, run: `webcmd google -h`
11
+
12
+ ### reddit
13
+
14
+ - Use for: traveler experiences, local tips, itinerary comparisons, and community recommendations
15
+ - Before use, run: `webcmd reddit -h`
16
+
17
+ ### youtube
18
+
19
+ - Use for: destination walkthroughs, hotel reviews, travel vlogs, and visual checks
20
+ - Before use, run: `webcmd youtube -h`
21
+
22
+ ## Routing Hints
23
+
24
+ - If the user names a specific travel platform and it exists in the live registry, use that platform directly
25
+ - If the user only asks about travel, destinations, attractions, or hotels, start with `google`
26
+ - Add `reddit` for traveler experience and `youtube` for visual inspection
@@ -244,6 +244,7 @@ Check these off step by step:
244
244
  - **Intermediate parsing object keys must not overlap any `columns` entry.** Otherwise silent-column-drop audits can misread the adapter. Use dedicated internal names and destructure with aliases when pushing rows.
245
245
  - **The `browser:` field determines the `func` signature:** `browser:false -> (args)`, `browser:true -> (page, args)`. If this is reversed, `args` may actually be a debug flag and all external parameters can silently fall back to defaults.
246
246
  - Throw the correct typed error for known failures according to [`references/typed-errors.md`](./references/typed-errors.md). **Do not** silently `return []`, **do not** silently `return [{sentinel}]`, and **do not** silently clamp external parameters with `Math.max/min`.
247
+ - **Persistent sessions keep stale DOM between commands.** `siteSession: 'persistent'` shares one tab per site; leftover modals/drawers from the previous command leak into the next one. State-sensitive write commands (checkout flows) should add `freshPage: true` (new tab, same lease — cookies/login/location survive). Verify session-scoped context (login, selected city/date) *before* side effects, and embed such context in URLs/IDs your command emits for sibling commands. See `references/adapter-template.md` and "Persistent Sessions and State Hygiene" in `docs/authoring.mdx`.
247
248
  - For private adapters, write `~/.webcmd/clis/<site>/<name>.js` to avoid a build. Copy to `clis/<site>/<name>.js` only when preparing a PR.
248
249
  - Write site memory every round: no memory -> use skill -> produce memory -> next time becomes a five-minute task.
249
250
  - **Raw dumps, packet captures, and HTML samples from debugging may only be written to `~/.webcmd/sites/<site>/fixtures/` or `/tmp/`. Never leave `.dbg-*.html`, `raw-*.json`, `sample.*`, or similar temporary files in the repo root, `clis/<site>/`, or the current working directory.**
@@ -112,6 +112,8 @@ Rules:
112
112
  | `args` | Include type, default, and help for every external parameter. |
113
113
  | `columns` | Must exactly match row keys, including order. |
114
114
  | `pipeline` or `func` | Use the style already established by nearby adapters. |
115
+ | `siteSession` | `'persistent'` shares one tab per site across commands (multi-step flows); `'ephemeral'` gets a fresh isolated tab per run. Persistent tabs keep leftover DOM (modals, drawers) between commands — see "Persistent Sessions and State Hygiene" in docs/authoring.mdx. |
116
+ | `freshPage` | With `siteSession: 'persistent'`, set `true` to start the command on a newly created tab under the same lease: profile state (cookies, login, location) survives, stale DOM does not. Recommended for state-sensitive write commands such as checkout flows. |
115
117
 
116
118
  ## Strategy Enum Examples
117
119
 
@@ -53,6 +53,14 @@ Use this skill when `webcmd <site> <command>` fails with repairable errors:
53
53
 
54
54
  Proceed only when the empty or missing-selector result is reproducible across retries and alternative entry points.
55
55
 
56
+ ## Before Repair: An Error Modal Is Not Always the Site's Verdict
57
+
58
+ Persistent-session adapters (`siteSession: 'persistent'`) share one tab per site, so error text in the body may be inherited or context-scoped rather than real. Before patching code:
59
+
60
+ - Check the trace screenshot and `location.href`: a modal over a blank page or the wrong URL means the tab carried stale DOM from a previous command, not that the site rejected this request.
61
+ - Check session-scoped context: sites often scope results to a selected city, date, or account. A "closed" / "unavailable" verdict can simply mean the browser's selected context does not match the request (for example, a seat layout opened while the site's location cookie points at another city).
62
+ - Reproduce in a clean tab (`webcmd browser open <url>`) before trusting the verdict. If it only fails in the adapter's persistent tab, fix state handling (`freshPage: true`, dismiss-and-renavigate, context preconditions) instead of selectors.
63
+
56
64
  ## Step 1: Collect Trace Context
57
65
 
58
66
  Run the failing command with retained trace:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: webcmd-sitemap-author
3
- description: Use when creating or maintaining Webcmd site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.
3
+ description: 'Use when creating or maintaining Webcmd site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.'
4
4
  allowed-tools: Bash(webcmd:*), Read, Edit, Write, Grep
5
5
  ---
6
6