@bsbofmusic/cdper-doubao 1.0.5 → 1.1.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # cdper-doubao
2
2
 
3
- Standalone Doubao CLI for controlling the user's real Chrome/Edge through CDP Bridge.
3
+ Standalone Doubao workflow CLI for the user's real logged-in Chrome over CDP. It is not a general browser automation framework; use official `playwright-core` directly for arbitrary page control after Chrome is available.
4
4
 
5
5
  ## Install
6
6
 
@@ -12,8 +12,7 @@ Requirements:
12
12
 
13
13
  - Node.js 18+
14
14
  - A real Chrome/Edge profile with Doubao logged in
15
- - Either local Chrome DevTools on `127.0.0.1:9222` or a remote CDP Bridge
16
- - Optional explicit CDP WS through `CDP_WS`, `~/.cdp-auth.json`, or `~/.cdp-bridge/config.json`
15
+ - Local Chrome DevTools on `127.0.0.1:9222` from your launcher/bridge; `CDP_WS` remains an optional explicit override
17
16
 
18
17
  ## Use
19
18
 
@@ -67,4 +66,4 @@ Design note: Doubao link reading is more reliable when URLs are included in the
67
66
  ---
68
67
  ## Security
69
68
 
70
- All browser control happens through the user's real browser via local CDP or CDP Bridge. Tokens are redacted from diagnostic output. Do not commit `CDP_WS` or full WebSocket URLs containing `token=`.
69
+ All Doubao workflow control happens through the user's real browser via local CDP. Tokens are redacted from diagnostic output. Do not commit `CDP_WS` or full WebSocket URLs containing `token=`. For arbitrary page automation, use `playwright-core` directly instead of expanding cdper's product surface.
package/package.json CHANGED
@@ -1,12 +1,21 @@
1
1
  {
2
2
  "name": "@bsbofmusic/cdper-doubao",
3
- "version": "1.0.5",
3
+ "version": "1.1.1",
4
4
  "description": "Standalone Doubao CLI controlled through a user's real Chrome/Edge via CDP Bridge",
5
5
  "type": "commonjs",
6
6
  "main": "src/public-api.js",
7
+ "types": "src/public-api.d.ts",
7
8
  "exports": {
8
- ".": "./src/public-api.js",
9
- "./api": "./src/public-api.js"
9
+ ".": {
10
+ "types": "./src/public-api.d.ts",
11
+ "require": "./src/public-api.js",
12
+ "default": "./src/public-api.js"
13
+ },
14
+ "./api": {
15
+ "types": "./src/public-api.d.ts",
16
+ "require": "./src/public-api.js",
17
+ "default": "./src/public-api.js"
18
+ }
10
19
  },
11
20
  "bin": {
12
21
  "cdper-doubao": "bin/cdper-doubao.cjs"
@@ -39,7 +48,7 @@
39
48
  "node": ">=18.0.0"
40
49
  },
41
50
  "dependencies": {
42
- "@bsbofmusic/cdper-core": "~1.2.8",
51
+ "@bsbofmusic/cdper-core": "~1.3.2",
43
52
  "yargs": "^17.7.2"
44
53
  }
45
54
  }
package/src/cli.js CHANGED
@@ -26,6 +26,7 @@ function parseQueryOptions(argv) {
26
26
  maxWaitMs: argv.maxWaitMs ?? argv.maxWait,
27
27
  progressEveryMs: argv.progressEveryMs,
28
28
  maxExtends: argv.maxExtends,
29
+ driver: argv.driver,
29
30
  };
30
31
  }
31
32
 
@@ -105,6 +106,7 @@ function addQueryOptions(cmd) {
105
106
  .option('max-wait', { type: 'number', describe: 'Alias for --max-wait-ms' })
106
107
  .option('progress-every-ms', { type: 'number', describe: 'Progress snapshot interval' })
107
108
  .option('max-extends', { type: 'number', describe: 'Max 60s wait extensions' })
109
+ .option('driver', { choices: ['puppeteer', 'playwright'], describe: 'Browser driver (default: CDPER_DRIVER or playwright)' })
108
110
  .option('check', { type: 'boolean', default: true, describe: 'Run environment pre-check before query' })
109
111
  .option('quiet', { alias: 'q', type: 'boolean', describe: 'Quiet logs' })
110
112
  .option('debug', { alias: 'd', type: 'boolean', describe: 'Debug logs' });
package/src/doubao.js CHANGED
@@ -579,6 +579,7 @@ async function queryDoubao(queryText, opts = {}) {
579
579
  profile: 'Default',
580
580
  forceNewPage: wantsFreshPage,
581
581
  waitMs: randomInt(800, 1600),
582
+ driver: opts.driver,
582
583
  });
583
584
  page = connected.page;
584
585
  browser = connected.browser;
@@ -0,0 +1,13 @@
1
+ import type { QueryOptions, QueryResult } from '@bsbofmusic/cdper-core/types';
2
+
3
+ declare const manifest: unknown;
4
+
5
+ declare function getCapabilities(): Array<{
6
+ id: string;
7
+ version: string;
8
+ summary: string;
9
+ }>;
10
+
11
+ declare function queryDoubao(text: string, options?: QueryOptions): Promise<QueryResult>;
12
+
13
+ export { manifest, getCapabilities, queryDoubao };