mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 09:07:40 +00:00
* fix(native-chat): honor saved agent launch commands and arguments * fix(test): retain provider import after syncing main * fix(native-chat): preserve launch arguments and explain invalid settings * refactor(native-chat): require the current launch arguments source * fix(native-chat): require saved arguments when installing the runtime * fix(native-chat): show saved argument refusals beside launch retry * fix: ship saved-argument error messages in every locale * test: align model discovery with executable overrides * chore: drop the local pnpm install lockfile block
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
/** Orca's validated saved Arguments refusal. The option has no value or user-authored operand. */
|
|
export type AgentSessionArgumentProblem = {
|
|
agent: 'Codex' | 'Claude'
|
|
option: string
|
|
problem: 'unsupportedOption' | 'missingValue' | 'multipleValues' | 'positionalPrompt'
|
|
}
|
|
|
|
export function readAgentSessionArgumentProblem(
|
|
value: unknown
|
|
): AgentSessionArgumentProblem | undefined {
|
|
if (
|
|
typeof value !== 'object' ||
|
|
value === null ||
|
|
Array.isArray(value) ||
|
|
!('agent' in value) ||
|
|
!('problem' in value) ||
|
|
!('option' in value)
|
|
) {
|
|
return undefined
|
|
}
|
|
const agent = value.agent
|
|
const problem = value.problem
|
|
const option = value.option
|
|
if (
|
|
(agent !== 'Codex' && agent !== 'Claude') ||
|
|
(problem !== 'unsupportedOption' &&
|
|
problem !== 'missingValue' &&
|
|
problem !== 'multipleValues' &&
|
|
problem !== 'positionalPrompt') ||
|
|
typeof option !== 'string' ||
|
|
(problem === 'positionalPrompt'
|
|
? option !== 'prompt'
|
|
: !/^(?:--[a-zA-Z][a-zA-Z0-9-]{0,63}|-[a-zA-Z]|--\?)$/.test(option))
|
|
) {
|
|
return undefined
|
|
}
|
|
return { agent, option, problem }
|
|
}
|