@agentrhq/webcmd 0.2.4 → 0.3.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.
Files changed (52) hide show
  1. package/README.md +2 -2
  2. package/clis/_shared/site-auth.js +3 -3
  3. package/clis/_shared/site-auth.test.js +4 -4
  4. package/clis/slock/whoami.test.js +2 -2
  5. package/dist/src/browser/daemon-client.d.ts +2 -1
  6. package/dist/src/browser/runtime/local-cloak/actions.js +4 -1
  7. package/dist/src/browser/runtime/local-cloak/provider.test.js +36 -0
  8. package/dist/src/browser/runtime/local-cloak/session-manager.d.ts +3 -2
  9. package/dist/src/browser/runtime/local-cloak/session-manager.js +4 -2
  10. package/dist/src/cli.js +5 -4
  11. package/dist/src/cli.test.js +11 -5
  12. package/dist/src/commands/auth.js +3 -2
  13. package/dist/src/commands/auth.test.js +6 -6
  14. package/dist/src/generate-release-notes-cli.test.js +5 -0
  15. package/dist/src/hosted/args.d.ts +9 -0
  16. package/dist/src/hosted/args.js +101 -0
  17. package/dist/src/hosted/args.test.d.ts +1 -0
  18. package/dist/src/hosted/args.test.js +35 -0
  19. package/dist/src/hosted/client.d.ts +30 -0
  20. package/dist/src/hosted/client.js +122 -0
  21. package/dist/src/hosted/client.test.d.ts +1 -0
  22. package/dist/src/hosted/client.test.js +119 -0
  23. package/dist/src/hosted/config.d.ts +50 -0
  24. package/dist/src/hosted/config.js +90 -0
  25. package/dist/src/hosted/config.test.d.ts +1 -0
  26. package/dist/src/hosted/config.test.js +48 -0
  27. package/dist/src/hosted/manifest.d.ts +9 -0
  28. package/dist/src/hosted/manifest.js +92 -0
  29. package/dist/src/hosted/manifest.test.d.ts +1 -0
  30. package/dist/src/hosted/manifest.test.js +46 -0
  31. package/dist/src/hosted/runner.d.ts +12 -0
  32. package/dist/src/hosted/runner.js +404 -0
  33. package/dist/src/hosted/runner.test.d.ts +1 -0
  34. package/dist/src/hosted/runner.test.js +189 -0
  35. package/dist/src/hosted/setup.d.ts +9 -0
  36. package/dist/src/hosted/setup.js +49 -0
  37. package/dist/src/hosted/setup.test.d.ts +1 -0
  38. package/dist/src/hosted/setup.test.js +68 -0
  39. package/dist/src/hosted/types.d.ts +97 -0
  40. package/dist/src/hosted/types.js +1 -0
  41. package/dist/src/main.js +14 -0
  42. package/dist/src/release-notes.d.ts +6 -1
  43. package/dist/src/release-notes.js +184 -4
  44. package/dist/src/release-notes.test.js +128 -1
  45. package/package.json +1 -1
  46. package/scripts/generate-release-notes.ts +1 -1
  47. package/skills/smart-search/SKILL.md +14 -3
  48. package/skills/webcmd-adapter-author/SKILL.md +2 -2
  49. package/skills/webcmd-adapter-author/references/adapter-template.md +25 -3
  50. package/skills/webcmd-autofix/SKILL.md +1 -1
  51. package/skills/webcmd-usage/SKILL.md +22 -9
  52. package/clis/antigravity/SKILL.md +0 -38
@@ -11,9 +11,19 @@ Route a query to the best webcmd search source based on the topic and context. T
11
11
 
12
12
  Before every use, do both of these steps:
13
13
 
14
- - Run `webcmd list -f yaml`
14
+ - Run `webcmd list -f json`
15
15
  - Use the live registry to confirm that candidate sites exist, and inspect `strategy`, `browser`, and `domain`
16
16
 
17
+ If the user explicitly names a site/source and it is missing from `webcmd list` or when none of the sites cover the query, check installable plugins before marking it unavailable:
18
+
19
+ ```bash
20
+ webcmd plugin search <site-or-source-or-capability> -f json
21
+ ```
22
+
23
+ Derive a short plugin query from the missing site or capability. Preserve the user's term when practical: `find flights` becomes `flight`.
24
+
25
+ If plugin search finds a match, tell the user it is available as a plugin and offer `webcmd plugin install <source>`. If plugin search fails because catalog sources cannot be fetched, report that catalog/search error separately from no plugin match.
26
+
17
27
  After choosing a site, do both of these steps:
