dsh-mobilecode 0.11.7 → 0.11.8

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/client.js CHANGED
@@ -198,7 +198,7 @@ window.__ModuleLoader__.load({
198
198
  // Shown on both stream captions so a refresh visibly proves which client
199
199
  // bundle the browser is actually running. Kept in lockstep with
200
200
  // package.json by test/client.mjs.
201
- const MC_VERSION = "0.11.7";
201
+ const MC_VERSION = "0.11.8";
202
202
  // The panel shows cards for platforms the host can actually drive; the
203
203
  // server reports its OS in info.os (iOS tooling is darwin-only).
204
204
  const fallbackPlatforms = (os) => (os === "darwin" ? ["ios", "android"] : ["android"]);
@@ -758,14 +758,9 @@ function adbFailTail(result) {
758
758
  return text.slice(-300)
759
759
  }
760
760
 
761
- async function adbConnect(serial) {
762
- const result = await captureFull(adb(), ["connect", serial], { timeoutMs: 15_000 })
763
- return /connected|already connected/i.test(`${result.out}\n${result.err}`)
764
- }
765
-
766
761
  /** Attach a Wi-Fi device: `adb connect <ip>:<port>`; true on success. Never throws (returns false with no side effect). */
767
- export async function adbConnectSerial(serial) {
768
- return adbConnect(serial)
762
+ export async function adbConnect(serial) {
763
+ return captureFull(adb(), ['connect', serial], { timeoutMs: 15_000 }).then((r) => /connected|already connected/i.test(`${r.out}\n${r.err}`))
769
764
  }
770
765
 
771
766
  /**
@@ -122,7 +122,6 @@ export class DevicePreviewEngine {
122
122
  const state = {
123
123
  platform: input.platform,
124
124
  status: "starting",
125
- command: [spec.command, ...spec.args(PORTS[input.platform])].join(" "),
126
125
  log: [],
127
126
  }
128
127
  // Claim the slot before the first await so a second caller cannot start a duplicate.
package/lib/index.js CHANGED
@@ -296,7 +296,7 @@ function makeRoutes(engine, config, stream) {
296
296
  await DeviceBuild.adbPair(`${host}:${pairPort}`, code)
297
297
  paired = true
298
298
  }
299
- const connected = await DeviceBuild.adbConnectSerial(target)
299
+ const connected = await DeviceBuild.adbConnect(target)
300
300
  if (!connected) { writeJson(res, 409, { error: `adb connect ${target} failed — check the Wi-Fi IP/port and Wireless debugging; pass pairing_code + pairing_port if it needs pairing.` }); return }
301
301
  writeJson(res, 200, { ok: true, serial: target, paired: paired === true })
302
302
  } catch (error) {
@@ -321,7 +321,7 @@ function makeRoutes(engine, config, stream) {
321
321
  if (pairingSerial === undefined) { writeJson(res, 200, { qr_text: qrText, name, password, status: 'timeout', how }); return }
322
322
  await DeviceBuild.adbPair(pairingSerial, password)
323
323
  const connectHost = pairingSerial.split(':')[0]
324
- const connected = await DeviceBuild.adbConnectSerial(`${connectHost}:5555`)
324
+ const connected = await DeviceBuild.adbConnect(`${connectHost}:5555`)
325
325
  writeJson(res, 200, connected
326
326
  ? { qr_text: qrText, name, password, status: 'connected', serial: `${connectHost}:5555`, how }
327
327
  : { qr_text: qrText, name, password, status: 'paired-not-connected', serial: pairingSerial, how })
@@ -1419,7 +1419,7 @@ function deviceConnectTool() {
1419
1419
  await DeviceBuild.adbPair(`${host}:${pairPort}`, code)
1420
1420
  paired = true
1421
1421
  }
1422
- const connected = await DeviceBuild.adbConnectSerial(target)
1422
+ const connected = await DeviceBuild.adbConnect(target)
1423
1423
  if (!connected) throw new Error(`adb connect ${target} failed — check the Wi-Fi IP/port and that Wireless debugging is on; if it needs pairing, pass pairing_code + pairing_port.`)
1424
1424
  return { serial: target, paired, connected: true }
1425
1425
  },
@@ -1470,7 +1470,7 @@ function devicePairQrTool() {
1470
1470
  await DeviceBuild.adbPair(pairingSerial, password)
1471
1471
  // The pairing dialog usually pairs the tls-port; the connect port is 5555 or mdns-advertised — try 5555.
1472
1472
  const connectHost = pairingSerial.split(':')[0]
1473
- const connected = await DeviceBuild.adbConnectSerial(`${connectHost}:5555`)
1473
+ const connected = await DeviceBuild.adbConnect(`${connectHost}:5555`)
1474
1474
  if (!connected) {
1475
1475
  return { qr_text: qrText, name, password, status: 'paired-not-connected', serial: pairingSerial, how }
1476
1476
  }
package/lib/skill.js CHANGED
@@ -47,7 +47,7 @@ The loop is **observe once → act with an assertion → observe again only if t
47
47
  - Prefer \`device_tap_element\` (resource-id / text / content-desc). Raw pixel coordinates through \`device_input action=tap\` are the last resort — they break on the next layout change.
48
48
  - When you must tap pixels, take the center of a box from \`device_ui_tree\`/\`device_screen\`: x=(x1+x2)/2, y=(y1+y2)/2. Coordinates are ABSOLUTE pixels of the current display.
49
49
  - \`device_input action=swipe\` scrolls; \`action=key\` with "back" is a first-class verb on Android — use it instead of hunting for an on-screen back arrow.
50
- - Typing is ASCII-only through adb. Non-ASCII text (Chinese, emoji) cannot be delivered by \`input text\` — do not retry; type via the app's own UI instead.
50
+ - Typing: ASCII goes through `input text` directly. Non-ASCII (Chinese, emoji) needs the ADBKeyboard IME — `device_input` uses it automatically when installed, and refuses with the install hint otherwise (github.com/senzhk/ADBKeyBoard); do not retry a refused non-ASCII type.
51
51
 
52
52
  ## Never guess a package name or a control
53
53
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-mobilecode",
3
3
  "description": "MobileCode for the dsh web GUI: detect iOS/Android projects, run preview servers, and drive the simulator/emulator from the session — 37 agent tools (device_run, device_screen, device_ui_tree, device_ui_rows, device_tap_row, device_tap_element, device_wait_for, device_scroll_to, device_input, device_batch, device_intent, device_connect, device_pair_qr, device_perf, device_meminfo, device_backtrace, device_display, device_avd_create, device_pair_capture, device_app_info, device_install, device_uninstall, device_reboot, device_log, live screen stream, multimodal screenshots) plus a host-mediated co-op mesh hub (random callsigns, JSON pub/sub, tunable latency/jitter/drop/dup/throttle) so two virtual devices — and the AI watching them — can talk in real time. One classified adb boundary and a Wi-Fi connect/pair QR flow in the Connection settings tab. Hot-pluggable — mounted via the profile bundle list + cordis.patch.yml, no dsh source changes.",
4
- "version": "0.11.7",
4
+ "version": "0.11.8",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",
7
7
  "engines": {