@kraken-e2e/cli 0.1.1 → 3.0.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.
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Devices extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static enableJsonFlag: boolean;
6
+ static flags: {
7
+ cwd: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<unknown>;
10
+ }
11
+ //# sourceMappingURL=devices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/commands/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAI7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,OAAgB,WAAW,SACwH;IAEnJ,OAAgB,QAAQ,WAAqE;IAE7F,OAAgB,cAAc,UAAQ;IAEtC,OAAgB,KAAK;;MAEnB;IAEI,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAU9B"}
@@ -0,0 +1,21 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { buildDevicesReport, renderDevicesText } from '../devices-report.js';
3
+ export default class Devices extends Command {
4
+ static description = 'List the devices you can already drive — booted simulators, running emulators, connected devices, browsers — with ready-to-paste actor config.';
5
+ static examples = ['<%= config.bin %> devices', '<%= config.bin %> devices --json'];
6
+ static enableJsonFlag = true;
7
+ static flags = {
8
+ cwd: Flags.string({ description: 'project directory (defaults to the current one)' }),
9
+ };
10
+ async run() {
11
+ const { flags } = await this.parse(Devices);
12
+ const report = await buildDevicesReport({
13
+ ...(flags.cwd !== undefined ? { cwd: flags.cwd } : {}),
14
+ });
15
+ if (!this.jsonEnabled()) {
16
+ this.log(renderDevicesText(report));
17
+ }
18
+ return report;
19
+ }
20
+ }
21
+ //# sourceMappingURL=devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/commands/devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAU,WAAW,GACzB,gJAAgJ,CAAC;IAEnJ,MAAM,CAAU,QAAQ,GAAG,CAAC,2BAA2B,EAAE,kCAAkC,CAAC,CAAC;IAE7F,MAAM,CAAU,cAAc,GAAG,IAAI,CAAC;IAEtC,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;KACtF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC;YACtC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvD,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DeviceTarget } from '@kraken-e2e/contracts';
2
+ export interface DevicesReport {
3
+ readonly drivers: ReadonlyArray<{
4
+ readonly driverId: string;
5
+ readonly platformLabel: string;
6
+ readonly targets: readonly DeviceTarget[];
7
+ }>;
8
+ /** Drivers that are registered but expose no enumeration (older contract). */
9
+ readonly withoutEnumeration: readonly string[];
10
+ }
11
+ export declare function buildDevicesReport(options: {
12
+ cwd?: string;
13
+ }): Promise<DevicesReport>;
14
+ export declare function renderDevicesText(report: DevicesReport): string;
15
+ //# sourceMappingURL=devices-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices-report.d.ts","sourceRoot":"","sources":["../src/devices-report.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQ1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;KAC3C,CAAC,CAAC;IACH,8EAA8E;IAC9E,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CAChD;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAyB1F;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAqC/D"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * `kraken devices` (contract 2.1): show what you can ALREADY drive — booted
3
+ * simulators, running emulators, connected devices, installed browsers —
4
+ * with ready-to-paste actor config for each. Use what you have; provision
5
+ * only when you have nothing.
6
+ */
7
+ import { loadConfig } from '@kraken-e2e/config';
8
+ import { createHostContext, DriverRegistry, systemHostProbe, } from '@kraken-e2e/core';
9
+ export async function buildDevicesReport(options) {
10
+ const host = systemHostProbe.detect();
11
+ const config = await loadConfig({ ...(options.cwd !== undefined ? { cwd: options.cwd } : {}) });
12
+ const registry = await DriverRegistry.create({
13
+ registrations: config.drivers,
14
+ host,
15
+ projectRoot: config.projectRoot,
16
+ });
17
+ const drivers = [];
18
+ const withoutEnumeration = [];
19
+ const hostContext = createHostContext(host, config.projectRoot);
20
+ for (const driver of registry.readyDrivers()) {
21
+ if (typeof driver.listTargets !== 'function') {
22
+ withoutEnumeration.push(driver.manifest.id);
23
+ continue;
24
+ }
25
+ drivers.push({
26
+ driverId: driver.manifest.id,
27
+ platformLabel: driver.manifest.platformLabel,
28
+ targets: await driver.listTargets(hostContext),
29
+ });
30
+ }
31
+ return { drivers, withoutEnumeration };
32
+ }
33
+ export function renderDevicesText(report) {
34
+ const lines = [];
35
+ let running = 0;
36
+ let available = 0;
37
+ for (const entry of report.drivers) {
38
+ lines.push(`${entry.driverId} — ${entry.platformLabel}`);
39
+ if (entry.targets.length === 0) {
40
+ lines.push(' (no targets found)');
41
+ continue;
42
+ }
43
+ for (const target of entry.targets) {
44
+ const mark = target.state === 'running' ? '●' : '○';
45
+ if (target.state === 'running')
46
+ running += 1;
47
+ else
48
+ available += 1;
49
+ const detail = target.detail ? ` — ${target.detail}` : '';
50
+ lines.push(` ${mark} ${target.name} [${target.state}]${detail}`);
51
+ if (target.actorConfig) {
52
+ lines.push(` actor config: ${JSON.stringify(target.actorConfig)}`);
53
+ }
54
+ }
55
+ lines.push('');
56
+ }
57
+ for (const id of report.withoutEnumeration) {
58
+ lines.push(`${id} — (driver does not support device enumeration)`);
59
+ }
60
+ lines.push(`${running} running (● reuse these — nothing to boot), ${available} available (○ provisioned on demand)`);
61
+ if (running > 0) {
62
+ lines.push("Tip: paste a ● target's actor config into kraken.config.ts to reuse what is already up.");
63
+ }
64
+ return lines.join('\n');
65
+ }
66
+ //# sourceMappingURL=devices-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices-report.js","sourceRoot":"","sources":["../src/devices-report.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EAEjB,c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GAAG,EAAE,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,IAAI,CACR,GAAG,OAAO,+CAA+C,SAAS,sCAAsC,CACzG,CAAC;IACF,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CACR,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kraken-e2e/cli",
3
- "version": "0.1.1",
3
+ "version": "3.0.0",
4
4
  "description": "The kraken CLI (oclif): run, doctor, init, plugins — the composition layer wiring all packages together",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,14 +24,14 @@
24
24
  "jiti": "^2.7.0",
25
25
  "tinyglobby": "^0.2.0",
26
26
  "ws": "^8.18.0",
27
- "@kraken-e2e/core": "0.1.1",
28
- "@kraken-e2e/config": "0.1.1",
29
- "@kraken-e2e/contracts": "0.1.1",
30
- "@kraken-e2e/signaling": "0.1.1",
31
- "@kraken-e2e/doctor": "0.1.1",
32
- "@kraken-e2e/tui": "0.1.1",
33
- "@kraken-e2e/gherkin": "0.1.1",
34
- "@kraken-e2e/reporters": "1.0.0"
27
+ "@kraken-e2e/contracts": "3.0.0",
28
+ "@kraken-e2e/core": "3.0.0",
29
+ "@kraken-e2e/doctor": "3.0.0",
30
+ "@kraken-e2e/config": "3.0.0",
31
+ "@kraken-e2e/gherkin": "3.0.0",
32
+ "@kraken-e2e/reporters": "3.0.0",
33
+ "@kraken-e2e/tui": "3.0.0",
34
+ "@kraken-e2e/signaling": "3.0.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22.15.0",