18
28
 
19
29
  - Run `webcmd <site> -h` to see the site's subcommands
@@ -42,7 +52,7 @@ First create a site-call ledger. After each real search command, update it immed
42
52
 
43
53
  Counting rules:
44
54
 
45
- - `webcmd list -f yaml`, `webcmd <site> -h`, and `webcmd <site> <command> -h` are preflight/help commands and do not count as searches.
55
+ - `webcmd list -f json`, `webcmd plugin search <query> -f json`, `webcmd <site> -h`, and `webcmd <site> <command> -h` are preflight/help commands and do not count as searches.
46
56
  - One real `webcmd <site> ...` search/query execution counts as 1 call for that site.
47
57
  - A failed call caused by an error, timeout, CAPTCHA, anti-bot check, or broken login state still counts as 1 call for that site. Do not retry indefinitely.
48
58
 
@@ -134,9 +144,10 @@ Keep a typical query to 1 AI source plus 1-2 specialized sources to avoid result
134
144
  When a site is unavailable:
135
145
 
136
146
  - Do not stop the whole search because one source failed
147
+ - For a missing site or capability, run `webcmd plugin search <query> -f json` before recording unavailable
137
148
  - Record: `Skipped: <site> unavailable`
138
149
  - Fall back to another site of the same type, or to one AI source
139
- - Always trust the actual output of `webcmd list -f yaml` and `webcmd <site> -h`
150
+ - Always trust the actual output of `webcmd list -f json`, `webcmd plugin search -f json`, and `webcmd <site> -h`
140
151
 
141
152
  Do not assume any site is always available. Even for public sites, trust live help and execution results in the current environment.
142
153
 
@@ -28,7 +28,7 @@ Continue only when all three answers are yes.
28
28
 
29
29
  ## Top-Level Decision Tree
30
30
 
31
- **Choose the strategy before writing the adapter.** Every time you reach Step 3 or Step 4, and before writing code, produce a strategy note. Without that note, do not start `clis/<site>/<name>.js`.
31
+ **Choose the strategy before writing the adapter.** Every time you reach Step 3 or Step 4, and before writing code, produce a strategy note. Without that note, do not start an adapter file.
32
32
 
33
33
  The core question is not whether an API is more elegant than DOM work. The core question is whether the data source has an external contract. Public or official interfaces are usually the most stable. UI/DOM semantics often have a user-visible contract too. Undocumented in-site XHR, GraphQL, or signature endpoints drift the most. Do not move a stable UI/DOM implementation to an uncontracted internal endpoint just to be "API-first."
34
34
 
@@ -253,7 +253,7 @@ Check these off step by step:
253
253
  - **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.
254
254
  - 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`.
255
255
  - **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`.
256
- - For private adapters, write `~/.webcmd/clis/<site>/<name>.js` to avoid a build. Copy to `clis/<site>/<name>.js` only when preparing a PR.
256
+ - For private iteration, write `~/.webcmd/clis/<site>/<name>.js` to avoid a build. When the user says to promote a CLI, create a main-repo plugin with `webcmd plugin create <site> --dir plugins/<site>`, copy the real command files into it, delete scaffold sample commands, register it in root `webcmd-plugin.json`, remove the local `~/.webcmd/clis/<site>` shadow, install the plugin, then run `webcmd validate <site>` and smoke commands. See `references/adapter-template.md` for details.
257
257
  - Write site memory every round: no memory -> use skill -> produce memory -> next time becomes a five-minute task.
258
258
  - **After a site's first command passes verify, stop and ask the user for their use cases before recommending next set of commands.** See Runbook Step 13.
259
259
  - **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.**
@@ -16,10 +16,32 @@ Write the working file at:
16
16
  ~/.webcmd/clis/<site>/<name>.js
17
17
  ```
18
18
 
19
- Copy it to the repo only when preparing a PR:
19
+ Promote a community CLI to the main repo as a plugin:
20
20
 
21
- ```text
22
- clis/<site>/<name>.js
21
+ ```bash
22
+ webcmd plugin create <site> --dir plugins/<site> --description "<site> commands for Webcmd"
23
+ cp ~/.webcmd/clis/<site>/*.js plugins/<site>/
24
+ rm plugins/<site>/hello.ts plugins/<site>/greet.ts 2>/dev/null || true
25
+ ```
26
+
27
+ Then add `<site>` to the root `webcmd-plugin.json` `plugins` map:
28
+
29
+ ```json
30
+ "<site>": {
31
+ "path": "plugins/<site>",
32
+ "version": "0.1.0",
33
+ "description": "<site> commands for Webcmd",
34
+ "webcmd": ">=0.2.0"
35
+ }
36
+ ```
37
+
38
+ Before handing off, remove the private shadow and prove the plugin path works:
39
+
40
+ ```bash
41
+ rm -rf ~/.webcmd/clis/<site>
42
+ webcmd plugin install file://$PWD/plugins/<site>
43
+ webcmd validate <site>
44
+ webcmd <site> <command> --help
23
45
  ```
24
46
 
25
47
  ## Minimal Registry Shape
@@ -18,7 +18,7 @@ Hard stops before any code change:
18
18
 
19
19
  Scope constraint:
20
20
 
21
- - Modify only the file at `adapterSourcePath` in the trace `summary.md` front matter. That path is authoritative and may be `clis/<site>/...` in the repo or `~/.webcmd/clis/<site>/...` for user-local installs.
21
+ - Modify only the file at `adapterSourcePath` in the trace `summary.md` front matter. That path is authoritative and may be `clis/<site>/...` in the repo or `plugins/<site>/...` in a plugin repo or `~/.webcmd/clis/<site>/...` for user-local installs.
22
22
  - Never modify `src/`, `extension/`, `tests/`, `package.json`, or `tsconfig.json` during autofix.
23
23
 
24
24
  Retry budget: maximum **3 repair rounds** per failure. A round is diagnose -> patch -> retry. If 3 rounds do not resolve it, stop and report what was tried.
@@ -10,7 +10,7 @@ Webcmd turns websites, Electron desktop apps, and external CLIs into a uniform `
10
10
 
11
11
  ## The Three Pillars
12
12
 
13
- - **Adapter commands:** `webcmd <site> <command> [...]`. Built-in adapters live in `clis/`; user adapters live in `~/.webcmd/clis/`. Each command has a strategy such as `PUBLIC`, `COOKIE`, `INTERCEPT`, `UI`, or `LOCAL`.
13
+ - **Adapter commands:** `webcmd <site> <command> [...]`. Built-in adapters live in `clis/`; community adapters promoted to the main repo live as plugins under `plugins/`; private iteration adapters live in `~/.webcmd/clis/`. Each command has a strategy such as `PUBLIC`, `COOKIE`, `INTERCEPT`, `UI`, or `LOCAL`.
14
14
  - **Browser driving:** `webcmd browser *` subcommands (`open`, `state`, `click`, `type`, `select`, `find`, `extract`, `network`) for ad-hoc interaction when no adapter covers the task. See `webcmd-browser`.
15
15
  - **External CLI passthrough:** `webcmd gh`, `webcmd docker`, `webcmd vercel`, and similar wrappers. Manage them with `webcmd external install <name>` or `webcmd external register <name>`.
16
16
 
@@ -44,21 +44,25 @@ npx tsx src/main.ts <command>
44
44
 
45
45
  Electron desktop app adapters route through CDP against the running app. Make sure the app is open before invoking those commands.
46
46
 
47
- ## Discover Installed Commands
47
+ ## Discover Commands
48
48
 
49
49
  Run commands instead of reading static docs:
50
50
 
51
51
  ```bash
52
- webcmd list
52
+ webcmd
53
53
  webcmd list -f json
54
- webcmd list | grep -i github
55
54
  webcmd <site> --help
56
55
  webcmd <site> <command> --help
57
56
  ```
58
57
 
59
- Do not hard-code adapter lists. `webcmd list -f json` is the source of truth and emits one entry per command with fields such as `{site, name, aliases, description, strategy, browser, args, columns}`.
58
+ Run `webcmd` with no arguments to see all available functions and installed site adapters. Do not hard-code adapter lists: `webcmd list -f json` is the source of truth for installed commands and emits one entry per command with fields such as `{site, name, aliases, description, strategy, browser, args, columns}`.
60
59
 
61
- Before falling back to raw `webcmd browser` on high-change authenticated sites, check whether a site adapter already exposes the workflow.
60
+ Use this fallback order:
61
+
62
+ 1. Run `webcmd list -f json` once.
63
+ 2. Check that result against the whole requested workflow, not only a named site. If one installed command covers it, use that command and stop discovery.
64
+ 3. If none covers it, derive a short plugin query from the missing site or capability and run `webcmd plugin search <query> -f json`. Preserve the user's term when practical: `find flights` becomes `flight`.
65
+ 4. If plugin search returns a match, offer `webcmd plugin install <installSource>`. If it returns no match and no error, raw `webcmd browser` is allowed. If it errors, report plugin discovery as unavailable and stop. If `fetch failed` appears in `errors[].message`, report plugin discovery as unavailable due to network/reachability and ask the user whether to rerun with network/escalated permissions. Do not retry unless they approve.
62
66
 
63
67
  ## Universal Flags
64
68
 
@@ -102,10 +106,13 @@ The error envelope includes a `trace` block pointing at `summary.md`. Patch only
102
106
 
103
107
  ## Writing An Adapter
104
108
 
105
- Two storage paths:
109
+ Storage paths:
106
110
 
107
111
  - Private: `~/.webcmd/clis/<site>/<command>.js`
108
- - Public / PR: `clis/<site>/<command>.js`
112
+ - Public (official bundle): `clis/<site>/<command>.js`
113
+ - Public (community PRs): `plugins/<site>/` plus root `webcmd-plugin.json` registration
114
+
115
+ The main Webcmd repo is itself a plugin monorepo: promoted community CLIs belong under `plugins/<site>/` and must be registered in the root `webcmd-plugin.json`.
109
116
 
110
117
  Scaffolding and checks:
111
118
 
@@ -126,9 +133,15 @@ webcmd plugin list [-f json]
126
133
  webcmd plugin update [name] | --all
127
134
  webcmd plugin uninstall <name>
128
135
  webcmd plugin create <name>
136
+ webcmd plugin search [query] -f json
137
+ webcmd plugin catalog list -f json
138
+ webcmd plugin catalog add <source>
139
+ webcmd plugin catalog remove <id>
129
140
  ```
130
141
 
131
- Plugins are third-party extensions pulled from git and separate from the main adapter registry.
142
+ Plugins are installable extensions pulled from git or local paths. Use `plugin search` for marketplace discovery and `plugin list` for already-installed plugins. Main-repo community CLIs are exposed through the root plugin catalog manifest, not bundled into npm's `clis/` set.
143
+
144
+ > **Note:** The repository's `plugins/` directory is not shipped in the npm package. Find the required plugin with `webcmd plugin search`, then install its `installSource` with `webcmd plugin install <installSource>`.
132
145
 
133
146
  ## External CLI Passthrough
134
147
 
@@ -1,38 +0,0 @@
1
- ---
2
- description: How to automate Antigravity using Webcmd
3
- ---
4
-
5
- # Antigravity Automation Skill
6
-
7
- This skill allows AI agents to control the [Antigravity](https://github.com/chengazhen/Antigravity) desktop app (and any Electron app with CDP enabled) programmatically via Webcmd.
8
-
9
- ## Requirements
10
- webcmd automatically detects, launches (with `--remote-debugging-port=9234`), and connects to Antigravity.
11
- If Antigravity is already running without CDP, webcmd will prompt to restart it.
12
-
13
- If the endpoint exposes multiple inspectable targets, set:
14
- \`\`\`bash
15
- export WEBCMD_CDP_TARGET="antigravity"
16
- \`\`\`
17
-
18
- ## High-Level Capabilities
19
- 1. **Send Messages (`webcmd antigravity send <message>`)**: Type and send a message directly into the chat UI.
20
- 2. **Read History (`webcmd antigravity read`)**: Scrape the raw chat transcript from the main UI container.
21
- 3. **Extract Code (`webcmd antigravity extract-code`)**: Automatically isolate and extract source code text blocks from the AI's recent answers.
22
- 4. **Switch Models (`webcmd antigravity model <name>`)**: Instantly toggle the active LLM (e.g., \`gemini\`, \`claude\`).
23
- 5. **Clear Context (`webcmd antigravity new`)**: Start a fresh conversation.
24
-
25
- ## Examples for Automated Workflows
26
-
27
- ### Generating and Saving Code
28
- \`\`\`bash
29
- webcmd antigravity send "Write a python script to fetch HN top stories"
30
- # wait ~10-15 seconds for output to render
31
- webcmd antigravity extract-code > hn_fetcher.py
32
- \`\`\`
33
-
34
- ### Reading Real-time Logs
35
- Agents can run long-running streaming watch instances:
36
- \`\`\`bash
37
- webcmd antigravity watch
38
- \`\`\`