mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
feat: 添加工具类增强与状态管理改进
- 新增 workflowRuns、remoteTriggerAudit、pipeStatus 等工具 - 增强 permissionSetup: auto mode 和 bypass permissions 始终可用 - 新增多组测试覆盖 (modifiers, teamDiscovery, deepLink 等) - 修复 parseInt 缺少 radix 参数 - 移除多余 biome-ignore 注释 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
32
src/utils/pipeStatus.ts
Normal file
32
src/utils/pipeStatus.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { PipeRegistry } from './pipeRegistry.js'
|
||||
import { readRegistry } from './pipeRegistry.js'
|
||||
|
||||
export async function formatPipeRegistryStatus(): Promise<string> {
|
||||
return formatPipeRegistry(await readRegistry())
|
||||
}
|
||||
|
||||
export function formatPipeRegistry(registry: PipeRegistry): string {
|
||||
const lines = [
|
||||
`Pipe registry: ${registry.main ? 1 : 0} main, ${registry.subs.length} sub(s)`,
|
||||
]
|
||||
if (registry.mainMachineId) {
|
||||
lines.push(` main_machine=${registry.mainMachineId.slice(0, 8)}...`)
|
||||
}
|
||||
if (registry.main) {
|
||||
lines.push(
|
||||
` [main] ${registry.main.pipeName} pid=${registry.main.pid} host=${registry.main.hostname} tcp=${registry.main.tcpPort ?? 'none'}`,
|
||||
)
|
||||
}
|
||||
for (const sub of registry.subs.slice(0, 10)) {
|
||||
lines.push(
|
||||
` [sub-${sub.subIndex}] ${sub.pipeName} pid=${sub.pid} host=${sub.hostname} bound=${sub.boundToMain ?? 'none'} tcp=${sub.tcpPort ?? 'none'}`,
|
||||
)
|
||||
}
|
||||
if (!registry.main && registry.subs.length === 0) {
|
||||
lines.push(' none')
|
||||
}
|
||||
if (registry.subs.length > 10) {
|
||||
lines.push(` ... ${registry.subs.length - 10} more sub pipe(s)`)
|
||||
}
|
||||
return lines.join('\n')
|
||||
}
|
||||
Reference in New Issue
Block a user