feat(mobile): Expo companion app [beta] (#1245)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-05-04 13:08:27 -07:00
committed by GitHub
co-authored by Orca
parent 7093d2f391
commit fc578f5ea9
133 changed files with 30973 additions and 471 deletions
+25 -1
View File
@@ -9,15 +9,39 @@ export type RuntimeTransportMetadata =
kind: 'named-pipe'
endpoint: string
}
| {
kind: 'websocket'
endpoint: string
}
export type RuntimeMetadata = {
runtimeId: string
pid: number
transport: RuntimeTransportMetadata | null
transports: RuntimeTransportMetadata[]
authToken: string | null
startedAt: number
}
// Why: the CLI must handle metadata files written by older Orca versions that
// used a singular `transport` field. This helper extracts the first transport
// matching the given kinds from either the new `transports` array or the
// legacy `transport` field.
export function findTransport(
metadata: RuntimeMetadata,
...kinds: RuntimeTransportMetadata['kind'][]
): RuntimeTransportMetadata | null {
const transports = metadata.transports
if (transports && Array.isArray(transports)) {
return transports.find((t) => kinds.includes(t.kind)) ?? null
}
// Why: backward compatibility with pre-transports-array metadata files.
const legacy = (metadata as Record<string, unknown>).transport as RuntimeTransportMetadata | null
if (legacy && kinds.includes(legacy.kind)) {
return legacy
}
return null
}
const PRIMARY_RUNTIME_METADATA_FILE = 'orca-runtime.json'
export function getRuntimeMetadataPath(userDataPath: string): string {