Compare commits
8 Commits
chore.reco
...
v1.7.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9938545788 | ||
|
|
a7b3809a12 | ||
|
|
7149bc8689 | ||
|
|
9802128421 | ||
|
|
a572d05c25 | ||
|
|
cb06624d12 | ||
|
|
7b93839186 | ||
|
|
d0085ec052 |
@@ -21,7 +21,7 @@
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"@types/node": "^24.12.2",
|
||||
"cross-env": "^10.1.0",
|
||||
"hono": "^4.12.14",
|
||||
"hono": "^4.12.18",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "catalog:",
|
||||
"vite": "catalog:",
|
||||
|
||||
@@ -76,9 +76,7 @@ export class HookManager {
|
||||
|
||||
async listProcesses(): Promise<HookProcessInfo[]> {
|
||||
const processes = listHookProcesses();
|
||||
const seen = new Set<number>();
|
||||
for (const proc of processes) {
|
||||
seen.add(proc.pid);
|
||||
const state = this.ensureState(proc.pid);
|
||||
state.name = proc.name || state.name;
|
||||
state.path = proc.path || state.path;
|
||||
@@ -87,11 +85,6 @@ export class HookManager {
|
||||
for (const proc of processes) {
|
||||
result.push(this.toPublicInfo(this.ensureState(proc.pid)));
|
||||
}
|
||||
for (const state of this.states.values()) {
|
||||
if (!seen.has(state.pid) && (state.injected || state.client)) {
|
||||
result.push(this.toPublicInfo(state));
|
||||
}
|
||||
}
|
||||
return result.sort((a, b) => a.pid - b.pid);
|
||||
}
|
||||
|
||||
@@ -316,6 +309,7 @@ export class HookManager {
|
||||
try {
|
||||
const livePipes = await QqHookClient.listLivePipes();
|
||||
const processes = listHookProcesses();
|
||||
const runningSet = new Set(processes.map(p => p.pid));
|
||||
|
||||
// Refresh metadata + ensure a state entry exists for each known PID.
|
||||
for (const proc of processes) {
|
||||
@@ -325,6 +319,7 @@ export class HookManager {
|
||||
}
|
||||
// Auto-detect hooks that survived a SnowLuma restart or failed unload.
|
||||
for (const pid of livePipes) {
|
||||
if (!runningSet.has(pid)) continue;
|
||||
const state = this.ensureState(pid);
|
||||
if (!state.injected) {
|
||||
state.injected = true;
|
||||
@@ -334,14 +329,15 @@ export class HookManager {
|
||||
}
|
||||
}
|
||||
|
||||
const runningSet = new Set(processes.map(p => p.pid));
|
||||
const tasks: Promise<unknown>[] = [];
|
||||
for (const state of [...this.states.values()]) {
|
||||
const alivePipe = livePipes.has(state.pid);
|
||||
const aliveProc = runningSet.has(state.pid);
|
||||
|
||||
// Reap stale state entries that have nothing left to do.
|
||||
if (!aliveProc && !alivePipe && !state.injected && !state.client) {
|
||||
if (!aliveProc) {
|
||||
const wasLoggedIn = state.loggedIn;
|
||||
this.tearDownClient(state);
|
||||
if (wasLoggedIn) this.bridgeManager.onPidDisconnected(state.pid);
|
||||
this.states.delete(state.pid);
|
||||
continue;
|
||||
}
|
||||
|
||||
16
pnpm-lock.yaml
generated
16
pnpm-lock.yaml
generated
@@ -35,7 +35,7 @@ importers:
|
||||
devDependencies:
|
||||
'@hono/node-server':
|
||||
specifier: ^1.19.14
|
||||
version: 1.19.14(hono@4.12.14)
|
||||
version: 1.19.14(hono@4.12.18)
|
||||
'@rollup/plugin-node-resolve':
|
||||
specifier: ^16.0.3
|
||||
version: 16.0.3
|
||||
@@ -46,8 +46,8 @@ importers:
|
||||
specifier: ^10.1.0
|
||||
version: 10.1.0
|
||||
hono:
|
||||
specifier: ^4.12.14
|
||||
version: 4.12.14
|
||||
specifier: ^4.12.18
|
||||
version: 4.12.18
|
||||
tsx:
|
||||
specifier: ^4.21.0
|
||||
version: 4.21.0
|
||||
@@ -1583,8 +1583,8 @@ packages:
|
||||
hermes-parser@0.25.1:
|
||||
resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==}
|
||||
|
||||
hono@4.12.14:
|
||||
resolution: {integrity: sha512-am5zfg3yu6sqn5yjKBNqhnTX7Cv+m00ox+7jbaKkrLMRJ4rAdldd1xPd/JzbBWspqaQv6RSTrgFN95EsfhC+7w==}
|
||||
hono@4.12.18:
|
||||
resolution: {integrity: sha512-RWzP96k/yv0PQfyXnWjs6zot20TqfpfsNXhOnev8d1InAxubW93L11/oNUc3tQqn2G0bSdAOBpX+2uDFHV7kdQ==}
|
||||
engines: {node: '>=16.9.0'}
|
||||
|
||||
ignore@5.3.2:
|
||||
@@ -2403,9 +2403,9 @@ snapshots:
|
||||
|
||||
'@floating-ui/utils@0.2.11': {}
|
||||
|
||||
'@hono/node-server@1.19.14(hono@4.12.14)':
|
||||
'@hono/node-server@1.19.14(hono@4.12.18)':
|
||||
dependencies:
|
||||
hono: 4.12.14
|
||||
hono: 4.12.18
|
||||
|
||||
'@humanfs/core@0.19.1': {}
|
||||
|
||||
@@ -3430,7 +3430,7 @@ snapshots:
|
||||
dependencies:
|
||||
hermes-estree: 0.25.1
|
||||
|
||||
hono@4.12.14: {}
|
||||
hono@4.12.18: {}
|
||||
|
||||
ignore@5.3.2: {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user