Files
orca/src/shared/freebuff-launch.test.ts
T
400e4e7957 feat(agents): add Freebuff launch and sidebar status support (#23567)
Add Freebuff launch support and execution-host status reporting for the sidebar, including running, question, blocked, and settled states. Validate against captured CLI transcripts and real rendered sidebar evidence.

Cross-referenced community implementations #17065, #20839, and the Freebuff portion of #18790. Preserve their agent/catalog/mobile/documentation coverage and add canonical status publication and regression tests.

Co-authored-by: Harkaran Brar <18134082+harkaranbrar7@users.noreply.github.com>
Co-authored-by: Prarambha369 <98906077+Prarambha369@users.noreply.github.com>
Co-authored-by: Lesley Murfin <260182349+LesleyMurfin@users.noreply.github.com>
2026-09-28 02:32:41 -07:00

59 lines
1.9 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { buildAgentDraftLaunchPlan, buildAgentStartupPlan } from './tui-agent-startup'
import { isExpectedAgentProcess, recognizeAgentProcess } from './agent-process-recognition'
import { pickTuiAgent } from './tui-agent-selection'
describe('Freebuff terminal launches', () => {
it.each(['darwin', 'linux', 'win32'] as const)(
'delivers task text through the interactive terminal on %s',
(platform) => {
const prompt = '--help\nFix "quoted" paths and $HOME handling'
const plan = buildAgentStartupPlan({
agent: 'freebuff',
prompt,
cmdOverrides: {},
platform
})
expect(plan).toMatchObject({
launchCommand: 'freebuff',
expectedProcess: 'freebuff',
followupPrompt: prompt
})
expect(
buildAgentDraftLaunchPlan({
agent: 'freebuff',
draft: prompt,
cmdOverrides: {},
platform
})
).toBeNull()
}
)
it('uses the same launch contract on SSH hosts', () => {
expect(
buildAgentStartupPlan({
agent: 'freebuff',
prompt: 'Inspect this folder',
cmdOverrides: {},
platform: 'linux',
isRemote: true
})
).toMatchObject({ launchCommand: 'freebuff', followupPrompt: 'Inspect this folder' })
})
it.each(['/usr/local/bin/freebuff', 'C:\\tools\\freebuff.exe'])(
'recognizes %s separately from Codebuff',
(processName) => {
expect(recognizeAgentProcess(processName)?.agent).toBe('freebuff')
expect(isExpectedAgentProcess(processName, 'codebuff')).toBe(false)
}
)
it('honors independent installation and disabled-agent preferences', () => {
expect(pickTuiAgent('freebuff', ['freebuff', 'codebuff'])).toBe('freebuff')
expect(pickTuiAgent(null, ['freebuff'])).toBe('freebuff')
expect(pickTuiAgent('freebuff', ['freebuff', 'codebuff'], ['freebuff'])).toBe('codebuff')
})
})