MCPcopy Index your code
hub / github.com/MatterAIOrg/OrbCode / App

Function App

src/ui/App.tsx:294–1557  ·  view source on GitHub ↗
({
  initialView,
  initialPrompt,
  initialSession,
  systemPromptOverride,
  updateCheck,
}: {
  initialView?: "login" | "chat";
  initialPrompt?: string;
  initialSession?: SessionData;
  /** Optional override replacing the default system prompt (from `-s`). */
  systemPromptOverride?: string;
  /** Promise resolving to the latest-npm-version comparison; resolved after first paint. */
  updateCheck?: Promise<UpdateInfo>;
})

Source from the content-addressed store, hash-verified

292 : never;
293
294export function App({
295 initialView,
296 initialPrompt,
297 initialSession,
298 systemPromptOverride,
299 updateCheck,
300}: {
301 initialView?: "login" | "chat";
302 initialPrompt?: string;
303 initialSession?: SessionData;
304 /** Optional override replacing the default system prompt (from `-s`). */
305 systemPromptOverride?: string;
306 /** Promise resolving to the latest-npm-version comparison; resolved after first paint. */
307 updateCheck?: Promise<UpdateInfo>;
308}) {
309 const { exit } = useApp();
310 const [settings, setSettings] = useState<OrbCodeSettings>(() =>
311 loadSettings(),
312 );
313 const [view, setView] = useState<"login" | "chat">(
314 initialView ?? (getAuthToken(settings) ? "chat" : "login"),
315 );
316 const [updateInfo, setUpdateInfo] = useState<UpdateInfo | null>(null);
317
318 const [rows, setRows] = useState<Row[]>(() => [
319 {
320 kind: "header",
321 id: "header",
322 cwd: process.cwd(),
323 modelName: getModel(loadSettings().model).name,
324 },
325 ]);
326 const [busy, setBusy] = useState(false);
327 const [busyLabel, setBusyLabel] = useState("Thinking");
328 const [streamingReasoning, setStreamingReasoning] = useState("");
329 const [streamingText, setStreamingText] = useState("");
330 const [pendingApproval, setPendingApproval] =
331 useState<PendingApproval | null>(null);
332 const [pendingFollowup, setPendingFollowup] =
333 useState<PendingFollowup | null>(null);
334 // Set when the current project defines hooks that haven't been trusted yet;
335 // gates input until the user decides (project hooks run shell commands).
336 const [pendingHookTrust, setPendingHookTrust] = useState<{
337 commands: string[];
338 } | null>(null);
339 // FIFO queue of messages the user typed while the LLM was still streaming.
340 // Drained one-per-turn on each `turn-end` event so multi-step work can
341 // keep flowing without making the user wait for the previous response.
342 const [queuedMessages, setQueuedMessages] = useState<string[]>([]);
343 const [modelPickerOpen, setModelPickerOpen] = useState(false);
344 const [resumableSessions, setResumableSessions] = useState<
345 SessionData[] | null
346 >(null);
347 const [taskPickerSessions, setTaskPickerSessions] = useState<
348 SessionData[] | null
349 >(null);
350 const [linkManagerOpen, setLinkManagerOpen] = useState(false);
351 const [links, setLinks] = useState<LinkedRepo[]>([]);

Callers

nothing calls this directly

Calls 15

enableServerMethod · 0.95
getEnabledMethod · 0.95
getDisabledMethod · 0.95
snapshotMethod · 0.95
startMethod · 0.95
getPendingApprovalMethod · 0.95
loadSettingsFunction · 0.85
getAuthTokenFunction · 0.85
getModelFunction · 0.85
fetchProfileFunction · 0.85
fetchTaskTitleFunction · 0.85
setTerminalTitleFunction · 0.85

Tested by

no test coverage detected