Cleanup imports and formatting in bridge
Reorder and tidy imports, re-export types, and apply minor formatting fixes across the bridge package. Changes include: - Reordered imports and grouped related imports in hook-manager, hook-session, pipe-watcher, qq-hook-client, qq-port-probe and others. - Moved several type re-exports (HookProcessBaseInfo, QqPortLoginInfo, HookProcessInfo/Status) in hook-manager and consolidated exports in package entry index.ts. - Minor whitespace/style tweaks: constructor spacing, for-loop formatting, empty catch handlers, and small refactors that do not change runtime behavior. These are non-functional housekeeping changes to improve consistency and readability.
This commit is contained in:
1 parent
a49e507e15
commit
afbec8ed44
6 files changed
+17
-24
No files matched your search
@@ -1,22 +1,20 @@
|
|||||||
import fs from 'fs';
|
import { createLogger, type Logger } from '@snowluma/common/logger';
|
||||||
import type { PacketSender } from '@snowluma/common/packet-sender';
|
import type { PacketSender } from '@snowluma/common/packet-sender';
|
||||||
import type { PacketInfo, PacketSink } from '@snowluma/common/protocol-types';
|
import type { PacketInfo, PacketSink } from '@snowluma/common/protocol-types';
|
||||||
import { createLogger, type Logger } from '@snowluma/common/logger';
|
import fs from 'fs';
|
||||||
|
import { HookSession, type HookSessionDeps } from './hook-session';
|
||||||
import {
|
import {
|
||||||
injectHookProcess,
|
injectHookProcess,
|
||||||
listHookProcesses,
|
listHookProcesses,
|
||||||
unloadHookProcess,
|
unloadHookProcess,
|
||||||
type HookProcessBaseInfo,
|
type HookProcessBaseInfo,
|
||||||
} from './injector';
|
} from './injector';
|
||||||
import { HookSession, type HookSessionDeps } from './hook-session';
|
|
||||||
import { PipeWatcher } from './pipe-watcher';
|
import { PipeWatcher } from './pipe-watcher';
|
||||||
import { QqHookClient } from './qq-hook-client';
|
import { QqHookClient } from './qq-hook-client';
|
||||||
import type { HookProcessInfo } from './types';
|
|
||||||
import { probeQqLoginInfo, type QqPortLoginInfo } from './qq-port-probe';
|
import { probeQqLoginInfo, type QqPortLoginInfo } from './qq-port-probe';
|
||||||
|
import type { HookProcessInfo } from './types';
|
||||||
|
|
||||||
|
|
||||||
export type { HookProcessInfo, HookProcessStatus } from './types';
|
|
||||||
export type { HookProcessBaseInfo } from './injector';
|
|
||||||
export type { QqPortLoginInfo } from './qq-port-probe';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sink that the hook layer calls back into when it observes a new login,
|
* Sink that the hook layer calls back into when it observes a new login,
|
||||||
@@ -311,3 +309,6 @@ export function shouldAutoLoadPid(pid: number, log: Logger): boolean {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
export type { HookProcessBaseInfo } from './injector';
|
||||||
|
export type { QqPortLoginInfo } from './qq-port-probe';
|
||||||
|
export type { HookProcessInfo, HookProcessStatus } from './types';
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EventEmitter } from 'events';
|
|
||||||
import type { PacketSink } from '@snowluma/common/protocol-types';
|
|
||||||
import { createLogger, type Logger } from '@snowluma/common/logger';
|
import { createLogger, type Logger } from '@snowluma/common/logger';
|
||||||
|
import type { PacketSink } from '@snowluma/common/protocol-types';
|
||||||
|
import { EventEmitter } from 'events';
|
||||||
import { HookPacketClient } from './hook-packet-client';
|
import { HookPacketClient } from './hook-packet-client';
|
||||||
import type { HookInjectResult } from './injector';
|
import type { HookInjectResult } from './injector';
|
||||||
import type { QqHookClient, QqHookLoginState, QqHookPacket } from './qq-hook-client';
|
import type { QqHookClient, QqHookLoginState, QqHookPacket } from './qq-hook-client';
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
// Public entry — re-exports the hook orchestration surface that the
|
|
||||||
// top-level app (and webui readers) consume. Everything else is
|
|
||||||
// internal to the package.
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
HookManager,
|
HookManager, type BridgeManagerSink, type HookManagerDeps, type HookProcessBaseInfo, type HookProcessInfo,
|
||||||
type HookManagerDeps,
|
type HookProcessStatus, type QqPortLoginInfo
|
||||||
type BridgeManagerSink,
|
|
||||||
type HookProcessInfo,
|
|
||||||
type HookProcessStatus,
|
|
||||||
type HookProcessBaseInfo,
|
|
||||||
type QqPortLoginInfo,
|
|
||||||
} from './hook-manager';
|
} from './hook-manager';
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { EventEmitter } from 'events';
|
|
||||||
import { createLogger, type Logger } from '@snowluma/common/logger';
|
import { createLogger, type Logger } from '@snowluma/common/logger';
|
||||||
|
import { EventEmitter } from 'events';
|
||||||
import type { HookProcessBaseInfo } from './injector';
|
import type { HookProcessBaseInfo } from './injector';
|
||||||
|
|
||||||
const DEFAULT_INTERVAL_MS = 1500;
|
const DEFAULT_INTERVAL_MS = 1500;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { EventEmitter } from 'events';
|
||||||
|
import { promises as fs } from 'fs';
|
||||||
import net from 'net';
|
import net from 'net';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { promises as fs } from 'fs';
|
|
||||||
import { EventEmitter } from 'events';
|
|
||||||
|
|
||||||
export const PIPE_MAGIC = 0x31504851;
|
export const PIPE_MAGIC = 0x31504851;
|
||||||
export const PIPE_VERSION = 1;
|
export const PIPE_VERSION = 1;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import net from 'net';
|
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
|
import net from 'net';
|
||||||
import { promisify } from 'util';
|
import { promisify } from 'util';
|
||||||
|
|
||||||
const execAsync = promisify(exec);
|
const execAsync = promisify(exec);
|
||||||
|
|||||||
Reference in new issue
Block a user