( runtime: AgentDeviceRuntime, input: AppPushInput | undefined, )
| 283 | } |
| 284 | |
| 285 | async function resolvePushInput( |
| 286 | runtime: AgentDeviceRuntime, |
| 287 | input: AppPushInput | undefined, |
| 288 | ): Promise<{ |
| 289 | backendInput: BackendPushInput; |
| 290 | inputKind: 'json' | 'file'; |
| 291 | cleanup?: () => Promise<void>; |
| 292 | }> { |
| 293 | if (!input || typeof input !== 'object') { |
| 294 | throw new AppError('INVALID_ARGS', 'apps.push requires an input'); |
| 295 | } |
| 296 | if (input.kind === 'json') { |
| 297 | validateJsonObjectPayload(input.payload, 'apps.push JSON payload', MAX_APP_PUSH_PAYLOAD_BYTES); |
| 298 | return { |
| 299 | backendInput: { kind: 'json', payload: input.payload }, |
| 300 | inputKind: 'json', |
| 301 | }; |
| 302 | } |
| 303 | |
| 304 | const resolved = await resolveCommandInput(runtime, input, { |
| 305 | usage: 'apps.push', |
| 306 | field: 'input', |
| 307 | }); |
| 308 | return { |
| 309 | backendInput: { kind: 'file', path: resolved.path }, |
| 310 | inputKind: 'file', |
| 311 | ...(resolved.cleanup ? { cleanup: resolved.cleanup } : {}), |
| 312 | }; |
| 313 | } |
| 314 | |
| 315 | function requireAppEventName(name: string): string { |
| 316 | const normalized = requireText(name, 'name'); |
no test coverage detected
searching dependent graphs…