Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

538 B
Raw Blame
/** Host-owned /goal semantics shared by Desktop and Mobile. */
export type GoalCommand =
  | { action: 'open-dialog' }
  | { action: 'clear' }
  | { action: 'set'; objective: string };

const CLEAR_ALIASES = new Set(['clear', 'stop', 'off', 'cancel', 'reset', 'none']);

export function parseGoalCommand(args: string): GoalCommand {
  const objective = args.trim();
  if (!objective) return { action: 'open-dialog' };
  if (CLEAR_ALIASES.has(objective.toLowerCase())) return { action: 'clear' };
  return { action: 'set', objective };
}