feat: carry archive UI label hard cut updates
This commit is contained in:
@@ -83,7 +83,6 @@ export function createCli(): Command {
|
||||
.option('--image <path>', 'Attach image(s) to the initial prompt (can be used multiple times)', collectMultiple, [])
|
||||
.option('--cwd <path>', 'Working directory (default: current)')
|
||||
.option('--label <key=value>', 'Add label(s) to the agent (can be used multiple times)', collectMultiple, [])
|
||||
.option('--ui', 'Mark as UI agent (equivalent to --label ui=true)')
|
||||
.option('--output-schema <schema>', 'Output JSON matching the provided schema file path or inline JSON schema')
|
||||
.option('--json', 'Output in JSON format')
|
||||
.option('--host <host>', 'Daemon host:port (default: localhost:6767)')
|
||||
|
||||
@@ -44,7 +44,6 @@ export function createAgentCommand(): Command {
|
||||
.option('--mode <mode>', 'Provider-specific mode (e.g., plan, default, bypass)')
|
||||
.option('--cwd <path>', 'Working directory (default: current)')
|
||||
.option('--label <key=value>', 'Add label(s) to the agent (can be used multiple times)', collectMultiple, [])
|
||||
.option('--ui', 'Mark as UI agent (equivalent to --label ui=true)')
|
||||
.option('--output-schema <schema>', 'Output JSON matching the provided schema file path or inline JSON schema')
|
||||
.option('--json', 'Output in JSON format')
|
||||
.option('--host <host>', 'Daemon host:port (default: localhost:6767)')
|
||||
|
||||
@@ -43,7 +43,6 @@ export interface AgentRunOptions extends CommandOptions {
|
||||
image?: string[]
|
||||
cwd?: string
|
||||
label?: string[]
|
||||
ui?: boolean
|
||||
outputSchema?: string
|
||||
}
|
||||
|
||||
@@ -265,9 +264,7 @@ export async function runRunCommand(
|
||||
}
|
||||
: undefined
|
||||
|
||||
// Build labels from --label and --ui flags
|
||||
// --ui is syntactic sugar for --label ui=true
|
||||
// If explicit --label ui=... is provided, it takes precedence over --ui
|
||||
// Build labels from --label flags
|
||||
const labels: Record<string, string> = {}
|
||||
if (options.label) {
|
||||
for (const labelStr of options.label) {
|
||||
@@ -285,10 +282,6 @@ export async function runRunCommand(
|
||||
labels[key] = value
|
||||
}
|
||||
}
|
||||
// Add ui=true if --ui flag is set and ui label not already set
|
||||
if (options.ui && !('ui' in labels)) {
|
||||
labels['ui'] = 'true'
|
||||
}
|
||||
|
||||
if (outputSchema) {
|
||||
let structuredAgent: AgentSnapshotPayload | null = null
|
||||
|
||||
@@ -61,6 +61,7 @@ try {
|
||||
assert(result.stdout.includes('--output-schema'), 'help should mention --output-schema option')
|
||||
assert(result.stdout.includes('--host'), 'help should mention --host option')
|
||||
assert(result.stdout.includes('<prompt>'), 'help should mention prompt argument')
|
||||
assert(!result.stdout.includes('--ui'), 'help should not mention removed --ui option')
|
||||
console.log('✓ run --help shows options\n')
|
||||
}
|
||||
|
||||
@@ -206,6 +207,17 @@ try {
|
||||
assert(result.stdout.includes('run'), 'help should mention run command')
|
||||
console.log('✓ paseo --help shows run command\n')
|
||||
}
|
||||
|
||||
// Test 14: run --ui is rejected (flag removed)
|
||||
{
|
||||
console.log('Test 14: run --ui is rejected')
|
||||
const result =
|
||||
await $`PASEO_HOST=localhost:${port} PASEO_HOME=${paseoHome} npx paseo run --ui "test prompt"`.nothrow()
|
||||
assert.notStrictEqual(result.exitCode, 0, 'should fail for removed --ui flag')
|
||||
const output = result.stdout + result.stderr
|
||||
assert(output.includes('unknown option'), 'should report unknown option for --ui')
|
||||
console.log('✓ run --ui is rejected\n')
|
||||
}
|
||||
} finally {
|
||||
// Clean up temp directory
|
||||
await rm(paseoHome, { recursive: true, force: true })
|
||||
|
||||
@@ -89,7 +89,7 @@ try {
|
||||
{
|
||||
console.log('Test 5: agent update accepts multi-label syntax')
|
||||
const result =
|
||||
await $`PASEO_HOST=localhost:${port} PASEO_HOME=${paseoHome} npx paseo agent update abc123 --label ui=true,area=frontend --label priority=high`.nothrow()
|
||||
await $`PASEO_HOST=localhost:${port} PASEO_HOME=${paseoHome} npx paseo agent update abc123 --label surface=workspace,area=frontend --label priority=high`.nothrow()
|
||||
const output = result.stdout + result.stderr
|
||||
assert(!output.includes('unknown option'), 'should accept --label flag')
|
||||
assert(!output.includes('error: option'), 'should not have option parsing error')
|
||||
|
||||
Reference in New Issue
Block a user