Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

train A8b: keep server/index.ts at main's line count

milind-sonie5b5b101f450
diff --git a/server/index.ts b/server/index.ts
index cb449caac0..0e7e90e946 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -503,8 +503,7 @@ import { keepTransient, lazyClaimFailedText, lazyClaimRetryText, reclaimAutoVm,
import { CONTROL_ACT_WITHIN_MS, CONTROL_HANDED_BACK, CONTROL_NOT_READY, CONTROL_WAIT_MS, controlRefusal, type ControlState } from "./control-client.ts";
import { computerFreeAfterText, computerParkedRefusal, computerParkedText, computerPersonAwayText, computerStoppedWaitingText, computerWaitingText, type ComputerHolder } from "./computer-wait.ts"; import { createComputerGateAnswers } from "./host/computer-gate-answers.ts";
import { modelContextWindow } from "./model-context-window.ts";
-import { browserIsThePlace, chosenPin, cloudPlaceRefusal, computerSelectionPrompt, computerSkippedNote, computerToolsRefusal, handoffUsesOwnCloud, isHandedWork, failedOnHostPath, openBrowserBeside, ownCloudStateWithin, parseSurface, pinSource, PlaceUnavailableError, placeUnavailable, resolveSurface, surfaceLabel, surfaceOfComputerKind, surfacePrompt, thisComputerSwitch, whereWorksControl, type ComputerWant, type PlaceSource, type Surface } from "./surface.ts";
-import { chatComputer, runCloudComputerOwner, runComputerPin, type RunCloudComputerDeps } from "./routine-computer.ts"; import type { RoutineComputer } from "../shared/routines.ts";
+import { browserIsThePlace, chosenPin, cloudPlaceRefusal, computerSelectionPrompt, computerSkippedNote, computerToolsRefusal, handoffUsesOwnCloud, isHandedWork, failedOnHostPath, openBrowserBeside, ownCloudStateWithin, parseSurface, pinSource, PlaceUnavailableError, placeUnavailable, resolveSurface, surfaceLabel, surfaceOfComputerKind, surfacePrompt, thisComputerSwitch, whereWorksControl, type ComputerWant, type PlaceSource, type Surface } from "./surface.ts"; import { chatComputer, runCloudComputerOwner, runComputerPin, type RunCloudComputerDeps } from "./routine-computer.ts"; import type { RoutineComputer } from "../shared/routines.ts";
import { cloudRefusal, type PlaceRow } from "../shared/place-view.ts";
import { cloudFailureOf, cloudLimitFields, cloudLimitText } from "./boat-limit.ts";
import {
@@ -5932,8 +5931,7 @@ function turnSurfacePlan(bot: BotRecord, runOn?: RoutineRunOn, threadId?: string
});
}
-/** `pinned`: the computer a run's new conversation will be pinned to, before that conversation exists. */
-function turnProvider(bot: BotRecord, runOn?: RoutineRunOn, threadId?: string, pinned?: RoutineComputer): RemoteComputerProvider | null {
+/** `pinned`: the computer a run's new conversation will be pinned to, before that conversation exists. */ function turnProvider(bot: BotRecord, runOn?: RoutineRunOn, threadId?: string, pinned?: RoutineComputer): RemoteComputerProvider | null {
if (runOn === "cloud" || inheritedTeamComputer(bot)) return "box";
const wants = turnSurfacePlan(bot, runOn, threadId, false, pinned).computer;
if (wants !== undefined && wants !== "cloud") return null;
@@ -8681,8 +8679,7 @@ routines = new RoutineManager({
// On a Cloud home the routine's writer opens a run's conversation; a webhook run is the owner's, but its payload never reaches the lent Mac.
const task = store.createTask(botId, title, false, undefined, undefined, undefined, routineThreadModel(run && routines?.listRoutines().find((routine) => routine.id === run.routineId), routineModelChecks), undefined,
CLOUD_HOME && run ? (created) => threadStarters.set(created.threadId, run.triggerSource === "webhook" ? CLOUD_OWNER_KEY! : routineOpener(run.routineId)) : undefined);
- if (task && run && outsideEvent(run)) outsideLineage.mark(task.threadId);
- const pin = task && run ? runComputerPin(run) : undefined; if (task && pin) store.patchTask(botId, task.threadId, pin);
+ if (task && run && outsideEvent(run)) outsideLineage.mark(task.threadId); const pin = task && run ? runComputerPin(run) : undefined; if (task && pin) store.patchTask(botId, task.threadId, pin);
return task;
},
joinConversation: runConversation, createGoalTask: (groupId, title) => store.createGroupTask(groupId, title, false),