mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-08 03:01:47 +00:00
chore(ui-tui): apply npm run fix formatting pass
Run ui-tui lint autofix + prettier and commit the resulting formatting-only changes for the parity PR branch.
This commit is contained in:
parent
a4cb3ef66c
commit
487da4b72b
6 changed files with 25 additions and 19 deletions
|
|
@ -6,8 +6,8 @@ import type {
|
|||
ConfigGetValueResponse,
|
||||
ConfigSetResponse,
|
||||
SessionSaveResponse,
|
||||
SessionTitleResponse,
|
||||
SessionSteerResponse,
|
||||
SessionTitleResponse,
|
||||
SessionUndoResponse
|
||||
} from '../../../gatewayTypes.js'
|
||||
import { writeOsc52Clipboard } from '../../../lib/osc52.js'
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ export const opsCommands: SlashCommand[] = [
|
|||
}
|
||||
|
||||
const payload: Record<string, unknown> = { action }
|
||||
|
||||
if (action === 'connect') {
|
||||
payload.url = rest.join(' ').trim() || 'http://localhost:9222'
|
||||
}
|
||||
|
|
@ -115,11 +116,13 @@ export const opsCommands: SlashCommand[] = [
|
|||
r.connected ? `browser connected: ${r.url || '(url unavailable)'}` : 'browser not connected'
|
||||
)
|
||||
}
|
||||
|
||||
if (action === 'connect') {
|
||||
return ctx.transcript.sys(
|
||||
r.connected ? `browser connected: ${r.url || '(url unavailable)'}` : 'browser connect failed'
|
||||
)
|
||||
}
|
||||
|
||||
ctx.transcript.sys('browser disconnected')
|
||||
})
|
||||
)
|
||||
|
|
@ -143,10 +146,13 @@ export const opsCommands: SlashCommand[] = [
|
|||
if (!r.enabled) {
|
||||
return ctx.transcript.sys('checkpoints are not enabled')
|
||||
}
|
||||
|
||||
const checkpoints = r.checkpoints ?? []
|
||||
|
||||
if (!checkpoints.length) {
|
||||
return ctx.transcript.sys('no checkpoints found')
|
||||
}
|
||||
|
||||
ctx.transcript.panel('Rollback checkpoints', [
|
||||
{
|
||||
rows: checkpoints.map((c, idx) => [
|
||||
|
|
@ -162,17 +168,21 @@ export const opsCommands: SlashCommand[] = [
|
|||
|
||||
if (lower === 'diff') {
|
||||
const hash = rest[0]
|
||||
|
||||
if (!hash) {
|
||||
return ctx.transcript.sys('usage: /rollback diff <checkpoint>')
|
||||
}
|
||||
|
||||
return ctx.gateway
|
||||
.rpc<RollbackDiffResponse>('rollback.diff', { hash, session_id: ctx.sid })
|
||||
.then(
|
||||
ctx.guarded<RollbackDiffResponse>(r => {
|
||||
const body = (r.rendered || r.diff || '').trim()
|
||||
|
||||
if (!body && !r.stat) {
|
||||
return ctx.transcript.sys('no changes since this checkpoint')
|
||||
}
|
||||
|
||||
const text = [r.stat || '', body].filter(Boolean).join('\n\n')
|
||||
ctx.transcript.page(text, 'Rollback diff')
|
||||
})
|
||||
|
|
@ -182,6 +192,7 @@ export const opsCommands: SlashCommand[] = [
|
|||
|
||||
const hash = first
|
||||
const filePath = rest.join(' ').trim()
|
||||
|
||||
return ctx.gateway
|
||||
.rpc<RollbackRestoreResponse>('rollback.restore', {
|
||||
...(filePath ? { file_path: filePath } : {}),
|
||||
|
|
@ -193,9 +204,11 @@ export const opsCommands: SlashCommand[] = [
|
|||
if (!r.success) {
|
||||
return ctx.transcript.sys(`rollback failed: ${r.error || r.message || 'unknown error'}`)
|
||||
}
|
||||
|
||||
const target = filePath || 'workspace'
|
||||
const detail = r.reason || r.message || r.restored_to || 'restored'
|
||||
ctx.transcript.sys(`rollback restored ${target}: ${detail}`)
|
||||
|
||||
if ((r.history_removed ?? 0) > 0) {
|
||||
ctx.transcript.setHistoryItems(prev => ctx.transcript.trimLastExchange(prev))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { attachedImageNotice, introMsg, toTranscriptMessages } from '../../../domain/messages.js'
|
||||
import { TUI_SESSION_MODEL_FLAG } from '../../../domain/slash.js'
|
||||
import type {
|
||||
BackgroundStartResponse,
|
||||
ConfigGetValueResponse,
|
||||
|
|
@ -10,7 +11,6 @@ import type {
|
|||
VoiceToggleResponse
|
||||
} from '../../../gatewayTypes.js'
|
||||
import { fmtK } from '../../../lib/text.js'
|
||||
import { TUI_SESSION_MODEL_FLAG } from '../../../domain/slash.js'
|
||||
import type { PanelSection } from '../../../types.js'
|
||||
import { patchOverlayState } from '../../overlayStore.js'
|
||||
import { patchUiState } from '../../uiStore.js'
|
||||
|
|
@ -27,8 +27,7 @@ const persistedModelArg = (arg: string) => {
|
|||
return !trimmed || GLOBAL_MODEL_FLAG_RE.test(trimmed) ? trimmed : `${trimmed} --global`
|
||||
}
|
||||
|
||||
const stripTuiSessionFlag = (trimmed: string) =>
|
||||
trimmed.replace(TUI_SESSION_STRIP_RE, ' ').replace(/\s+/g, ' ').trim()
|
||||
const stripTuiSessionFlag = (trimmed: string) => trimmed.replace(TUI_SESSION_STRIP_RE, ' ').replace(/\s+/g, ' ').trim()
|
||||
|
||||
const modelValueForConfigSet = (arg: string) => {
|
||||
const trimmed = arg.trim()
|
||||
|
|
@ -313,6 +312,7 @@ export const sessionCommands: SlashCommand[] = [
|
|||
run: (arg, ctx) => {
|
||||
const mode = arg.trim().toLowerCase()
|
||||
const valid = new Set(['', 'status', 'normal', 'fast', 'on', 'off', 'toggle'])
|
||||
|
||||
if (!valid.has(mode)) {
|
||||
return ctx.transcript.sys('usage: /fast [normal|fast|status]')
|
||||
}
|
||||
|
|
@ -356,6 +356,7 @@ export const sessionCommands: SlashCommand[] = [
|
|||
run: (arg, ctx) => {
|
||||
const mode = arg.trim().toLowerCase()
|
||||
const valid = new Set(['', 'status', 'queue', 'steer', 'interrupt'])
|
||||
|
||||
if (!valid.has(mode)) {
|
||||
return ctx.transcript.sys('usage: /busy [queue|steer|interrupt|status]')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue