mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-22 22:01:18 +00:00
feat(hub): add ServerChan task notifications (#515)
* fix(hub): 修复发送后状态显示延迟 * feat(hub): 接入Server酱任务通知 * fix(hub): 仅在会话结束时发送完成通知 * fix(hub): avoid reviving inactive queued sessions * fix(hub): address notification review feedback * fix(hub): expire queued thinking on hub clock * fix(hub): 修复任务通知 review 反馈
This commit is contained in:
@@ -10,6 +10,7 @@ import { AsyncLock } from '@/utils/lock'
|
||||
import type { RawJSONLines } from '@/claude/types'
|
||||
import { configuration } from '@/configuration'
|
||||
import { AGENT_MESSAGE_PAYLOAD_TYPE } from "@hapi/protocol"
|
||||
import type { SessionEndReason } from '@hapi/protocol'
|
||||
import type { ClientToServerEvents, ServerToClientEvents, Update } from '@hapi/protocol'
|
||||
import {
|
||||
TerminalClosePayloadSchema,
|
||||
@@ -499,9 +500,9 @@ export class ApiSessionClient extends EventEmitter {
|
||||
this.socket.emit('messages-consumed', { sid: this.sessionId, localIds })
|
||||
}
|
||||
|
||||
sendSessionDeath(): void {
|
||||
sendSessionDeath(reason?: SessionEndReason): void {
|
||||
void cleanupUploadDir(this.sessionId)
|
||||
this.socket.emit('session-end', { sid: this.sessionId, time: Date.now() })
|
||||
this.socket.emit('session-end', { sid: this.sessionId, time: Date.now(), reason })
|
||||
}
|
||||
|
||||
updateMetadata(handler: (metadata: Metadata) => Metadata): void {
|
||||
|
||||
Reference in New Issue
Block a user