dsh-mobilecode 0.11.6 → 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 +5 -3
- package/lib/device-build.js +2 -7
- package/lib/device-preview.js +0 -1
- package/lib/index.js +4 -4
- package/lib/skill.js +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -126,10 +126,12 @@ window.__ModuleLoader__.load({
|
|
|
126
126
|
/* 0.11.6: the co-op head must NEVER wrap to a second row — a wrapped
|
|
127
127
|
head offsets one pane's stage ~38px lower than its sibling's, which
|
|
128
128
|
read as "the bars in Device 1 make the heights differ". Children
|
|
129
|
-
shrink instead (picker/select ellipsize).
|
|
129
|
+
shrink instead (picker/select ellipsize). 0.11.7: the button must
|
|
130
|
+
also TRACK its shrinking .mc-picker container — at intrinsic width
|
|
131
|
+
it overflowed sideways under the ☰/⧉ buttons. */
|
|
130
132
|
.mc-live-section.coop .mc-card-head { flex-wrap: nowrap; min-width: 0; }
|
|
131
133
|
.mc-card-head .mc-picker { flex: 1 1 auto; min-width: 0; }
|
|
132
|
-
.mc-card-head .mc-picker .mc-btn { min-width: 0; }
|
|
134
|
+
.mc-card-head .mc-picker .mc-btn { width: 100%; min-width: 0; }
|
|
133
135
|
/* No coop-specific height cap: both panes must share Device 1's 60vh rule so
|
|
134
136
|
they match at every size, Fit included (0.11.2). */
|
|
135
137
|
.mc-coop-select { width: auto; min-width: 0; flex: 0 1 auto; padding: 3px 6px; font-size: 12px; }
|
|
@@ -196,7 +198,7 @@ window.__ModuleLoader__.load({
|
|
|
196
198
|
// Shown on both stream captions so a refresh visibly proves which client
|
|
197
199
|
// bundle the browser is actually running. Kept in lockstep with
|
|
198
200
|
// package.json by test/client.mjs.
|
|
199
|
-
const MC_VERSION = "0.11.
|
|
201
|
+
const MC_VERSION = "0.11.8";
|
|
200
202
|
// The panel shows cards for platforms the host can actually drive; the
|
|
201
203
|
// server reports its OS in info.os (iOS tooling is darwin-only).
|
|
202
204
|
const fallbackPlatforms = (os) => (os === "darwin" ? ["ios", "android"] : ["android"]);
|
package/lib/device-build.js
CHANGED
|
@@ -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
|
|
768
|
-
return
|
|
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
|
/**
|
package/lib/device-preview.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
4
|
+
"version": "0.11.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|
|
7
7
|
"engines": {
|