Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/daemon/handlers/session-doctor-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function appendAppChecks(
status: 'fail',
summary: `Target app check failed: ${normalized.message}`,
hint: normalized.hint ?? 'Install the app or pass an exact package/bundle id or app name.',
command: `agent-device apps --platform ${device.platform} --all`,
command: `agent-device apps --platform ${publicPlatformString(device)} --all`,
evidence: { code: normalized.code, message: normalized.message },
});
}
Expand Down
12 changes: 8 additions & 4 deletions src/daemon/handlers/session-doctor-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
publicPlatformString,
type DeviceInfo,
type DeviceTarget,
type Platform,
type PlatformSelector,
type PublicPlatform,
} from '../../kernel/device.ts';
import { normalizeError } from '../../kernel/errors.ts';
import type { DaemonRequest, SessionState } from '../types.ts';
Expand Down Expand Up @@ -267,12 +267,16 @@ function deviceInventoryEvidence(
devices: DeviceInfo[],
failures: DoctorInventoryFailure[],
): Record<string, unknown> {
const byPlatform = new Map<Platform, { available: number; booted: number }>();
// Key by the PUBLIC leaf platform (ios/macos/android/...), never the internal
// collapsed `apple`, so the doctor breakdown stays a machine-stable output and
// Apple devices split into ios vs macos.
const byPlatform = new Map<PublicPlatform, { available: number; booted: number }>();
for (const device of devices) {
const entry = byPlatform.get(device.platform) ?? { available: 0, booted: 0 };
const key = publicPlatformString(device);
const entry = byPlatform.get(key) ?? { available: 0, booted: 0 };
entry.available += 1;
if (device.booted === true) entry.booted += 1;
byPlatform.set(device.platform, entry);
byPlatform.set(key, entry);
}
return {
available: devices.length,
Expand Down
3 changes: 2 additions & 1 deletion src/daemon/handlers/session-doctor-options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { detectProjectRuntimeKind } from '../../utils/project-runtime.ts';
import { publicPlatformString } from '../../kernel/device.ts';
import type { SessionStore } from '../session-store.ts';
import type { DaemonRequest, SessionState } from '../types.ts';
import type { DoctorCheck, DoctorKind, DoctorOptions } from './session-doctor-types.ts';
Expand Down Expand Up @@ -116,7 +117,7 @@ export function sessionChecks(
: undefined,
command:
sameDeviceSessions.length > 0
? `agent-device close --session ${sameDeviceSessions[0]} --platform ${session.device.platform}`
? `agent-device close --session ${sameDeviceSessions[0]} --platform ${publicPlatformString(session.device)}`
: undefined,
evidence: {
session: session.name,
Expand Down
Loading