feat: add terminal broadcast, context menu, and shell close
Complete multi-pane broadcast, standard terminal right-click actions, batch host selection with progress, and native ssh_close_shell so closing a pane tears down the remote shell. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
494ef6b9d0
commit
9ce71795b8
38 files changed
+1437
-186
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { analyzeAgentOutput } from '../../src/utils/agentOutput'
|
||||
import { assessAgentCommandRisk } from '../../src/utils/agentCommandRisk'
|
||||
import {
|
||||
agentCommandNeedsConfirmation,
|
||||
assessAgentCommandRisk,
|
||||
} from '../../src/utils/agentCommandRisk'
|
||||
|
||||
describe('Agent command guardrail', () => {
|
||||
it.each([
|
||||
@@ -17,6 +20,15 @@ describe('Agent command guardrail', () => {
|
||||
])('classifies %s as %s', (command, expected) => {
|
||||
expect(assessAgentCommandRisk(command)).toBe(expected)
|
||||
})
|
||||
|
||||
it('uses strict, balanced and permissive confirmation thresholds', () => {
|
||||
expect(agentCommandNeedsConfirmation('safe', 'strict')).toBe(false)
|
||||
expect(agentCommandNeedsConfirmation('medium', 'strict')).toBe(true)
|
||||
expect(agentCommandNeedsConfirmation('medium', 'balanced')).toBe(false)
|
||||
expect(agentCommandNeedsConfirmation('high', 'balanced')).toBe(true)
|
||||
expect(agentCommandNeedsConfirmation('high', 'permissive')).toBe(false)
|
||||
expect(agentCommandNeedsConfirmation('critical', 'permissive')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Agent analyze_output tool', () => {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { resolveTerminalInputTargets } from '../../src/utils/terminalPanes'
|
||||
import {
|
||||
resolveTerminalInputTargets,
|
||||
shouldBroadcastTerminalInput,
|
||||
} from '../../src/utils/terminalPanes'
|
||||
|
||||
const panes = [
|
||||
{ id: 'left', shellId: 'shell-1' },
|
||||
@@ -23,4 +26,11 @@ describe('terminal pane input routing', () => {
|
||||
expect(resolveTerminalInputTargets(panes, 'starting', false)).toEqual([])
|
||||
expect(resolveTerminalInputTargets(panes, 'missing', false)).toEqual([])
|
||||
})
|
||||
|
||||
it('never broadcasts input originating from a local terminal', () => {
|
||||
expect(shouldBroadcastTerminalInput(true, true, 'local')).toBe(false)
|
||||
expect(shouldBroadcastTerminalInput(true, true, 'ssh-connection')).toBe(false)
|
||||
expect(shouldBroadcastTerminalInput(true, false, 'ssh-connection')).toBe(true)
|
||||
expect(shouldBroadcastTerminalInput(true, false, null)).toBe(false)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user