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

Method getWorkerState

src/cli/transports/ccrClient.ts:530–548  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

528 // Control_requests are marked processed and not re-delivered on
529 // restart, so read back what the prior worker wrote.
530 private async getWorkerState(): Promise<{
531 metadata: Record<string, unknown> | null
532 durationMs: number
533 }> {
534 const startMs = Date.now()
535 const authHeaders = this.getAuthHeaders()
536 if (Object.keys(authHeaders).length === 0) {
537 return { metadata: null, durationMs: 0 }
538 }
539 const data = await this.getWithRetry<WorkerStateResponse>(
540 `${this.sessionBaseUrl}/worker`,
541 authHeaders,
542 'worker_state',
543 )
544 return {
545 metadata: data?.worker?.external_metadata ?? null,
546 durationMs: Date.now() - startMs,
547 }
548 }
549
550 /**
551 * Send an authenticated HTTP request to CCR. Handles auth headers,

Callers 1

initializeMethod · 0.95

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected