mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
refactor: remove deprecated logout command and legacy sidechain logic
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import chalk from 'chalk'
|
||||
import { handleAuthCommand } from './auth'
|
||||
import type { CommandDefinition } from './types'
|
||||
|
||||
export const logoutCommand: CommandDefinition = {
|
||||
name: 'logout',
|
||||
requiresRuntimeAssets: true,
|
||||
run: async () => {
|
||||
console.log(chalk.yellow('Note: "hapi logout" is deprecated. Use "hapi auth logout" instead.\n'))
|
||||
try {
|
||||
await handleAuthCommand(['logout'])
|
||||
} catch (error) {
|
||||
console.error(chalk.red('Error:'), error instanceof Error ? error.message : 'Unknown error')
|
||||
if (process.env.DEBUG) {
|
||||
console.error(error)
|
||||
}
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import { daemonCommand } from './daemon'
|
||||
import { doctorCommand } from './doctor'
|
||||
import { geminiCommand } from './gemini'
|
||||
import { hookForwarderCommand } from './hookForwarder'
|
||||
import { logoutCommand } from './logout'
|
||||
import { mcpCommand } from './mcp'
|
||||
import { notifyCommand } from './notify'
|
||||
import { serverCommand } from './server'
|
||||
@@ -22,7 +21,6 @@ const COMMANDS: CommandDefinition[] = [
|
||||
hookForwarderCommand,
|
||||
doctorCommand,
|
||||
daemonCommand,
|
||||
logoutCommand,
|
||||
notifyCommand
|
||||
]
|
||||
|
||||
|
||||
@@ -47,21 +47,6 @@ export function reduceChatBlocks(
|
||||
const rootResult = reduceTimeline(root, reducerContext)
|
||||
let hasReadyEvent = rootResult.hasReadyEvent
|
||||
|
||||
// If a group couldn't be attached to a Task tool call (e.g. legacy shapes), keep it visible.
|
||||
for (const [taskMessageId, sidechainMessages] of groups) {
|
||||
if (consumedGroupIds.has(taskMessageId)) continue
|
||||
if (sidechainMessages.length === 0) continue
|
||||
const child = reduceTimeline(sidechainMessages, reducerContext)
|
||||
hasReadyEvent = hasReadyEvent || child.hasReadyEvent
|
||||
rootResult.blocks.push({
|
||||
kind: 'agent-event',
|
||||
id: `sidechain:${taskMessageId}`,
|
||||
createdAt: sidechainMessages[0].createdAt,
|
||||
event: { type: 'message', message: 'Task sidechain' }
|
||||
})
|
||||
rootResult.blocks.push(...child.blocks)
|
||||
}
|
||||
|
||||
// Only create permission-only tool cards when there is no tool call/result in the transcript.
|
||||
for (const [id, entry] of permissionsById) {
|
||||
if (toolIdsInMessages.has(id)) continue
|
||||
|
||||
Reference in New Issue
Block a user