Skip to content

Releases

v2.3.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 30 Nov 07:09
v2.3.0
3ee6129

DroidSock v2.3.0 Changelog

Release Date: November 2026
Release Type: Minor
Branch: release/2.3.0


Overview

v2.3.0 switches the CommonJS entry to the generic index.cjs shim used across the CLDMV libraries, and moves the development tools to their latest versions. require("@cldmv/droidsock") returns the same function with the same properties as v2.2.1, so this is a drop-in upgrade. The shim also sets .default on the result, which the old entry did not.


🐛 Bug Fixes

CommonJS entry uses the generic shim (#118, #122, fixes #117)

The hand-written src/index.cjs was replaced with the same small file other CLDMV libraries ship (Node version guard, then require("./index.mjs")). The ESM entry exports one distinct value, the createDroidSock function, under five names (default, createDroidSock, DroidSock, ADB and AndroidDebugBridge). The first version of the shim returned the bare function with nothing attached; #122 fixed it so the function carries .default and every ESM name again. The build still copies the file unchanged to dist/index.cjs, and the CJS tests check the shape against both src/ and dist/.

require() result, measured on the published v2.2.1 package and on this build:

Check v2.2.1 v2.3.0
typeof require(x) function function
require(x).createDroidSock === require(x) true true
require(x).DroidSock === require(x) true true
require(x).ADB === require(x) true true
require(x).AndroidDebugBridge === require(x) true true
const { ADB } = require(x) is the function true true
require(x).default === require(x) false (undefined) true

Every alias the old entry had still works. .default is new, which is what the CJS convention expects.

🔧 CI & tooling

  • ci.yml adopts the CLDMV/.github v4.46.0 concurrency block, so superseded runs on next, hotfixes and the release PRs are cancelled instead of filling the org's hosted runner pool (#119, fixes #116).
  • ci.yml is synced with the v4.43.0 template, so the release PR stops rerunning the matrix on a commit its push run already tested (#114).

🔧 Dependencies

  • The CLDMV dev tools move together: @cldmv/vitest-runner 1.5.6 → 1.11.5, @cldmv/configs 1.4.0 → 1.5.1, @cldmv/fix-headers 2.2.4 → 2.6.2, and @cldmv/jsonv and @cldmv/prettier-plugin-jsonv 1.1.x → 1.2.4. File headers are restamped (@Filename no longer has a leading slash) and .github/dependabot.yml is synced to the CLDMV/.github v4.47.0 groups (#121, #123). Development only.
  • @cldmv/slothlet stays capped at >=3.22.1 <3.24.0, because 3.24.0 breaks droidsock (CLDMV/slothlet#726). The range is unchanged from v2.2.1.

📚 Documentation


Upgrade notes

  • Drop-in for v2.2.1. No code changes needed: require(x)(...), require(x).ADB, const { ADB } = require(x) and the ESM named exports all work as before.

coverage

Metric Coverage
Statements 93.3%
Branches 85.7%
Functions 94.7%
Lines 95.0%

Avg: 92.1% · 49bed5f · Node lts/*

👥 Contributors

v2.2.1

Choose a tag to compare

@cldmv-bot cldmv-bot released this 22 Nov 08:11
v2.2.1
b772d75

DroidSock v2.2.1 Changelog

Release Date: November 2026
Release Type: Patch
Branch: release/2.2.1


Overview

v2.2.1 keeps @cldmv/slothlet below 3.24.0. slothlet 3.24.0 hands sockets back to droidsock as proxies, so device.connect() throws TypeError: Illegal invocation on every install that resolves it. The ^3.22.1 range in v2.2.0 allowed 3.24.0, so a fresh install of v2.2.0 picks it up today; v2.2.1 narrows the range to >=3.22.1 <3.24.0.

No droidsock code changed. The rest of the release is test and CI work: the Vitest suite now also runs against the built dist/, and the dev export condition actually reaches the test workers.


🐛 Bug Fixes

@cldmv/slothlet capped below 3.24.0 (#112)

From 3.24.0, slothlet hands out a proxy for a net.Socket (or any node:stream object) that a module returns, and native calls on it fail with TypeError: Illegal invocation (slothlet#708). droidsock's connection module creates the socket and the device module calls socket.setKeepAlive() on it, so every device.connect() threw. 3.23.0 is not affected.

The dependency range moves from ^3.22.1 to >=3.22.1 <3.24.0. The lockfile stays on 3.22.1. No fixed 3.24.x is planned, because slothlet's next release is 4.0.0; moving to slothlet 4 is separate work.

Packages that depend on droidsock and pinned slothlet with an npm overrides entry to work around this can drop the override once they require @cldmv/droidsock ^2.2.1.

🧪 Tests

  • The Vitest config sets the droidsock-dev condition with devCondition() from @cldmv/configs 1.4.0. The old test.nodeOptions setting isn't a Vitest option, so the condition never reached the test workers (#103).
  • npm run test:dist builds dist/ and runs the Vitest suite against it. npm test and ci:coverage include it (#107).
  • The device tests compare leaves by host:port instead of object identity, and the shell-control tests check that stop() reaches the real control. From slothlet 3.23, devices.get() and devices.list() return each module's own view of the same leaf, so identity checks failed although the device was the same (#106).

🔧 CI & tooling

  • New sync-release-notes.yml companion workflow from the v4 template, unchanged. It keeps GitHub Release bodies in step with the per-version changelog files and creates missing version tags (#110).

📚 Documentation

  • NEW: docs/changelog/v2/v2.2.1.md: this changelog.
  • docs/API.md and the devices.get() JSDoc no longer promise "the exact same object" across a disconnect and reconnect; they say the same leaf or device, which is what callers can rely on (#106).
  • README: the source-layout section mentions npm run test:dist (#107).
  • README ✨ What's New updated for v2.2.1.

🔧 Dependencies

Runtime:

  • @cldmv/slothlet ^3.22.1 → >=3.22.1 <3.24.0, locked at 3.22.1 (see Bug Fixes).

Dev-only:

  • @cldmv/configs ^1.3.0 → ^1.4.0 (#103).

Upgrade notes

  • Drop-in for v2.2.0; the API and runtime code are unchanged.
  • If your install resolved @cldmv/slothlet 3.24.0 under v2.2.0, updating to v2.2.1 moves it back to 3.23.x or 3.22.x and device.connect() works again.

coverage

Metric Coverage
Statements 93.4%
Branches 85.8%
Functions 94.7%
Lines 95.0%

Avg: 92.2% · 96329ba · Node lts/*

👥 Contributors

v2.2.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 02 Nov 02:42
v2.2.0
3d94845

DroidSock v2.2.0 Changelog

Release Date: November 2026
Release Type: Minor
Branch: release/2.2.0


Overview

v2.2.0 moves the package to the CLDMV library layout: the entries are src/index.mjs and src/index.cjs, tsup builds dist/, and the published package ships dist/ and types/ instead of root index.mjs / index.cjs files. The ADB API, its options and its behaviour are unchanged. @cldmv/droidsock/main still works but is now a deprecated alias of the package root.

The runtime Node.js floor is unchanged: engines.node stays >=22.15.0. Working on the repository now needs Node.js 22.22.0, declared in npm's devEngines; see Requirements.

The release also raises @cldmv/slothlet to ^3.22.1 and carries the dependency and documentation updates queued since v2.1.0.


✨ Features

CLDMV library layout (#93, closes #91)

  • Entry files. The ES module entry is src/index.mjs and the CommonJS entry is its sibling src/index.cjs. src/index.mjs re-exports the factory from src/droidsock.mjs directly, as the default export and as createDroidSock, DroidSock, ADB and AndroidDebugBridge, all the same function. The package no longer imports itself by name (@cldmv/droidsock/main) to get there. require("@cldmv/droidsock") still returns the factory with the same named aliases as properties.
  • Build. tsup replaces build.mjs. dist/ mirrors src/ file by file, because slothlet scans dist/api/ at runtime, and dist/index.cjs is a verbatim copy of src/index.cjs. Source maps are built but not published. prepack runs the build, so a packed or published tarball always carries a fresh dist/.
  • Types. Declarations come from types/src/, and @cldmv/droidsock/main now has the same types as the root.
  • ./package.json is exported.

@cldmv/droidsock/main is a deprecated alias (#93)

@cldmv/droidsock/main used to point straight at droidsock.mjs, which only had a default export. It now re-exports the package root, so it has the same default and named exports, and importing it prints a DeprecationWarning once per process with code CLDMV_DROIDSOCK_MAIN (console.warn where there is no process). node --no-deprecation silences it. The alias is removed in the next major version; import @cldmv/droidsock instead.

droidsock-dev export condition on the root (#93)

The droidsock-dev condition, which before only covered ./main, now sits on . too, for import, require and types. In a checkout the package resolves to the built dist/ by default and to src/ under --conditions=droidsock-dev. The Vitest suite and the examples in the README run with it. Installed copies never see the condition.

📦 Requirements

Runtime floor unchanged, development floor in devEngines (#93, #100)

  • Runtime: engines.node stays >=22.15.0, the floor @cldmv/slothlet sets, for import and require() alike. Every Node.js version in that range has require(esm). On a Node.js without it, the CommonJS entry's error now asks for >=22.15.0 (v2.1.0's message said ^20.19.0 or >=22.12.0).
  • Development: working on this repository needs Node.js 22.22.0 or later, because the development toolchain (tsup 9 among others) doesn't run on earlier 22.x releases. That floor is declared in devEngines.runtime with onFail: "error", so it doesn't affect anyone installing the package.

🐛 Bug Fixes

Development check removed (#92)

The root devcheck.mjs, which the entry tried to load in a source checkout, is gone. It was never published, so installed copies are unaffected. The droidsock-dev condition already chooses src/ or dist/ in a checkout.

@cldmv/slothlet ^3.22.1 (#93)

The entry now imports the factory, and with it @cldmv/slothlet, statically. slothlet 3.22.0 has a top-level await in its module graph, which makes require() of the package fail with ERR_REQUIRE_ASYNC_MODULE; 3.22.1 doesn't. The dependency range moves from ^3.15.0 to ^3.22.1, and the lockfile from 3.22.0 to 3.22.1.

The lockfile stays on 3.22.1 rather than 3.23: with 3.23.0 the device tests hang and devices.get() returns a different object after a disconnect (slothlet#688). The ^3.22.1 range still allows 3.23 in a consumer's install.

The ./main deprecation warning survives bundling (#99, fixes #98)

package.json declared "sideEffects": false, which lets a bundler drop the top-level code in main.mjs that prints the deprecation warning. sideEffects now lists ./src/main.mjs and ./dist/main.mjs, as uuid and holdmytask do.

🔧 CI & tooling

  • build:ci runs lint, format:check, types:build and the tsup build; the coverage jobs run it before measuring (coverage_build_command), and the bundle-size check measures dist/ (#93).
  • test:cjs builds first and checks dist/ with node --test. New tests cover the ./main alias and src/index.cjs (#93).
  • The CI and publish workflows' min_node_version default is 22.22.0 (was 22.15.0 in CI and 22.12.0 in publish), the dev toolchain floor; its description and a comment say it should match devEngines, not engines. Node.js 22.15 through 22.21 are still supported at runtime but no longer in the test matrix (#93, #100).
  • The stray root test.txt and an empty screenshot.png are gone; neither was published (#93).

📚 Documentation

  • NEW: docs/changelog/v2/v2.2.0.md: this changelog.
  • README: the requirements list the runtime floor (22.15.0) and the development floor (22.22.0) separately (#100), and cover the deprecated ./main alias, a source-layout section with a table of what @cldmv/droidsock resolves to with and without droidsock-dev, and the examples run with the condition (#93).
  • README, docs/API.md and docs/PROTOCOL.md: spaces around slashes that separate words in prose (#76).
  • README ✨ What's New updated for v2.2.0.

🔧 Dependencies

Runtime:

  • @cldmv/slothlet ^3.15.0 → ^3.22.1, locked 3.22.0 → 3.22.1 (see Bug Fixes).
  • @noble/curves and selfsigned were refreshed but were already on their latest versions (2.4.0 and 5.5.0); nothing changed (#95).

Dev-only (#95, which also covers Dependabot #94 and the redirected PRs #81, #83, #85, #88 and #90):

  • tsup 9.0.0 is new and replaces build.mjs; esbuild is no longer a direct dev dependency (#93).
  • @cldmv/configs 1.2.4 → 1.3.0, @cldmv/fix-headers 2.2.0 → 2.2.4, @cldmv/vitest-runner 1.5.3 → 1.5.6, @cldmv/jsonv 1.1.3 → 1.1.5, @cldmv/eslint-plugin-jsonv 1.0.15 → 1.0.17, @cldmv/prettier-plugin-jsonv 1.1.3 → 1.1.4.
  • eslint 10.12.0 → 10.14.0, @eslint/css 2.0.0 → 2.0.1, @eslint/json 2.1.0 → 2.1.1, globals 17.13.0 → 17.14.0.
  • prettier 3.9.9 → 3.9.10 (#78).
  • vitest and @vitest/coverage-v8 5.0.3 → 5.0.5, with vite 8.3.2 → 8.3.5; @types/node 26.6.4 → 26.6.6.
  • typescript stays on 6.0.3: #95 moved it to 7, and #96 pinned it back to ^6.0.3 because TypeScript 7's declaration emit for JavaScript sources isn't complete yet.
  • New npm overrides for the ESLint chain: katex >=0.19.1 <1.0.0 (0.16.47 → 0.19.1) and minimatch ^11.0.3 (10.2.6 → 11.0.3).

Upgrade notes

  • The runtime Node.js floor is unchanged at 22.15.0.
  • Replace @cldmv/droidsock/main with @cldmv/droidsock. It still works in 2.x but prints a DeprecationWarning (code CLDMV_DROIDSOCK_MAIN) and goes away in the next major version.
  • The ADB API is unchanged. Two small differences in the entry: importing the package now loads @cldmv/slothlet at import time instead of on the first call (the api modules are still composed when the factory runs), and the default export is the factory itself, so its name is createDroidSock rather than droidsock.
  • Code that reached into the package's file layout (the root index.mjs / index.cjs, types/dist/, types/index.d.mts) outside the exports map has to move to the exported paths.

coverage

Metric Coverage
Statements 93.4%
Branches 85.8%
Functions 94.7%
Lines 95.0%

Avg: 92.2% · fb7ad46 · Node lts/*

👥 Contributors

v2.1.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 09 Oct 06:09
v2.1.0
5ee96ca

DroidSock v2.1.0 Changelog

Release Date: October 2026
Release Type: Minor


Overview

v2.1.0 gives a device a connection lifecycle. A dropped connection used to go unnoticed until the next call threw "Device not connected", and nothing reconnected it. Each device now emits lifecycle events, can reconnect on its own with exponential backoff, enables TCP keepalive, and can optionally probe the device with a heartbeat to catch a hung adbd. All of it is opt-in or additive: existing code that never passes the new options behaves as before, apart from TCP keepalive now being switched on by the keepAlive config value that was previously ignored.

The release also raises engines.node to >=22.15.0 to match @cldmv/slothlet 3.22, and carries the dependency bumps queued since v2.0.3 and a development-toolchain security fix.


✨ Features

Lifecycle events (#75)

Every device emits connecting, connected, disconnected, reconnecting, reconnected, error and gave-up, subscribed to with on(event, listener), once(event, listener) and off(event, listener) (each returns the device, so calls chain). Every payload carries deviceId, host and port. disconnected also reports whether the close was intentional (a disconnect() or remove() call) and a reason of "requested", "closed" or "heartbeat". The events honour the existing emitEvents config option, a throwing listener is logged without affecting the connection, and error is only emitted when a listener is attached.

Opt-in auto-reconnect with backoff (#75)

device.connect(host, port, { autoReconnect }) reconnects after an unexpected drop. true uses the defaults; an object overrides them: initialDelay (default: the retryDelay config value, 1000 ms), factor (2), maxDelay (30000 ms), jitter (0.2) and maxAttempts (unlimited). An explicit disconnect() or remove() never triggers it, an explicit reconnect() cancels a pending automatic attempt, and a device that rejects authentication stops the retries with gave-up (reason "auth"). After maxAttempts consecutive failures the device emits gave-up (reason "max-attempts").

TCP keepalive (#75)

The keepAlive and keepAliveInterval config values, which were defined but never read, now enable TCP keepalive on each connection socket (default on, 30 s). A silently dead link is eventually closed by the operating system and reported as a drop.

Optional heartbeat

ADB has no ping message, so device.connect(host, port, { heartbeat }) runs a trivial shell command on a timer (true means every 15 s with a 5 s timeout; an object sets interval and timeout). A probe that fails or times out closes the socket: the device emits error, then disconnected with reason "heartbeat", and autoReconnect takes over when enabled. Probes never overlap and stop on any disconnect.

docs/API.md documents the options and the event table under "Lifecycle events".


🐛 Bug Fixes

A failed handshake no longer leaks its socket (#75)

When the handshake failed (authentication rejected, or an unexpected reply), the connection was rejected but its socket stayed open. With auto-reconnect, every failed retry would have left one behind. The socket is now destroyed on a failed handshake.

engines.node now matches @cldmv/slothlet 3.22 (#74)

@cldmv/slothlet 3.22 requires Node.js >=22.15.0, but the package declared >=22.12.0, so installs on Node.js 22.12 to 22.14 resolved with an engines warning for a dependency the package cannot run on. engines.node, the CI minimum-Node default and the README requirement are now >=22.15.0.


🔒 Security

brace-expansion 5.0.9 → 5.0.12 (#66)

Fixes GHSA-q2hr-2g5m-vwhr (CVE-2026-102277), a medium-severity (CVSS 5.3) denial of service: expanding input shaped like {a},b} takes time quadratic in the number of literal } characters. brace-expansion is a transitive dependency of minimatch, which only the development tooling pulls in, and the lockfile records it as development-only, so it is not part of the installed package. The repository's Dependabot alert for it (alert 3) closes once this release reaches master.


🔧 Dependencies

Runtime:

  • @cldmv/slothlet: the lockfile moves from 3.21.0 to 3.22.0 (#70). The declared range stays ^3.15.0. The 3.22.0 release adds api.slothlet.restart(), an around hook type and per-instance helper modules, and raises the minimum Node.js version to 22.15.0 (reflected in engines.node above).

Dev-only:

  • Patch group (#72): @cldmv/vitest-runner 1.5.1 → 1.5.3, @cldmv/jsonv 1.1.1 → 1.1.3, @cldmv/eslint-plugin-jsonv 1.0.13 → 1.0.15, @cldmv/prettier-plugin-jsonv 1.1.0 → 1.1.3 and @types/node 26.6.3 → 26.6.4.
  • Minor group (#70): globals 17.12.0 → 17.13.0, alongside the @cldmv/slothlet bump above.
  • ESLint (#68): eslint 10.11.0 → 10.12.0.
  • Vitest group (#67): vitest, @vitest/coverage-v8, @vitest/mocker and @vitest/spy 5.0.2 → 5.0.3, with vite 8.3.1 → 8.3.2 and rolldown 1.2.11 → 1.2.12.
  • Security (#66): brace-expansion, described above.

📚 Documentation

  • NEW: docs/changelog/v2/v2.1.0.md: this changelog.
  • docs/API.md: the autoReconnect and heartbeat options and the lifecycle event table.
  • README ✨ What's New updated for v2.1.0.

Upgrade notes

  • No breaking changes. Without the new options a device behaves as before; the one default-on difference is TCP keepalive, driven by the keepAlive config value.
  • Use Node.js 22.15 or later (any Node.js 24 or 26 release qualifies). engines.node now says so, matching what @cldmv/slothlet 3.22 already required.
  • To keep a long-lived device connected, pass { autoReconnect: true, heartbeat: true } to device.connect() and listen for reconnecting, reconnected and gave-up.

coverage

Metric Coverage
Statements 93.4%
Branches 85.8%
Functions 94.7%
Lines 95.0%

Avg: 92.2% · f8bb7ec · Node lts/*

👥 Contributors

v2.0.3

Choose a tag to compare

@cldmv-bot cldmv-bot released this 05 Oct 04:06
v2.0.3
09f53ae

DroidSock v2.0.3 Changelog

Release Date: October 2026
Release Type: Patch
Branch: release/2.0.3


Overview

v2.0.3 cleans up the CommonJS entry and the published file list. index.cjs now loads the ESM entry with a plain require(), which bundlers can follow, and fails with a clear message on Node.js versions that can't require() ES modules. The ESM entry and the API itself are unchanged.

The release also stops publishing devcheck.mjs, a source-checkout-only development check, and removes its ./devcheck subpath export. Removing an export is technically a breaking change despite this being a patch release, so it's listed under Breaking Changes below. In practice the module did nothing in an installed copy of the package.


💥 Breaking Changes

@cldmv/droidsock/devcheck is no longer exported or published (#58)

package.json no longer lists a ./devcheck export, and devcheck.mjs and types/devcheck.d.mts are no longer in the published files. Importing @cldmv/droidsock/devcheck now fails with ERR_PACKAGE_PATH_NOT_EXPORTED.

The module was never part of the documented API. It has no exports; its only job is to warn a developer working in a source checkout who forgot to set NODE_OPTIONS=--conditions=droidsock-dev. It only acts when a src/ folder sits next to it, and the published package has no src/, so importing it from an installed copy did nothing. index.mjs still loads it fire-and-forget and already tolerates it being missing, so the main entry is unaffected.

Upgrade step: if anything imports @cldmv/droidsock/devcheck, delete that import. Nothing replaces it, because it never did anything outside this repository.

🐛 Bug Fixes

Require the ESM entry directly, and fail clearly without require(esm) (#58)

index.cjs used createRequire(__filename) to load index.mjs. That idiom predates Node's native require(esm), and bundlers such as esbuild and webpack don't follow a createRequire-constructed require the way they follow a literal require() call, so a CommonJS build that bundled droidsock could miss the ESM entry.

  • index.cjs now calls require("./index.mjs") directly and exports the same functions as before (module.exports is the droidsock quick path, with createDroidSock, DroidSock, ADB and AndroidDebugBridge as properties).
  • On a Node.js version without require(esm) (before 20.19.0, or 22.0.0 to 22.11.x), index.cjs throws an ERR_REQUIRE_ESM error whose message names the supported versions and points to import(), instead of a bare loader error. The package's engines.node is already >=22.12.0, so this only matters for installs that ignore engines.
  • index.mjs already avoided top-level await, so it needed no change.
  • New tests/cjs/entry.test.cjs checks run under Node's own test runner after Vitest, from both npm test and npm run coverage (through the new test:cjs script). They check that require() returns the same functions as import, and that the version check fires when require(esm) is turned off. They don't call droidsock(), since that opens a real ADB connection.

🔧 CI & tooling

  • bundle-size.yml no longer lists the devcheck files in dist_paths, matching the new published file list (#58).

📚 Documentation

  • NEW: docs/changelog/v2/v2.0.3.md: this changelog.
  • NEW: backfilled v1.1.1, v2.0.1 and v2.0.2.
  • README restructured to the standard CLDMV layout, with a new Requirements section that states the Node.js floor for import and require().

🔧 Dependencies

Both changes are to development dependencies; the package has no runtime dependency changes and the published package is unaffected. Only package.json and the lockfile changed in these bumps, and no file headers were restamped.

  • @cldmv/fix-headers ^2.1.2 → ^2.2.0 (#61 took it to ^2.1.4, #63 to ^2.2.0). Version 2.1.4 no longer writes a JavaScript comment into JSON or Markdown files, processes every repeated --input, and never walks dependency folders such as node_modules. Version 2.2.0 makes the @Last modified by header tag follow content edits only, so a header-only rewrite keeps the recorded editor instead of replacing it. It requires Node.js >=22.12.0, which matches the package's engines.node.
  • @cldmv/configs ^1.2.1 → ^1.2.4 (#63). It provides the shared fix-headers configuration that .configs/fix-headers.json extends. Version 1.2.4 turns off forceAuthorUpdate and forceLastModifiedAuthorUpdate (both were on in 1.2.1), so the shared configuration no longer overwrites the recorded author or last editor.

Upgrade notes

  • If anything imports @cldmv/droidsock/devcheck, remove that import. Nothing else needs to change.
  • import droidsock from "@cldmv/droidsock" and require("@cldmv/droidsock") both work as before on Node.js 22.12.0 or later.

coverage

Metric Coverage
Statements 93.0%
Branches 85.3%
Functions 94.4%
Lines 94.5%

Avg: 91.8% · d7d1cb5 · Node lts/*

👥 Contributors

v2.0.2

Choose a tag to compare

@cldmv-bot cldmv-bot released this 03 Oct 03:37
v2.0.2
d12ba85

DroidSock v2.0.2 Changelog

Release Date: October 2026
Release Type: Patch


Overview

v2.0.2 changes only development tooling and CI. No runtime code changed: the shipped index.mjs, index.cjs and dist/ files differ from v2.0.1 only in their file-header comments, so the API behaves exactly as before.

The release moves header maintenance onto the shared CLDMV @cldmv/fix-headers configuration, makes the required PR check report a real result on in-repo PRs, and brings in a set of dependency bumps.


🔧 CI & tooling

Shared fix-headers configuration (#54)

npm run fix:headers now runs the fix-headers CLI directly against a checked-in .configs/fix-headers.json, which extends @cldmv/configs/fix-headers.json. The local tools/fix-headers.mjs wrapper is gone. Running the shared config once rewrote the file headers across the repository into the uniform CLDMV format, which is why almost every file shows a header-only change in this release.

Run the in-repo PR mirror job instead of skipping it (#55)

v2.0.1 renamed the skipped copy of the ✅ Required PR Check mirror job so it couldn't satisfy the ruleset. The job now always runs instead, and exits early with a note when the push run owns the status for that commit, so it never reports as skipped at all.

🔧 Dependencies

Runtime:

  • @cldmv/slothlet: the lockfile moves from 3.20.0 to 3.21.0 (#57 / #51). The declared range stays ^3.15.0.

Dev-only:

  • @cldmv/fix-headers 1.3.12 → 2.1.2, plus @cldmv/configs 1.2.1 added for the shared config (#54)
  • @cldmv/vitest-runner 1.2.0 → 1.5.1, @cldmv/jsonv 1.0.9 → 1.1.1, @cldmv/prettier-plugin-jsonv 1.0.6 → 1.1.0 and @cldmv/eslint-plugin-jsonv 1.0.10 → 1.0.13 (grouped bumps #51, #57)

📚 Documentation


Upgrade notes

  • No breaking changes. This is a drop-in replacement for v2.0.1, and no runtime code changed.

coverage

Metric Coverage
Statements 93.0%
Branches 85.3%
Functions 94.4%
Lines 94.5%

Avg: 91.8% · 0fab714 · Node lts/*

👥 Contributors

v2.0.1

Choose a tag to compare

@cldmv-bot cldmv-bot released this 02 Oct 21:36
v2.0.1
6901c72

DroidSock v2.0.1 Changelog

Release Date: October 2026
Release Type: Patch


Overview

v2.0.1 is a maintenance release. No runtime code changed: src/, index.mjs and index.cjs are the same as in v2.0.0, so the API behaves exactly as before.

The one change a consumer can see is the declared Node.js floor: engines.node rose from >=20.19.0 to >=22.12.0, despite this being a patch release. It was raised to match the test toolchain (vitest 5), not because the library's own code needs a newer Node.js. See Breaking Changes below for who it affects.

The rest of the release moves the test toolchain to vitest 5, syncs the CI and release workflows with the CLDMV/.github v4.29.2 templates, restores the verbatim Apache-2.0 license text, and makes the test suite more reliable under load.


💥 Breaking Changes

engines.node raised to >=22.12.0 (#38)

The package's declared Node.js floor moved from >=20.19.0 to >=22.12.0 in a patch release. The library code did not change, so it still runs on Node.js 20.19 and later, but the declaration now excludes Node.js 20.19 to 22.11:

  • With npm's default settings, installing on those versions prints an EBADENGINE warning and continues.
  • With engine-strict=true (or a package manager configured to enforce engines), installing on those versions fails.

Upgrade step: run on Node.js 22.12.0 or later. Projects that must stay on Node.js 20.19 to 22.11 can pin @cldmv/[email protected], which has the same runtime code.

🔧 CI & tooling

Test toolchain moved to vitest 5 (#36, #38)

vitest and @vitest/coverage-v8 moved to 5.x together. vitest 5 needs Node.js ^22.12.0 || ^24.0.0 || >=26.0.0, so the CI test matrix now runs from Node.js 22.12.0 up to 26.

Sync the v4 workflows with the CLDMV/.github v4.29.2 templates (#46)

Every workflow caller under .github/workflows/ now matches the v4.29.2 templates. New callers are release-merge.yml (squash-merges the approved next → master release PR with its curated body as the commit message), member-auto-merge.yml, dependabot-recreate.yml, provenance.yml (SLSA build provenance for published releases), pr-notify.yml and bundle-size.yml, which reports how the published files change in size on each PR. The existing callers and .github/dependabot.yml were refreshed to the same template version. The same PR stops the bundle-size check from counting files twice.

Required PR Check no longer satisfied by a skipped run (#50)

On a PR from a branch in this repository, the pull_request run's copy of the ✅ Required PR Check mirror job was skipped, because the push run reports the check for the same commit. GitHub counts a skipped job as passing for a required check, so a PR could look mergeable while its tests were still running. The skipped job now shows under a different name, so only the push run's result satisfies the ruleset.

Grouped Dependabot bumps (#39)

vitest + @vitest/*, the eslint family and the prettier family each bump in one grouped PR. These packages peer each other with major-locked ranges, so separate PRs broke npm ci with ERESOLVE whenever one moved without the others.

More reliable tests under load (#48)

A new Vitest setup file (tests/setup/warm-droidsock.mjs) composes and shuts down one droidsock instance before each test file is collected. The first instance in a file pays a one-time cold cost that was measured at 7 to 11 seconds on a busy machine, which raced the 10-second hook timeout and failed whichever test happened to run first. The device and connection tests also now assert against the real session instead of slothlet's mirror views.

📄 License

  • LICENSE once again carries the verbatim Apache-2.0 text (#45). The license itself did not change.

🔧 Dependencies

Runtime:

  • @cldmv/slothlet: the lockfile moves from 3.15.0 to 3.20.0 (patch group bumps, including #40). The declared range stays ^3.15.0, so consumers resolve whatever 3.x their own install picks.

Dev-only:

  • vitest 4.1.11 → 5.0.2 and @vitest/coverage-v8 4.1.11 → 5.0.2 (#36)
  • @eslint/css 1.4.0 → 2.0.0 (#42)
  • @types/node 26.4.0 → 26.6.3, eslint 10.9.1 → 10.11.0, @eslint/json 2.0.1 → 2.1.0, globals 17.11.0 → 17.12.0, prettier 3.9.6 → 3.9.9, @cldmv/fix-headers 1.3.10 → 1.3.12, @cldmv/jsonv 1.0.2 → 1.0.9, @cldmv/eslint-plugin-jsonv 1.0.3 → 1.0.10 and @cldmv/prettier-plugin-jsonv 1.0.1 → 1.0.6 (grouped bumps #32, #33, #41, #43, #44)

📚 Documentation


Upgrade notes

  • The runtime code is identical to v2.0.0.
  • Run on Node.js 22.12.0 or later to match the new engines.node declaration, or pin v2.0.0 if you need Node.js 20.19 to 22.11 with strict engine checks.

coverage

Metric Coverage
Statements 93.0%
Branches 85.3%
Functions 94.4%
Lines 94.5%

Avg: 91.8% · fece746 · Node lts/*

👥 Contributors

v2.0.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 14 Sep 04:16
v2.0.0
71689b8

DroidSock v2.0.0 Changelog

Release Status: Major release (breaking API changes)


Overview

v2.0.0 redesigns how connected devices are represented, looked up, and disconnected, completes bidirectional port forwarding, adds Wi-Fi pairing, and adds a modern streaming APK install path alongside the newer 64-bit SYNC V2 file-transfer commands. Each device is now a real, persistent composed API leaf rather than a plain object that disappears when its socket dies, split across a device module (single-target connect/disconnect/remove) and a devices module (collection-wide list/disconnect/remove/lookup) - and both the subnet sweep and mDNS discovery now support IPv6 alongside IPv4.


🚨 Breaking Changes

api.device.* / api.devices.* split; a device leaf now persists across a disconnect

The flat device module (functions taking a connection as their first argument) has been replaced by two modules with a clear single-vs-collection split, and disconnecting no longer forgets the device:

  • device.connect(host, port, options) / device.disconnect(host, port) / device.remove(host, port) - single-target operations.
  • devices.list() / devices.disconnect() (no arguments - disconnects every device) / devices.remove() (no arguments - forgets every device) / devices.get(idOrLeaf) - collection-wide operations.

Every device is mounted as its own composed API leaf at api.devices.<sanitized host_port> - the same connection returned by connect() - giving every device leaf's methods working self/context access exactly like any other module in the api tree, instead of being called against a plain object holding connection state. The leaf is now a persistent handle: disconnect() only tears down the current socket, it does not unmount anything, so connect() on the same host:port later reconnects that exact same leaf - reusing whatever options it was created with - instead of building a new one. remove() is the new, separate "forget this device" operation.

// v1.2.0 and earlier
const device = await api.device.connect(host, port);
device.disconnect(); // synchronous, and the only teardown - there was nothing to unmount

// v2.0.0
const device = await api.device.connect(host, port);
device.disconnect(); // still synchronous - tears down the socket, leaf stays mounted
const same = await api.device.connect(host, port); // reconnects the SAME leaf, no options needed again
same === device; // true

await device.remove(); // the new, explicit "forget this device" call - unmounts the leaf
await api.devices.remove(); // forgets EVERY device - no arguments
const gone = api.devices.get(device); // undefined - actually removed, not just disconnected

devices.disconnect()/devices.remove() both take no arguments on purpose - the module name already means "all", and each throws if called with any argument, catching a mix-up with its single-target device.* counterpart. remove() is the one genuinely async step in this lifecycle (it's real api-tree surgery); disconnect() needs no await at all. Everything else on a device - shell(), file operations, reboot, forwarding, install, and the convenience shortcuts (getModel(), logcat(), etc.) - keeps its existing call shape.

engines.node raised to >=20.19.0

The Wi-Fi pairing implementation's SPAKE2-over-Ed25519 key exchange depends on @noble/curves@^2.4.0, which itself requires Node 20.19 or newer. The previous floor (>=18.12) no longer reflects what the package actually needs to run.


✨ Added

IPv6 support (device.connect, discover.subnet, discover.mdns)

device.connect(host, port) accepts an IPv6 host exactly like an IPv4 one. discover.subnet(cidr, ...) accepts an IPv6 CIDR (e.g. "2001:db8::/120") alongside IPv4 - since IPv6 has no broadcast concept, an IPv6 sweep covers its full address range rather than excluding network/broadcast addresses the way IPv4 does, and the existing maxHosts safety guard is what keeps a /64-or-larger sweep from ever being attempted. discover.mdns(options) gains options.family (4 or 6) and dual-stack AAAA-record support, defaulting to the IPv4 mDNS group (224.0.0.251) exactly as before and targeting the IPv6 group (ff02::fb) when family: 6 is requested. EXPERIMENTAL - verified against real loopback IPv4/IPv6 sockets and cross-checked against the platform's own IPv6 address canonicalization, but not yet validated against a real device or a real IPv6 network. See #1.

devices.get(idOrLeaf) and device.remove()/devices.remove()

devices.get(idOrLeaf) looks up a device leaf - connected or currently disconnected - by "host:port" string (bracket an IPv6 host when attaching a port, e.g. "[2001:db8::1]:5555") or by the leaf object itself, returning undefined only for a device that was never connected or has since been remove()d. device.remove(host, port) / devices.remove() (all) are the new explicit "forget this device" operations, separate from disconnect() - see the breaking-change section above for the full reasoning.

Reverse port forwarding (device.reverse)

device.reverse(devicePort, hostPort, options) - the adb reverse tcp:<devicePort> tcp:<hostPort> equivalent - completes the port-forwarding direction device.forward() (v1.1.0) didn't cover. Registering the tunnel is a normal client-initiated stream (reverse:forward:tcp:<devicePort>;tcp:<hostPort>); each subsequent connection to that device port arrives as a device-initiated OPEN the stream layer now handles directly (recognized by arg1 == 0, since the device has no local id of ours to reference yet), emitted as a remoteOpen event and bridged to a real local TCP connection. EXPERIMENTAL - built from the protocol spec and covered by tests against real loopback TCP sockets, not yet validated against a real device. See #1.

Wi-Fi pairing (pairing.pair)

pairing.pair(host, port, pairingCode, options) implements the PIN-based pairing flow Android 11+ uses for wireless debugging (adb pair host:port pairing-code) - a completely separate protocol from the rest of droidsock, existing solely to get the persistent RSA identity's public key into the device's trust store, authenticated by the 6-digit code shown on the device instead of a manual "Allow this computer?" tap. The session is a raw TLS 1.3 connection (peer certificate verification disabled - trust comes from the pairing code via a SPAKE2 key exchange, channel-bound to the TLS session so it can't be relayed) carrying a SPAKE2 exchange followed by an AES-128-GCM-encrypted PEER_INFO exchange. The SPAKE2 construction itself is BoringSSL's bespoke SPAKE2-over-edwards25519 (not RFC 9382's NIST-curve SPAKE2), built on @noble/curves's Ed25519 primitives. EXPERIMENTAL - every wire constant is confirmed against AOSP/BoringSSL source and covered by tests against real loopback TLS servers, but not yet validated against a real device. See #1.

Streaming APK install (install.streaming, wired into device.install)

install.streaming(socket, streamManager, localPath, options) installs an APK via exec:cmd package install -S <size>, writing the local file's raw bytes directly as the command's stdin - no on-device temp file at all, unlike the classic push-then-install flow. device.install() now tries this path automatically when the device advertises the cmd CNXN feature, falling back to the classic flow (and surfacing both failures together, via { cause }, if the fallback also fails) when it doesn't or when streaming itself fails. EXPERIMENTAL - built from the protocol spec and covered by mocked tests, not yet validated against a real device. See #1 and #7.

SYNC V2 (64-bit) file operations (pushV2 / pullV2 / statV2 / listV2)

The legacy SEND/RECV/LIST commands (v1.1.0) use 32-bit size fields, capping a single file or directory entry around ~2.14GB. The new _V2 variants use 64-bit fields (size/atime/mtime/ctime/dev/ino all returned as BigInt), gated on the device advertising the matching CNXN feature (sendrecv_v2 / stat_v2 / ls_v2 - droidsock declares all three in its own outgoing banner). pushV2/pullV2 also support opt-in per-chunk brotli compression (options.compression: "brotli", off by default) via Node's built-in zlib, and both stream through disk in bounded chunks rather than buffering a whole file in memory - the entire point of the 64-bit path is large files. EXPERIMENTAL - implemented from AOSP packages/modules/adb/file_sync_protocol.h and covered by mocked tests, not yet validated against a real device. See #1 and #8.

📦 Dependencies

  • Added @noble/curves@^2.4.0 - Ed25519 primitives for the Wi-Fi pairing SPAKE2 key exchange.

🐛 Fixed

This release also went through several rounds of automated code review against every new code path, which found and fixed a number of genuine bugs beyond the features themselves:

  • The device-key sanitizer collapsed . and : to the same character - sanitizeKey() mapped both a dotted-quad's separators and an IPv6 literal's colons to a single _, making the two indistinguishable in the resulting api.devices.<key> path segment. A . now maps to a single _ and a : to a double __.
  • parseHostPort() mis-parsed a bare IPv6 literal - it always treated the text after the last : as a port, so parseHostPort("::1") returned {host: ":", port: 1} instead of recognizing a complete address with no port attached. It now supports bracketed [addr]:port notation (the standard URL/curl convention) and accepts a comp...
Read more

v1.2.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 03 Sep 14:16
v1.2.0
e98e03f

DroidSock v1.2.0 Changelog

Release Status: Minor release


Overview

v1.2.0 adds device discovery - finding ADB-capable devices on the network without already knowing an address - and closes a shell-injection gap present in every files.* method that shells out to the device.


🐛 Fixed

  • Shell-metacharacter injection in files.mjs - every shell-based file operation (listShell, stat, mkdir, remove, move, copy, chmod, diskUsage, find) interpolated a caller-supplied remote path into a double-quoted shell command with no escaping, letting a path containing $, backticks, or an embedded " break out of the intended command. All nine call sites now go through a shared utils.quoteShellArg() helper using the standard POSIX '\'' single-quote escaping technique. mkdir/chmod's mode and find's maxDepth/type are also now validated before being interpolated, closing a couple of related unvalidated-input gaps found during review.

✨ Added

Device discovery (discover.subnet / discover.mdns)

discover.subnet(cidr, port, options) sweeps a CIDR range for a reachable TCP port - the classic fixed-address adb connect flow - with bounded concurrency and a maxHosts safety ceiling. discover.mdns(options) is a hand-written mDNS client (built directly from RFC 1035/6762/6763, no dependency) that queries for _adb-tls-connect._tcp.local-style wireless-debugging advertisements and correlates PTR/SRV/TXT/A records into {name, host, port, txt} entries. EXPERIMENTAL - both are built from the protocol specs and covered by extensive tests against real loopback TCP/UDP sockets, but neither has been run against a real device or a real multicast network yet. See #1.

📋 Known Limitations

  • discover.subnet/discover.mdns, like the rest of droidsock's protocol work, haven't been validated against real hardware or a real network yet. #1 tracks the real-device session needed to validate the protocol stack they depend on.

← Back to README

👥 Contributors

v1.1.1

Choose a tag to compare

@cldmv-bot cldmv-bot released this 02 Sep 22:29
v1.1.1
9e2c95c

DroidSock v1.1.1 Changelog

Release Date: September 2026
Release Type: Patch


Overview

v1.1.1 is a documentation-only release. No runtime code changed: the shipped index.mjs, index.cjs and dist/ files are the same as in v1.1.0.


📚 Documentation

Pad slashes between adjacent code spans (#15, release #16)

Runs of adjacent inline code spans separated by bare slashes (for example `mkdir`/`remove`/`move`) now have a space on each side of the slash (`mkdir` / `remove` / `move`) throughout README.md, docs/API.md and docs/PROTOCOL.md. Some Markdown renderers merge unpadded spans into one, which made the method lists hard to read. The wording and the documented API are unchanged.


Upgrade notes

  • No breaking changes. This is a drop-in replacement for v1.1.0, and no runtime code changed.
👥 Contributors