mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-13 20:09:55 +00:00
* feat(cursor): multitask slash, autoReview mode, native worktree/add-dir Close the highest-value Cursor Agent gaps for remote HAPI: expand ACP-safe slash pass-through (/multitask, worktree, add-dir, …), add autoReview permission mode (--auto-review spawn + mid-session slash), and route Cursor New Session worktrees through agent --worktree instead of HAPI sibling trees. Fixes #1013 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(cli): accept --mode autoReview for hapi cursor Align --mode parsing with CURSOR_PERMISSION_MODES so documented `hapi cursor --mode autoReview` enables Smart Auto instead of silently falling back to default. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { parseCursorCommandArgs } from './cursor'
|
|
|
|
describe('parseCursorCommandArgs', () => {
|
|
it('accepts --mode autoReview', () => {
|
|
expect(parseCursorCommandArgs(['--mode', 'autoReview']).permissionMode).toBe('autoReview')
|
|
})
|
|
|
|
it('accepts all Cursor permission modes via --mode', () => {
|
|
for (const mode of ['default', 'plan', 'ask', 'debug', 'autoReview', 'yolo'] as const) {
|
|
expect(parseCursorCommandArgs(['--mode', mode]).permissionMode).toBe(mode)
|
|
}
|
|
})
|
|
|
|
it('rejects invalid --mode values', () => {
|
|
expect(() => parseCursorCommandArgs(['--mode', 'not-a-mode'])).toThrow('Invalid --mode value')
|
|
expect(() => parseCursorCommandArgs(['--mode'])).toThrow('Invalid --mode value')
|
|
})
|
|
|
|
it('accepts --auto-review shorthand', () => {
|
|
expect(parseCursorCommandArgs(['--auto-review']).permissionMode).toBe('autoReview')
|
|
})
|
|
|
|
it('does not let --auto-review override an earlier --mode', () => {
|
|
expect(
|
|
parseCursorCommandArgs(['--mode', 'plan', '--auto-review']).permissionMode
|
|
).toBe('plan')
|
|
})
|
|
|
|
it('parses --cursor-worktree and --cursor-add-dir', () => {
|
|
const opts = parseCursorCommandArgs([
|
|
'--cursor-worktree',
|
|
'feature-x',
|
|
'--cursor-add-dir',
|
|
'../shared'
|
|
])
|
|
expect(opts.cursorWorktree).toBe('feature-x')
|
|
expect(opts.cursorAddDirs).toEqual(['../shared'])
|
|
})
|
|
})
|