Skip to content

πŸ™Œ OpenHands: AI-Driven Development

3.7 KB
Raw Blame
import { SlashCommandItem } from "#/hooks/chat/use-slash-command";

export const JSON_VIEW_THEME = {
  base00: "transparent", // background
  base01: "var(--cool-grey-900)", // lighter background
  base02: "var(--cool-grey-700)", // selection background
  base03: "var(--cool-grey-600)", // comments, invisibles
  base04: "var(--cool-grey-500)", // dark foreground
  base05: "var(--cool-grey-200)", // default foreground
  base06: "var(--cool-grey-100)", // light foreground
  base07: "#ffffff", // light background
  base08: "#ff5370", // variables, red
  base09: "#f78c6c", // integers, orange
  base0A: "#ffcb6b", // booleans, yellow
  base0B: "#c3e88d", // strings, green
  base0C: "#89ddff", // support, cyan
  base0D: "#82aaff", // functions, blue
  base0E: "#c792ea", // keywords, purple
  base0F: "#ff5370", // deprecated, red
};

export const PRODUCT_URL = {
  PRODUCTION: "https://app.all-hands.dev",
};

export const SETTINGS_FORM = {
  LABEL_CLASSNAME: "text-[11px] font-medium leading-4 tracking-[0.11px]",
};

// Chat input constants
export const CHAT_INPUT = {
  HEIGHT_THRESHOLD: 100, // Height in pixels when suggestions should be hidden
};

// UI tolerance constants
export const EPS = 1.5; // px tolerance for "near min" height comparisons

/** The /btw slash command β€” asks a side question via the ask_agent endpoint. */
export const BTW_COMMAND = "/btw";

/** The /model slash command β€” lists or switches the conversation's LLM profile. */
export const MODEL_COMMAND = "/model";

/** The /goal slash command β€” drives the agent toward an objective, judging completion each round. */
export const GOAL_COMMAND = "/goal";

/** The /plan slash command β€” switches the conversation into Plan mode. */
export const PLAN_COMMAND = "/plan";

/** The /code slash command β€” switches the conversation back to Code mode. */
export const CODE_COMMAND = "/code";

/** Built-in slash commands surfaced in the menu for V1 conversations. */
export const BUILT_IN_COMMANDS: SlashCommandItem[] = [
  {
    skill: {
      name: "new",
      type: "agentskills",
      source: null,
      content: "Creates a new conversation using the same runtime",
      triggers: ["/new"],
    },
    command: "/new",
  },
  {
    skill: {
      name: "btw",
      type: "agentskills",
      source: null,
      content: "Ask the agent a side question without derailing the main task",
      triggers: [BTW_COMMAND],
    },
    command: BTW_COMMAND,
  },
  {
    skill: {
      name: "model",
      type: "agentskills",
      source: null,
      content:
        "List saved LLM profiles, or switch the conversation LLM profile with /model <name>",
      triggers: [MODEL_COMMAND],
    },
    command: MODEL_COMMAND,
  },
  {
    skill: {
      name: "goal",
      type: "agentskills",
      source: null,
      content:
        "Drive the agent toward an objective until a judge says it's done β€” /goal <objective> or /goal --max <n> <objective>",
      triggers: [GOAL_COMMAND],
    },
    command: GOAL_COMMAND,
  },
  {
    skill: {
      name: "plan",
      type: "agentskills",
      source: null,
      content:
        "Switch the conversation into Plan mode, or start planning immediately with /plan <task>",
      triggers: [PLAN_COMMAND],
    },
    command: PLAN_COMMAND,
  },
  {
    skill: {
      name: "code",
      type: "agentskills",
      source: null,
      content:
        "Switch the conversation back to Code mode, or resume immediately with /code <task>",
      triggers: [CODE_COMMAND],
    },
    command: CODE_COMMAND,
  },
];

// Skill content metadata prefixes
export const METADATA_PREFIXES: readonly string[] = [
  "The following information has been included",
  "It may or may not be relevant",
  "Skill location:",
  "(Use this path to resolve",
];