Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

6.2 KB
Raw Blame
// The sentences a chat notice is made of, each whole so desktop can translate it on its own.

import type { AgentSessionFailureFact } from './agent-session-failure'
import {
  AGENT_STARTING,
  AGENT_STILL_WORKING,
  BACKGROUND_TASKS_RUNNING,
  QUIT_TERMINAL_AGENT,
  START_NEW_CHAT,
  TERMINAL_AGENT_HOLDS_CHAT,
  WAIT_FOR_BACKGROUND_TASKS,
  WAIT_FOR_START
} from './agent-session-failure-copy'
import type {
  AgentSessionFailureSurface,
  AgentSessionFailureWordsContext
} from './agent-session-failure-words'

/** Translate whole sentences on desktop with English fallbacks; mobile displays them directly. */
export const AGENT_SESSION_WRITE_NOTICE_COPY = {
  notDoneReadHistory: "This chat's history couldn't be loaded.",
  notDoneSend: 'Your message was not sent.',
  tryAgainComposerSend: 'Send it again.',
  messageNotSaved: "Couldn't save your message.",
  notDoneStop: "The agent wasn't stopped.",
  notDoneStopTask: "The background task wasn't stopped.",
  notDoneStopTasks: "The background tasks weren't stopped.",
  notDoneAnswer: 'Your answer was not sent.',
  notDoneOption: "The setting wasn't changed.",
  notDoneCommand: "The command didn't run.",
  notDoneGoalChangeIncomplete: "Couldn't finish changing the goal. Check the chat.",
  notDoneQueuedEdit: "Your edit wasn't saved.",
  restartFailed: "The agent couldn't restart.",
  capacity:
    'Orca on the computer running this chat has hit a request limit. Update Orca there, then try again.',
  outcomeUnknown: "Orca couldn't confirm what happened. Check the chat.",
  sendOutcomeLost:
    "Orca couldn't confirm your message reached the agent. Check the chat, then send it again if needed.",
  continuationSuperseded: 'This chat has moved on. Check the latest messages before continuing.',
  questionChanged: 'This question was already answered or has changed.',
  cancelNotSaved: "Couldn't cancel this question or approval.",
  historyUnreadable: "Orca couldn't read this chat's saved history.",
  historyUnusable: 'Unable to load this chat.',
  historyUnavailable: "Orca couldn't open this chat's history right now.",
  savedByNewerOrca: 'Chats were saved by a newer Orca.',
  updateOrcaToKeepUsing: 'Update Orca to keep using them.',
  chatSavedByNewerOrca: 'This chat was saved by a newer Orca.',
  updateOrcaToOpenChat: 'Update Orca to open it.',
  unsupported:
    'This needs a newer Orca on the computer running this chat. Update Orca there, then try again.',
  notAvailable: "This isn't available in this chat.",
  cannotRunHere: "Orca can't run this agent in a chat here.",
  unreachable: "Orca couldn't reach the agent.",
  recordFailed: "Orca couldn't save this to the chat's history.",
  attachmentExpired: 'This attachment expired.',
  reattachFile: 'Remove it and attach it again.',
  conversationCleared: 'This conversation has been cleared.',
  openCurrentConversation: 'Open the current conversation to continue.',
  clearUnfinished: "The last /clear didn't finish.",
  commandRunning: 'A /compact or /clear is still running.',
  waitForCommand: 'Wait for the /compact or /clear to finish.',
  agentStarting: AGENT_STARTING,
  waitForStart: WAIT_FOR_START,
  turnActive: 'The agent is still responding.',
  waitForTurn: 'Wait for the agent to finish responding, or stop it.',
  promptPending: 'The agent is waiting for an answer to a question or approval.',
  answerFirst: 'Answer the question or approval first.',
  backgroundTasksRunning: BACKGROUND_TASKS_RUNNING,
  waitForBackgroundTasks: WAIT_FOR_BACKGROUND_TASKS,
  messagesUnsettled: "A message you sent earlier isn't confirmed yet.",
  settleEarlierMessage: 'Wait for your earlier message to go through, or retry it.',
  agentStillWorking: AGENT_STILL_WORKING,
  runClearWhenDone: "Run /clear when it's done.",
  clearAfterAnswer: "Answer the agent's question or approval, then run /clear.",
  runCompactWhenDone: "Run /compact when it's done.",
  compactAfterAnswer: "Answer the agent's question or approval, then run /compact.",
  clearAfterRetry: 'Retry your earlier message, then run /clear.',
  compactAfterRetry: 'Retry your earlier message, then run /compact.',
  clearAfterSending: 'Your earlier message is still being sent. Run /clear once it has gone.',
  compactAfterSending: 'Your earlier message is still being sent. Run /compact once it has gone.',
  pendingWork: 'Wait for pending work and messages to finish before using this command.',
  queueTooLarge: 'Too much text is waiting in the queue.',
  shrinkQueue: 'Delete a queued message, or wait for one to go through, then try again.',
  messageTooLarge: 'It is over the 256 KB limit for one message.',
  shortenMessage: 'Shorten or split it, then send it again.',
  optionRejected: "The agent didn't accept this setting.",
  goalsUnsupported: "This agent doesn't support goals.",
  agentRefused: 'The agent turned this down.',
  ownerUnproven: 'The previous agent in this chat may still be running.',
  reopenChat: 'Reopen the chat to check again.',
  terminalAgentHoldsChat: TERMINAL_AGENT_HOLDS_CHAT,
  quitTerminalAgent: QUIT_TERMINAL_AGENT,
  hostReconciling: 'Orca is still checking on this chat after restarting.',
  waitMoment: 'Wait a moment.',
  recordUnreadable: "Orca couldn't read this chat's saved state.",
  chatNotFound: "Orca can't find this chat.",
  startNewChat: START_NEW_CHAT,
  tryAgain: 'Try again.'
} as const

export type AgentSessionWriteNoticeSentence = keyof typeof AGENT_SESSION_WRITE_NOTICE_COPY
/** A failure fact, worded where it is shown so desktop can say it in the reader's language. */
export type AgentSessionWriteNoticeFailurePart = {
  failure: AgentSessionFailureFact
  surface: AgentSessionFailureSurface
  context: AgentSessionFailureWordsContext
}
/** Translate each notice sentence independently; text is provider/host wording without a typed fact. */
export type AgentSessionWriteNoticePart =
  | AgentSessionWriteNoticeSentence
  | { text: string }
  | AgentSessionWriteNoticeFailurePart

/** Causes that already say the history can't be read here, so no sentence after them says it
 *  again. */
export const AGENT_SESSION_HISTORY_UNREAD_CAUSES: ReadonlySet<AgentSessionWriteNoticeSentence> =
  new Set([
    'historyUnusable',
    'historyUnavailable',
    'historyUnreadable',
    'savedByNewerOrca',
    'chatSavedByNewerOrca'
  ])