dsh-browser-cdp 0.17.23 → 0.18.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/lib/index.js CHANGED
@@ -1566,7 +1566,7 @@ function getAttachEndpoint() {
1566
1566
  /**
1567
1567
  * Stop a running worker so the next request respawns it with the new argv
1568
1568
  * seed (T2.4: an activation change must take effect on a live panel, not only
1569
- * after a host restart). Kills only the pid WE spawned (per our namespaced state file) —
1569
+ * after a host restart). Kills only the pid WE spawned (per ego-cast.json) —
1570
1570
  * never a name-matched sweep, which previously took out the DSH subprocess
1571
1571
  * runner along with our own tree (issues #34 defect 2 / #40).
1572
1572
  */
@@ -1627,7 +1627,7 @@ function castStatePath() {
1627
1627
  const isWin = process.platform === "win32";
1628
1628
  const home = e.HOME || e.USERPROFILE || (isWin ? e.LOCALAPPDATA || "" : "/root");
1629
1629
  const stateHome = e.EGO_LINUX_STATE_DIR || (isWin ? e.LOCALAPPDATA || `${home}\\AppData\\Local` : e.XDG_STATE_HOME || `${home}/.local/state`);
1630
- return stateHome.endsWith("ego-lite-linux") ? `${stateHome}/dsh-browser-cdp.cast.json` : `${stateHome}/ego-lite-linux/dsh-browser-cdp.cast.json`;
1630
+ return stateHome.endsWith("ego-lite-linux") ? `${stateHome}/ego-cast.json` : `${stateHome}/ego-lite-linux/ego-cast.json`;
1631
1631
  }
1632
1632
  function sendJson(res, status, body) {
1633
1633
  const payload = JSON.stringify(body);
@@ -2437,7 +2437,7 @@ const Config$1 = z.object({
2437
2437
  cdpProbeTimeoutMs: z.number().min(200).max(3e4).step(100).description("Timeout for one CDP endpoint probe (http endpoints answer /json/version)."),
2438
2438
  cursorHud: z.boolean().description("Draw the agent cursor HUD into screenshots."),
2439
2439
  cursorName: z.string().description("Name label shown in the cursor HUD."),
2440
- allowLocalFallback: z.boolean().description("auto mode may fall back to launching a local browser when the activated target is unreachable. Off by default: the fallback must be explicit.").volatile(),
2440
+ allowLocalFallback: z.boolean().description("auto mode may fall back to launching a local browser when the activated target is unreachable. Off by default: the fallback must be explicit."),
2441
2441
  legacyEgoToolNames: z.boolean().description("ALSO register the tools under their old ego_* names for scripts written before the bcdp_* rename. Off by default; mutually exclusive with installing the upstream ego-browser plugin (same tool names)."),
2442
2442
  localHeadless: z.boolean().description("Run the locally launched browser headless."),
2443
2443
  remoteEnabled: z.boolean().description("Master switch for REMOTE attach. Off = the configured target sequence is preserved but inert (nothing probes or connects remotely); flip back on any time. Does not affect cdpMode=local.").volatile(),
@@ -2740,7 +2740,7 @@ const API_PREFIX = "/bcdp/api";
2740
2740
  * when absent, `get` degrades to the entry source and `set` returns a
2741
2741
  * clear error.
2742
2742
  */
2743
- function registerEgoBrowserGateway(ctx, bridge, ffmpegManager, picks) {
2743
+ function registerEgoBrowserGateway(ctx, bridge, ffmpegManager) {
2744
2744
  ctx.effect?.(() => {
2745
2745
  const webServer = ctx.get?.("webServer");
2746
2746
  if (!webServer || typeof webServer.register !== "function") return;
@@ -2834,50 +2834,6 @@ function registerEgoBrowserGateway(ctx, bridge, ffmpegManager, picks) {
2834
2834
  return;
2835
2835
  }
2836
2836
  writeJson(res, 200, envelopeOk({ outcome: await probeEndpoint(endpoint, { timeoutMs: typeof body.timeoutMs === "number" && Number.isFinite(body.timeoutMs) ? body.timeoutMs : void 0 }) }));
2837
- } else if (method === "picks-save") {
2838
- const picksSession = typeof body.session === "string" ? body.session : void 0;
2839
- const picksDir0 = picks ? picks.resolveDir(picksSession) : void 0;
2840
- if (!picksDir0) {
2841
- writeJson(res, 409, envelopeError("no-workspace", "no registered workspace resolves for this session"));
2842
- return;
2843
- }
2844
- const saveBody = body;
2845
- const block = typeof saveBody.block === "string" ? saveBody.block : "";
2846
- if (block === "") {
2847
- writeJson(res, 400, envelopeError("invalid-block", "block is required"));
2848
- return;
2849
- }
2850
- const file = typeof saveBody.file === "string" && /^[A-Za-z0-9._-]+\.json$/.test(saveBody.file) ? saveBody.file : `picks-${Date.now()}.json`;
2851
- const dir = picksDir0;
2852
- await mkdir(dir, { recursive: true });
2853
- const target = resolve(dir, file);
2854
- if (!target.startsWith(resolve(dir))) {
2855
- writeJson(res, 400, envelopeError("invalid-path", "path escapes the picks dir"));
2856
- return;
2857
- }
2858
- await writeFile(target, block, "utf8");
2859
- writeJson(res, 200, envelopeOk({
2860
- path: target,
2861
- file
2862
- }));
2863
- } else if (method === "picks-load") {
2864
- const loadSession = typeof body.session === "string" ? body.session : void 0;
2865
- const loadDir0 = picks ? picks.resolveDir(loadSession) : void 0;
2866
- if (!loadDir0) {
2867
- writeJson(res, 409, envelopeError("no-workspace", "no registered workspace resolves for this session"));
2868
- return;
2869
- }
2870
- const loadBody = body;
2871
- const file = typeof loadBody.file === "string" && /^[A-Za-z0-9._-]+\.json$/.test(loadBody.file) ? loadBody.file : "";
2872
- if (file === "") {
2873
- writeJson(res, 400, envelopeError("invalid-file", "file is required"));
2874
- return;
2875
- }
2876
- try {
2877
- writeJson(res, 200, envelopeOk({ content: await readFile(resolve(loadDir0, file), "utf8") }));
2878
- } catch (error) {
2879
- writeJson(res, 404, envelopeError("not-found", error instanceof Error ? error.message : String(error)));
2880
- }
2881
2837
  } else writeJson(res, 404, envelopeError("not-found", `unknown ego-browser API method "${method}"`));
2882
2838
  } catch (error) {
2883
2839
  const e = error;
@@ -7097,21 +7053,7 @@ function apply(ctx, config = {}) {
7097
7053
  ctx.logger?.warn?.(`dsh-browser-cdp: cast server init failed: ${err?.message ?? err}`);
7098
7054
  }
7099
7055
  try {
7100
- registerEgoBrowserGateway(wctx, bridge, ffmpegManager, { resolveDir: (sessionId) => {
7101
- try {
7102
- const registry = typeof ctx.get === "function" ? ctx.get("workspaceRegistry") : void 0;
7103
- const workspaces = (registry ? registry.list() : []) ?? [];
7104
- if (workspaces.length === 0) return void 0;
7105
- if (sessionId) {
7106
- const owned = workspaces.find((w) => w.sessionIds.includes(sessionId));
7107
- if (owned) return owned.path + "/picks";
7108
- }
7109
- if (workspaces.length === 1) return workspaces[0].path + "/picks";
7110
- return;
7111
- } catch {
7112
- return;
7113
- }
7114
- } });
7056
+ registerEgoBrowserGateway(wctx, bridge, ffmpegManager);
7115
7057
  } catch (err) {
7116
7058
  ctx.logger?.warn?.(`dsh-browser-cdp: capability gateway init failed: ${err?.message ?? err}`);
7117
7059
  }
@@ -7282,7 +7224,7 @@ function registerAuthFlush(ctx, cfg, reg) {
7282
7224
  const stateDir = e.EGO_LINUX_STATE_DIR || (isWin ? (e.LOCALAPPDATA || `${home}\\AppData\\Local`) + "\\ego-lite-linux" : `${e.XDG_STATE_HOME || `${home}/.local/state`}/ego-lite-linux`);
7283
7225
  let port = null;
7284
7226
  try {
7285
- const state = JSON.parse(await readFile$1(`${stateDir}/dsh-browser-cdp.cast.json`, "utf8"));
7227
+ const state = JSON.parse(await readFile$1(`${stateDir}/ego-cast.json`, "utf8"));
7286
7228
  port = typeof state.port === "number" ? state.port : null;
7287
7229
  } catch {
7288
7230
  port = null;
package/package.json CHANGED
@@ -1,20 +1,18 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "0.17.23",
4
- "description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.7+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.6 use the 0.16.x line]",
3
+ "version": "0.18.1",
4
+ "description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.2.0-rc.1+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.7 use the 0.17.x line]",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
7
7
  "exports": {
8
8
  ".": "./lib/index.js",
9
9
  "./client": "./lib/client.js",
10
10
  "./dsh-plugin.json": "./dsh-plugin.json",
11
- "./locale/*.json": "./locale/*.json",
12
11
  "./package.json": "./package.json"
13
12
  },
14
13
  "files": [
15
14
  "lib/",
16
15
  "bin/",
17
- "locale/",
18
16
  "runtime/",
19
17
  "cordis.patch.yml",
20
18
  "dsh-plugin.json",
@@ -23,16 +21,14 @@
23
21
  ],
24
22
  "dsh": {
25
23
  "engines": {
26
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
24
+ "dsh": ">=0.2.0-rc.1 <0.2.1-0"
27
25
  },
28
26
  "bundle": {
29
27
  "patch": "./cordis.patch.yml"
30
28
  },
31
29
  "client": {
32
30
  "platform": "web",
33
- "inject": [
34
- "@deepseek-ai/dsh-client-locale"
35
- ]
31
+ "inject": []
36
32
  }
37
33
  },
38
34
  "scripts": {
@@ -44,12 +40,12 @@
44
40
  "@deepseek-ai/schemastery": "^3.18.4"
45
41
  },
46
42
  "peerDependencies": {
47
- "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0",
48
- "@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.1.8-0",
49
- "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.7-rc.1 <0.1.8-0",
50
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.1.8-0",
51
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.1.8-0",
52
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
43
+ "@deepseek-ai/dsh-client-locale": ">=0.2.0-rc.1 <0.2.1-0",
44
+ "@deepseek-ai/dsh-client-store": ">=0.2.0-rc.1 <0.2.1-0",
45
+ "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.2.0-rc.1 <0.2.1-0",
46
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-rc.1 <0.2.1-0",
47
+ "@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1-0",
48
+ "@deepseek-ai/dsh-tools": ">=0.2.0-rc.1 <0.2.1-0",
53
49
  "react": "^18.2.0"
54
50
  },
55
51
  "peerDependenciesMeta": {
@@ -77,7 +73,7 @@
77
73
  },
78
74
  "devDependencies": {
79
75
  "@deepseek-ai/cosmokit": "^1.8.5",
80
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
76
+ "@deepseek-ai/dsh-tools": ">=0.2.0-rc.1 <0.2.1-0",
81
77
  "@types/node": "^22.20.1",
82
78
  "@types/react": "~18.3.31",
83
79
  "@types/ws": "^8.5.10",
@@ -86,11 +82,11 @@
86
82
  "typescript": "^5.9.0",
87
83
  "vitest": "^3.2.0",
88
84
  "ws": "^8.18.0",
89
- "@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1"
85
+ "@deepseek-ai/dsh-sandbox": ">=0.2.0-rc.1 <0.2.1-0"
90
86
  },
91
87
  "engines": {
92
88
  "node": ">=22",
93
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
89
+ "dsh": ">=0.2.0-rc.1 <0.2.1-0"
94
90
  },
95
91
  "license": "MIT",
96
92
  "repository": {
@@ -98,6 +94,6 @@
98
94
  "url": "git+https://github.com/drscrewdriver/dsh-browser-cdp.git"
99
95
  },
100
96
  "publishConfig": {
101
- "tag": "dsh-0.1.7"
97
+ "tag": "dsh-0.2.0"
102
98
  }
103
99
  }
package/locale/de.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "CDP-Browser",
4
- "description": "DSH-Browser-Plugin: hängt sich per CDP an ein laufendes Chrome/Edge (kein mitgebrachter Browser nötig); über 30 bcdp_*-Automatisierungswerkzeuge plus ein Echtzeit-Beobachtungspanel (Live-SSE-Bildschirmübertragung, direkte Mausbedienung, Download-Erfassung, Hinweise zur Mensch-Verifikation)."
5
- }
6
- }
package/locale/en.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "CDP Browser",
4
- "description": "DSH browser plugin: attach to a running Chrome/Edge over CDP (no bundled browser needed); 30+ bcdp_* automation tools plus a realtime watch panel (live SSE screencast, direct mouse interaction, download capture, human-verification notices)."
5
- }
6
- }
package/locale/es.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "Navegador CDP",
4
- "description": "Complemento de navegador DSH: se conecta a un Chrome/Edge en ejecución mediante CDP (sin navegador incluido); más de 30 herramientas de automatización bcdp_* y un panel de observación en tiempo real (retransmisión SSE en vivo, interacción directa con el ratón, captura de descargas, avisos de verificación humana)."
5
- }
6
- }
package/locale/fr.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "Navigateur CDP",
4
- "description": "Plugin navigateur DSH : se rattache à un Chrome/Edge en cours d'exécution via CDP (aucun navigateur fourni) ; plus de 30 outils d'automatisation bcdp_* et un panneau d'observation en temps réel (diffusion SSE en direct, interaction souris directe, capture des téléchargements, alertes de vérification humaine)."
5
- }
6
- }
package/locale/it.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "Browser CDP",
4
- "description": "Plugin browser DSH: si aggancia a un Chrome/Edge in esecuzione via CDP (nessun browser incluso); oltre 30 strumenti di automazione bcdp_* più un pannello di osservazione in tempo reale (diretta SSE dello schermo, interazione diretta del mouse, cattura dei download, avvisi di verifica umana)."
5
- }
6
- }
package/locale/ja.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "CDP ブラウザ",
4
- "description": "DSH ブラウザプラグイン:CDP 経由で起動中の Chrome/Edge にアタッチ(同梱ブラウザ不要);30 以上の bcdp_* 自動化ツールとリアルタイム観覧パネル(SSE ライブ画面配信、直接マウス操作、ダウンロード捕捉、人間検証の通知)。"
5
- }
6
- }
package/locale/ko.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "CDP 브라우저",
4
- "description": "DSH 브라우저 플러그인: CDP로 실행 중인 Chrome/Edge에 연결(동봉 브라우저 불필요); 30개 이상의 bcdp_* 자동화 도구와 실시간 관찰 패널(SSE 라이브 화면 전송, 직접 마우스 조작, 다운로드 캡처, 사람 확인 알림)."
5
- }
6
- }
package/locale/ru.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "CDP-браузер",
4
- "description": "Плагин браузера DSH: подключается к запущенному Chrome/Edge по CDP (без встроенного браузера); более 30 инструментов автоматизации bcdp_* и панель наблюдения в реальном времени (живая трансляция экрана по SSE, прямые действия мышью, перехват загрузок, уведомления о проверке на человека)."
5
- }
6
- }
package/locale/zh.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "CDP 浏览器",
4
- "description": "DSH 浏览器插件:通过 CDP 挂接正在运行的 Chrome/Edge(无需自带浏览器);30+ 个 bcdp_* 自动化工具,外加实时观察面板(SSE 实时推流、直接鼠标操作、下载捕获、人机验证提醒)。"
5
- }
6
- }