Skip to content

Add local IPC client for devtools integration#37

Merged
kigiri merged 2 commits into
masterfrom
feat/local-ipc-client
Jun 5, 2026
Merged

Add local IPC client for devtools integration#37
kigiri merged 2 commits into
masterfrom
feat/local-ipc-client

Conversation

@abdotop
Copy link
Copy Markdown
Member

@abdotop abdotop commented Jun 5, 2026

feat(api): Add api/local_ipc_client.ts for local devtools communication

@abdotop abdotop requested a review from kigiri June 5, 2026 00:54
@abdotop abdotop self-assigned this Jun 5, 2026
- Add api/local_ipc_client.ts for local devtools communication
@abdotop abdotop force-pushed the feat/local-ipc-client branch from 8343846 to 1234481 Compare June 5, 2026 00:57
Comment thread api/log.ts Outdated
@@ -234,7 +242,7 @@ export const logger = async ({
service_instance_id: startTime.toString(),
}
// Local logging
Copy link
Copy Markdown
Member

@kigiri kigiri Jun 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  if (f.has(event)) return
  forwardLogsToDevtool(level, event, props)
  console[level](event, props)

Comment thread api/log.ts

const ev = `${makePrettyTimestamp(level, event)} ${callChain}`.trim()
props ? console[level](ev, props) : console[level](ev)
})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  if (f.has(event)) return
  forwardLogsToDevtool(level, event, props)
  let callChain = ''
  for (const s of Error('').stack!.split('\n').slice(2).reverse()) {
    if (!s.includes(rootDir)) continue
    const fnName = s.split(' ').at(-2)
    if (!fnName || fnName === 'async' || fnName === 'at') continue
    const coloredName = colored[fnName] ||
      (colored[fnName] = colors
        [Object.keys(colored).length % colors.length](
          fnName,
        ))
    callChain = callChain ? `${callChain}/${coloredName}` : coloredName
  }
  const ev = `${makePrettyTimestamp(level, event)} ${callChain}`.trim()
  props ? console[level](ev, props) : console[level](ev)
}

@kigiri kigiri merged commit 2a1c7be into master Jun 5, 2026
1 check passed
@kigiri kigiri deleted the feat/local-ipc-client branch June 5, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants