@docyrus/docyrus 0.0.56 → 0.0.57
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/main.js +132 -70
- package/main.js.map +3 -3
- package/package.json +3 -3
- package/resources/browser-tools/browser-connect.js +172 -0
- package/resources/{chrome-tools → browser-tools}/browser-content.js +10 -14
- package/resources/browser-tools/browser-cookies.js +22 -0
- package/resources/browser-tools/browser-eval.js +34 -0
- package/resources/{chrome-tools → browser-tools}/browser-nav.js +8 -14
- package/resources/{chrome-tools → browser-tools}/browser-pick.js +7 -26
- package/resources/browser-tools/browser-run-script.js +53 -0
- package/resources/{chrome-tools → browser-tools}/browser-screenshot.js +8 -14
- package/resources/{chrome-tools → browser-tools}/browser-start.js +21 -4
- package/resources/pi-agent/extensions/docyrus-web-browser.ts +5 -5
- package/resources/pi-agent/shared/docyrusWebBrowserProtocol.ts +1 -1
- package/resources/pi-agent/skills/docyrus-chrome-devtools-cli/SKILL.md +41 -24
- package/resources/pi-agent/skills/docyrus-platform/references/docyrus-cli-usage.md +16 -14
- package/server-loader.js +21 -21
- package/server-loader.js.map +2 -2
- package/resources/chrome-tools/browser-cookies.js +0 -35
- package/resources/chrome-tools/browser-eval.js +0 -53
- package/resources/chrome-tools/browser-hn-scraper.js +0 -99
|
@@ -1,67 +1,82 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: docyrus-
|
|
3
|
-
description: Use Docyrus CLI
|
|
2
|
+
name: docyrus-browser-cli
|
|
3
|
+
description: Use Docyrus CLI browser commands for browser automation (local Chrome or remote Cloudflare Browser Rendering). Use when you need to start a browser session, navigate pages, inspect DOM state, evaluate JavaScript, capture screenshots, pick elements interactively, inspect cookies, extract readable page content, or run CDP scripts.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Docyrus
|
|
6
|
+
# Docyrus Browser CLI
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Browser automation commands exposed through the `docyrus` CLI. Works in both local mode (Chrome on `:9222`) and remote sandbox mode (Cloudflare Browser Rendering via WSS).
|
|
9
|
+
|
|
10
|
+
All commands return JSON with a `mode` field (`"local"` or `"remote"`). In remote mode, responses include `devtoolsFrontendUrl` for live DevTools access.
|
|
9
11
|
|
|
10
12
|
## Commands
|
|
11
13
|
|
|
12
|
-
Start
|
|
14
|
+
Start a browser session:
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
|
-
docyrus
|
|
16
|
-
docyrus
|
|
17
|
+
docyrus browser start
|
|
18
|
+
docyrus browser start --profile
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
- `--profile` copies the user's default Chrome profile
|
|
21
|
+
- Local mode: launches Chrome with remote debugging on `:9222`. `--profile` copies the user's default Chrome profile.
|
|
22
|
+
- Sandbox mode: creates a Cloudflare Browser Rendering session and opens the app preview URL.
|
|
20
23
|
|
|
21
24
|
Navigate tabs:
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
|
-
docyrus
|
|
25
|
-
docyrus
|
|
26
|
-
docyrus
|
|
27
|
+
docyrus browser nav https://example.com
|
|
28
|
+
docyrus browser nav https://example.com --new
|
|
29
|
+
docyrus browser nav https://example.com --reload
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
Run JavaScript in the active tab:
|
|
30
33
|
|
|
31
34
|
```bash
|
|
32
|
-
docyrus
|
|
33
|
-
docyrus
|
|
35
|
+
docyrus browser eval 'document.title'
|
|
36
|
+
docyrus browser eval 'document.querySelectorAll("a").length'
|
|
34
37
|
```
|
|
35
38
|
|
|
36
39
|
Capture a screenshot of the active tab:
|
|
37
40
|
|
|
38
41
|
```bash
|
|
39
|
-
docyrus
|
|
42
|
+
docyrus browser screenshot
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
Interactively pick DOM elements in the visible browser:
|
|
43
46
|
|
|
44
47
|
```bash
|
|
45
|
-
docyrus
|
|
48
|
+
docyrus browser pick "Click the submit button"
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
Inspect cookies for the active tab:
|
|
49
52
|
|
|
50
53
|
```bash
|
|
51
|
-
docyrus
|
|
54
|
+
docyrus browser cookies
|
|
52
55
|
```
|
|
53
56
|
|
|
54
57
|
Extract readable content as markdown:
|
|
55
58
|
|
|
56
59
|
```bash
|
|
57
|
-
docyrus
|
|
60
|
+
docyrus browser content https://example.com
|
|
58
61
|
```
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
Run a CDP script on the active browser session:
|
|
61
64
|
|
|
62
65
|
```bash
|
|
63
|
-
docyrus
|
|
64
|
-
docyrus
|
|
66
|
+
docyrus browser run-script my-script.js
|
|
67
|
+
docyrus browser run-script my-script.js --appId <appId>
|
|
68
|
+
docyrus browser run-script my-script.js --appSlug my-app
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- The script receives `browser` (Puppeteer Browser) and `page` (a new Page) as function arguments.
|
|
72
|
+
- Whatever the script returns is printed as JSON to stdout.
|
|
73
|
+
|
|
74
|
+
Example script (`scrape-title.js`):
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
await page.goto("https://example.com");
|
|
78
|
+
const title = await page.title();
|
|
79
|
+
return { title };
|
|
65
80
|
```
|
|
66
81
|
|
|
67
82
|
## When To Use
|
|
@@ -71,10 +86,12 @@ docyrus chrome hn-scraper --limit 10
|
|
|
71
86
|
- You need to inspect DOM state without guessing selectors.
|
|
72
87
|
- You want the user to click elements directly through an interactive picker.
|
|
73
88
|
- You need quick page extraction or screenshot capture from a real browser session.
|
|
89
|
+
- You need to run CDP scripts against a remote headless browser from within a sandbox.
|
|
74
90
|
|
|
75
91
|
## Working Style
|
|
76
92
|
|
|
77
|
-
- Start
|
|
78
|
-
- Prefer `docyrus
|
|
79
|
-
- Use `docyrus
|
|
80
|
-
- Use `docyrus
|
|
93
|
+
- Start a session first with `docyrus browser start` if the browser is not already available.
|
|
94
|
+
- Prefer `docyrus browser eval` for DOM inspection and structured page state.
|
|
95
|
+
- Use `docyrus browser pick` when element targeting is ambiguous or user choice matters.
|
|
96
|
+
- Use `docyrus browser content` for readable markdown extraction from article-like pages.
|
|
97
|
+
- Use `docyrus browser run-script` to run full Puppeteer scripts on the active browser session.
|
|
@@ -108,19 +108,19 @@ Send a prompt to a Docyrus AI agent.
|
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
|
111
|
-
##
|
|
111
|
+
## browser — Browser Automation
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Browser automation commands (local Chrome or remote Cloudflare Browser Rendering). All commands return JSON with a `mode` field (`"local"` or `"remote"`).
|
|
114
114
|
|
|
115
|
-
### `docyrus
|
|
115
|
+
### `docyrus browser start`
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
Start a browser session. Local mode launches Chrome on `:9222`. Sandbox mode creates a Cloudflare session.
|
|
118
118
|
|
|
119
119
|
| Option | Type | Description |
|
|
120
120
|
|---|---|---|
|
|
121
|
-
| `--profile` | boolean | Copy the default Chrome profile
|
|
121
|
+
| `--profile` | boolean | Copy the default Chrome profile (local mode only) |
|
|
122
122
|
|
|
123
|
-
### `docyrus
|
|
123
|
+
### `docyrus browser nav <url>`
|
|
124
124
|
|
|
125
125
|
Navigate the active tab or open the URL in a new tab.
|
|
126
126
|
|
|
@@ -129,33 +129,35 @@ Navigate the active tab or open the URL in a new tab.
|
|
|
129
129
|
| `--new` | boolean | Open the URL in a new tab |
|
|
130
130
|
| `--reload` | boolean | Force a reload after navigation |
|
|
131
131
|
|
|
132
|
-
### `docyrus
|
|
132
|
+
### `docyrus browser eval <code>`
|
|
133
133
|
|
|
134
134
|
Execute JavaScript in the active tab and print the result.
|
|
135
135
|
|
|
136
|
-
### `docyrus
|
|
136
|
+
### `docyrus browser screenshot`
|
|
137
137
|
|
|
138
138
|
Capture the current viewport and return the temporary screenshot file path.
|
|
139
139
|
|
|
140
|
-
### `docyrus
|
|
140
|
+
### `docyrus browser pick <message>`
|
|
141
141
|
|
|
142
142
|
Open an interactive element picker in the active tab and return information about the selected element or elements.
|
|
143
143
|
|
|
144
|
-
### `docyrus
|
|
144
|
+
### `docyrus browser cookies`
|
|
145
145
|
|
|
146
146
|
Print cookies for the active tab, including domain, path, `httpOnly`, and `secure` flags.
|
|
147
147
|
|
|
148
|
-
### `docyrus
|
|
148
|
+
### `docyrus browser content <url>`
|
|
149
149
|
|
|
150
150
|
Navigate to a URL and extract readable content as markdown.
|
|
151
151
|
|
|
152
|
-
### `docyrus
|
|
152
|
+
### `docyrus browser run-script <script>`
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
Run a CDP script file on the active browser session.
|
|
155
155
|
|
|
156
156
|
| Option | Type | Description |
|
|
157
157
|
|---|---|---|
|
|
158
|
-
| `--
|
|
158
|
+
| `--appId` | string | App ID for browser session resolution |
|
|
159
|
+
| `--appSlug` | string | App slug for browser session resolution |
|
|
160
|
+
| `--keepAlive` | number | Session keep-alive in milliseconds |
|
|
159
161
|
|
|
160
162
|
---
|
|
161
163
|
|
package/server-loader.js
CHANGED
|
@@ -17984,7 +17984,7 @@ var require_websocket_server = __commonJS({
|
|
|
17984
17984
|
}
|
|
17985
17985
|
});
|
|
17986
17986
|
|
|
17987
|
-
// ../../node_modules/.pnpm/@hono+node-server@1.19.13_hono@4.12.
|
|
17987
|
+
// ../../node_modules/.pnpm/@hono+node-server@1.19.13_hono@4.12.14/node_modules/@hono/node-server/dist/index.mjs
|
|
17988
17988
|
var dist_exports = {};
|
|
17989
17989
|
__export(dist_exports, {
|
|
17990
17990
|
RequestError: () => RequestError,
|
|
@@ -18039,7 +18039,7 @@ function writeFromReadableStream(stream, writable) {
|
|
|
18039
18039
|
}
|
|
18040
18040
|
var import_http, import_http2, import_http22, import_stream2, import_crypto, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, incomingDraining, DRAIN_TIMEOUT_MS, MAX_DRAIN_BYTES, drainIncoming, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, createAdaptorServer, serve;
|
|
18041
18041
|
var init_dist = __esm({
|
|
18042
|
-
"../../node_modules/.pnpm/@hono+node-server@1.19.13_hono@4.12.
|
|
18042
|
+
"../../node_modules/.pnpm/@hono+node-server@1.19.13_hono@4.12.14/node_modules/@hono/node-server/dist/index.mjs"() {
|
|
18043
18043
|
"use strict";
|
|
18044
18044
|
import_http = require("http");
|
|
18045
18045
|
import_http2 = require("http2");
|
|
@@ -33177,7 +33177,7 @@ var EnvironmentConfigService = class {
|
|
|
33177
33177
|
}
|
|
33178
33178
|
};
|
|
33179
33179
|
|
|
33180
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33180
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/compose.js
|
|
33181
33181
|
var compose = (middleware, onError, onNotFound) => {
|
|
33182
33182
|
return (context, next) => {
|
|
33183
33183
|
let index2 = -1;
|
|
@@ -33221,10 +33221,10 @@ var compose = (middleware, onError, onNotFound) => {
|
|
|
33221
33221
|
};
|
|
33222
33222
|
};
|
|
33223
33223
|
|
|
33224
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33224
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/request/constants.js
|
|
33225
33225
|
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
33226
33226
|
|
|
33227
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33227
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/body.js
|
|
33228
33228
|
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
33229
33229
|
const { all: all2 = false, dot = false } = options;
|
|
33230
33230
|
const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
|
|
@@ -33296,7 +33296,7 @@ var handleParsingNestedValues = (form, key, value2) => {
|
|
|
33296
33296
|
});
|
|
33297
33297
|
};
|
|
33298
33298
|
|
|
33299
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33299
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/url.js
|
|
33300
33300
|
var splitPath = (path6) => {
|
|
33301
33301
|
const paths = path6.split("/");
|
|
33302
33302
|
if (paths[0] === "") {
|
|
@@ -33500,7 +33500,7 @@ var getQueryParams = (url2, key) => {
|
|
|
33500
33500
|
};
|
|
33501
33501
|
var decodeURIComponent_ = decodeURIComponent;
|
|
33502
33502
|
|
|
33503
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33503
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/request.js
|
|
33504
33504
|
var tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
|
|
33505
33505
|
var HonoRequest = class {
|
|
33506
33506
|
/**
|
|
@@ -33768,7 +33768,7 @@ var HonoRequest = class {
|
|
|
33768
33768
|
}
|
|
33769
33769
|
};
|
|
33770
33770
|
|
|
33771
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33771
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/html.js
|
|
33772
33772
|
var HtmlEscapedCallbackPhase = {
|
|
33773
33773
|
Stringify: 1,
|
|
33774
33774
|
BeforeStream: 2,
|
|
@@ -33810,7 +33810,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
33810
33810
|
}
|
|
33811
33811
|
};
|
|
33812
33812
|
|
|
33813
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
33813
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/context.js
|
|
33814
33814
|
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
33815
33815
|
var setDefaultContentType = (contentType, headers) => {
|
|
33816
33816
|
return {
|
|
@@ -34217,7 +34217,7 @@ var Context = class {
|
|
|
34217
34217
|
};
|
|
34218
34218
|
};
|
|
34219
34219
|
|
|
34220
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34220
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router.js
|
|
34221
34221
|
var METHOD_NAME_ALL = "ALL";
|
|
34222
34222
|
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
34223
34223
|
var METHODS = ["get", "post", "put", "delete", "options", "patch"];
|
|
@@ -34225,10 +34225,10 @@ var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is
|
|
|
34225
34225
|
var UnsupportedPathError = class extends Error {
|
|
34226
34226
|
};
|
|
34227
34227
|
|
|
34228
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34228
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/utils/constants.js
|
|
34229
34229
|
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
34230
34230
|
|
|
34231
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34231
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/hono-base.js
|
|
34232
34232
|
var notFoundHandler = (c) => {
|
|
34233
34233
|
return c.text("404 Not Found", 404);
|
|
34234
34234
|
};
|
|
@@ -34599,7 +34599,7 @@ var Hono = class _Hono {
|
|
|
34599
34599
|
};
|
|
34600
34600
|
};
|
|
34601
34601
|
|
|
34602
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34602
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
34603
34603
|
var emptyParam = [];
|
|
34604
34604
|
function match(method, path6) {
|
|
34605
34605
|
const matchers = this.buildAllMatchers();
|
|
@@ -34620,7 +34620,7 @@ function match(method, path6) {
|
|
|
34620
34620
|
return match2(method, path6);
|
|
34621
34621
|
}
|
|
34622
34622
|
|
|
34623
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34623
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/node.js
|
|
34624
34624
|
var LABEL_REG_EXP_STR = "[^/]+";
|
|
34625
34625
|
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
34626
34626
|
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
@@ -34728,7 +34728,7 @@ var Node = class _Node {
|
|
|
34728
34728
|
}
|
|
34729
34729
|
};
|
|
34730
34730
|
|
|
34731
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34731
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
34732
34732
|
var Trie = class {
|
|
34733
34733
|
#context = { varIndex: 0 };
|
|
34734
34734
|
#root = new Node();
|
|
@@ -34784,7 +34784,7 @@ var Trie = class {
|
|
|
34784
34784
|
}
|
|
34785
34785
|
};
|
|
34786
34786
|
|
|
34787
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34787
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/reg-exp-router/router.js
|
|
34788
34788
|
var nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
|
|
34789
34789
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
34790
34790
|
function buildWildcardRegExp(path6) {
|
|
@@ -34963,7 +34963,7 @@ var RegExpRouter = class {
|
|
|
34963
34963
|
}
|
|
34964
34964
|
};
|
|
34965
34965
|
|
|
34966
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
34966
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/smart-router/router.js
|
|
34967
34967
|
var SmartRouter = class {
|
|
34968
34968
|
name = "SmartRouter";
|
|
34969
34969
|
#routers = [];
|
|
@@ -35018,7 +35018,7 @@ var SmartRouter = class {
|
|
|
35018
35018
|
}
|
|
35019
35019
|
};
|
|
35020
35020
|
|
|
35021
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
35021
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/trie-router/node.js
|
|
35022
35022
|
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
35023
35023
|
var hasChildren = (children) => {
|
|
35024
35024
|
for (const _ in children) {
|
|
@@ -35193,7 +35193,7 @@ var Node2 = class _Node2 {
|
|
|
35193
35193
|
}
|
|
35194
35194
|
};
|
|
35195
35195
|
|
|
35196
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
35196
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/router/trie-router/router.js
|
|
35197
35197
|
var TrieRouter = class {
|
|
35198
35198
|
name = "TrieRouter";
|
|
35199
35199
|
#node;
|
|
@@ -35215,7 +35215,7 @@ var TrieRouter = class {
|
|
|
35215
35215
|
}
|
|
35216
35216
|
};
|
|
35217
35217
|
|
|
35218
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
35218
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/hono.js
|
|
35219
35219
|
var Hono2 = class extends Hono {
|
|
35220
35220
|
/**
|
|
35221
35221
|
* Creates an instance of the Hono class.
|
|
@@ -35230,7 +35230,7 @@ var Hono2 = class extends Hono {
|
|
|
35230
35230
|
}
|
|
35231
35231
|
};
|
|
35232
35232
|
|
|
35233
|
-
// ../../node_modules/.pnpm/hono@4.12.
|
|
35233
|
+
// ../../node_modules/.pnpm/hono@4.12.14/node_modules/hono/dist/middleware/cors/index.js
|
|
35234
35234
|
var cors = (options) => {
|
|
35235
35235
|
const defaults = {
|
|
35236
35236
|
origin: "*",
|