MCPcopy Index your code
hub / github.com/codeaashu/claude-code / heartbeatWork

Function heartbeatWork

src/bridge/bridgeApi.ts:387–417  ·  view source on GitHub ↗
(
      environmentId: string,
      workId: string,
      sessionToken: string,
    )

Source from the content-addressed store, hash-verified

385 },
386
387 async heartbeatWork(
388 environmentId: string,
389 workId: string,
390 sessionToken: string,
391 ): Promise<{ lease_extended: boolean; state: string }> {
392 validateBridgeId(environmentId, 'environmentId')
393 validateBridgeId(workId, 'workId')
394
395 debug(`[bridge:api] POST .../work/${workId}/heartbeat`)
396
397 const response = await axios.post<{
398 lease_extended: boolean
399 state: string
400 last_heartbeat: string
401 ttl_seconds: number
402 }>(
403 `${deps.baseUrl}/v1/environments/${environmentId}/work/${workId}/heartbeat`,
404 {},
405 {
406 headers: getHeaders(sessionToken),
407 timeout: 10_000,
408 validateStatus: s => s < 500,
409 },
410 )
411
412 handleErrorStatus(response.status, response.data, 'Heartbeat')
413 debug(
414 `[bridge:api] POST .../work/${workId}/heartbeat -> ${response.status} lease_extended=${response.data.lease_extended} state=${response.data.state}`,
415 )
416 return response.data
417 },
418
419 async sendPermissionResponseEvent(
420 sessionId: string,

Callers

nothing calls this directly

Calls 4

validateBridgeIdFunction · 0.85
getHeadersFunction · 0.85
handleErrorStatusFunction · 0.85
debugFunction · 0.70

Tested by

no test coverage detected