Files
orca/src/main/powershell-osc133-bootstrap.test.ts
T
0c0367ea88 feat(agents): native Xiaomi MiMo Code support (#6239)
* feat(agents): native Xiaomi MiMo Code support

Add mimo-code TUI agent (detect mimo, --prompt, --session resume).
Inject MIMOCODE_HOME overlay and /hook/mimo-code status plugin on mimo
launch when agent status hooks are enabled; restore via shell-ready
wrappers. Reuse OpenCode-family hook normalization in the listener.

SSH remote MiMo hook overlays are not included (local/daemon first).

Closes #6220

* fix(mimo): remirror overlay config idempotently

rmSync overlay config before mirror so a second mimo launch does not
hit EEXIST in mirrorEntry and fall back to the user MIMOCODE_HOME.

* review: harden mimo code support

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Doan Bac Tam <24356000+doanbactam@users.noreply.github.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-06-24 00:17:49 -07:00

40 lines
1.7 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
encodePowerShellCommand,
getPowerShellOsc133Bootstrap
} from './powershell-osc133-bootstrap'
describe('PowerShell OSC 133 bootstrap', () => {
it('wraps prompt/readline without bypassing profiles or execution policy', () => {
const script = getPowerShellOsc133Bootstrap()
expect(script).toContain('[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()')
expect(script).toContain('ORCA_OPENCODE_CONFIG_DIR')
expect(script).toContain('ORCA_MIMOCODE_HOME')
expect(script).not.toContain('ORCA_PI_CODING_AGENT_DIR')
expect(script).not.toContain('ORCA_OMP_CODING_AGENT_DIR')
expect(script).toContain('ORCA_OMP_STATUS_EXTENSION')
expect(script).toContain('function Global:omp')
expect(script).toContain('--extension $env:ORCA_OMP_STATUS_EXTENSION')
expect(script).toContain('ORCA_CODEX_HOME')
expect(script).toContain('function Global:prompt')
expect(script).toContain('function Global:PSConsoleHostReadLine')
expect(script).toContain('Esc = [char]27')
expect(script).toContain('Bel = [char]7')
expect(script).toContain(')]133;D;$fakeExitCode$(')
expect(script).toContain(')]133;A$(')
expect(script).toContain(')]133;B$(')
expect(script).toContain(')]133;C$(')
expect(script).not.toContain('`e]133')
expect(script).not.toContain('$PROFILE')
expect(script).not.toContain('ExecutionPolicy')
expect(script).not.toContain('NoProfile')
})
it('encodes commands as UTF-16LE base64 for PowerShell -EncodedCommand', () => {
expect(encodePowerShellCommand('Write-Output ok')).toBe(
Buffer.from('Write-Output ok', 'utf16le').toString('base64')
)
})
})