feat(limrun): drive an existing instance with its own URL and token
Merged
TH
2mo ago+1003+1003+0123456789012345678901234567890123456789-85-85-01234567890123456789
Summary
A sandboxed agent can drive an existing Limrun instance, such as a live preview, with only that instance's URL and token. It needs no organization API key. agent-device reads the lim CLI's variables:
export LIM_IOS_INSTANCE_URL=... # status.apiUrl
export LIM_IOS_INSTANCE_TOKEN=... # status.token
agent-device connect limrun --platform ios
# Android also needs LIM_ANDROID_INSTANCE_ADB_URL
Node.js: new LimrunRuntime({ instances: { ios: { apiUrl, token } } }).
- agent-device never creates or deletes an attached instance. On Android, teardown removes only the reverse mappings this session created.
- Instance access takes precedence over
LIMRUN_API_KEYfor its platform. - Without a key,
installandappsbefore the firstopenfail withUNSUPPORTED_OPERATION. - Sessions and app-log descriptors carry
ownership: 'created' | 'attached'. - A partial set of variables fails
connectwithINVALID_ARGS. The daemon skips Limrun and logsprovider_runtime_skipped; every other provider still boots. src/provider-limrun-credentials.tsis the only reader of Limrun env vars.
34 files, including help and docs; 997 gross diff lines.
Validation
a86348e533:pnpm check:affected --runpasses (1159 related tests), andeager-closure-budgetspasses. Mutating the no-delete guard, the reverse cleanup, the reconnect routing, the composition skip, the descriptor default, or the skip-log ordering fails the matching test.- Live at
62dd1463f6(also run by @jbroma atd0234a0): withLIMRUN_API_KEYunset,connect,open,snapshot -i,appsanddisconnectworked on real Limrun iOS and Android instances. Both were stillreadyafterwards, then deleted.