@houwert/conductor 0.13.1 → 0.15.0

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/dist/index.js CHANGED
@@ -6,6 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const minimist_1 = __importDefault(require("minimist"));
8
8
  const verbose_js_1 = require("./verbose.js");
9
+ const sdk_js_1 = require("./android/sdk.js");
9
10
  const list_devices_js_1 = require("./commands/list-devices.js");
10
11
  const launch_app_js_1 = require("./commands/launch-app.js");
11
12
  const stop_app_js_1 = require("./commands/stop-app.js");
@@ -110,6 +111,7 @@ ${Object.values(COMMAND_HELP).join('\n')}
110
111
 
111
112
  ${OPTIONS_HELP}`;
112
113
  async function main() {
114
+ (0, sdk_js_1.ensureAndroidEnv)();
113
115
  (0, update_check_js_1.checkForUpdates)();
114
116
  const argv = (0, minimist_1.default)(process.argv.slice(2), {
115
117
  boolean: [
@@ -131,6 +133,11 @@ async function main() {
131
133
  'optional',
132
134
  'benchmark',
133
135
  'dump',
136
+ 'objects',
137
+ 'heap',
138
+ 'leaks',
139
+ 'snapshots',
140
+ 'growth-only',
134
141
  ],
135
142
  string: [
136
143
  'device',
@@ -155,11 +162,17 @@ async function main() {
155
162
  'name',
156
163
  'device-name',
157
164
  'device-type',
165
+ 'system-image',
158
166
  'browser',
159
167
  'from',
160
168
  'to',
161
169
  'source',
162
170
  'level',
171
+ 'save',
172
+ 'diff',
173
+ 'vs',
174
+ 'top',
175
+ 'filter',
163
176
  ],
164
177
  alias: { h: 'help', v: 'verbose', V: 'version' },
165
178
  });
@@ -237,6 +250,7 @@ async function main() {
237
250
  avd: argv['avd'],
238
251
  name: argv['name'],
239
252
  deviceType: argv['device-type'],
253
+ systemImage: argv['system-image'],
240
254
  browser: argv['browser'],
241
255
  });
242
256
  break;
@@ -475,7 +489,20 @@ async function main() {
475
489
  break;
476
490
  case 'memory': {
477
491
  const appId = rest[0];
478
- exitCode = await (0, memory_js_1.memory)(appId, opts, sessionName);
492
+ const all = argv['all'];
493
+ exitCode = await (0, memory_js_1.memory)(appId, opts, sessionName, {
494
+ objects: argv['objects'] || argv['heap'] || all,
495
+ leaks: argv['leaks'] || all,
496
+ top: argv['top'] !== undefined ? Number(argv['top']) : undefined,
497
+ save: argv['save'],
498
+ diff: argv['diff'],
499
+ diffOther: argv['vs'],
500
+ listSnapshots: argv['snapshots'],
501
+ // minimist treats --no-gc as gc=false; default-on lives in memory.ts.
502
+ gc: argv['gc'],
503
+ filter: argv['filter'],
504
+ growthOnly: argv['growth-only'],
505
+ });
479
506
  break;
480
507
  }
481
508
  case 'run-flow': {
package/dist/runner.js CHANGED
@@ -6,6 +6,7 @@ exports.runDirect = runDirect;
6
6
  exports.spawnCommand = spawnCommand;
7
7
  exports.runInlineFlow = runInlineFlow;
8
8
  const child_process_1 = require("child_process");
9
+ const sdk_js_1 = require("./android/sdk.js");
9
10
  const session_js_1 = require("./session.js");
10
11
  const flow_runner_js_1 = require("./drivers/flow-runner.js");
11
12
  const verbose_js_1 = require("./verbose.js");
@@ -24,7 +25,9 @@ async function detectFirstDevice() {
24
25
  if (_cachedDeviceId !== undefined)
25
26
  return _cachedDeviceId ?? undefined;
26
27
  // Android: adb devices
27
- const adb = await spawnCommand('adb', ['devices', '-l']).catch(() => null);
28
+ const adb = await spawnCommand((0, sdk_js_1.resolveAndroidTool)('adb'), ['devices', '-l'], {
29
+ env: (0, sdk_js_1.androidSpawnEnv)(),
30
+ }).catch(() => null);
28
31
  if (adb) {
29
32
  for (const line of adb.stdout.split('\n').slice(1)) {
30
33
  const id = line.trim().split(/\s+/)[0];
@@ -217,9 +220,12 @@ async function runDirect(fn, sessionName = 'default') {
217
220
  }
218
221
  }
219
222
  // ── Spawn helpers ─────────────────────────────────────────────────────────────
220
- async function spawnCommand(cmd, args) {
223
+ async function spawnCommand(cmd, args, options) {
221
224
  return new Promise((resolve) => {
222
- const proc = (0, child_process_1.spawn)(cmd, args, { stdio: ['ignore', 'pipe', 'pipe'] });
225
+ const proc = (0, child_process_1.spawn)(cmd, args, {
226
+ stdio: ['ignore', 'pipe', 'pipe'],
227
+ env: options?.env,
228
+ });
223
229
  let stdout = '';
224
230
  let stderr = '';
225
231
  proc.stdout.on('data', (chunk) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@houwert/conductor",
3
- "version": "0.13.1",
3
+ "version": "0.15.0",
4
4
  "description": "CLI tool for mobile app interactions — optimized for AI agents",
5
5
  "license": "MIT",
6
6
  "repository": {