This commit is contained in:
1 parent
c44c38f096
commit
0d0f592a54
16 files changed
+373
-180
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@t3tools/desktop",
|
||||
"version": "0.0.40",
|
||||
"version": "0.0.41-hermes.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "dist-electron/main.cjs",
|
||||
|
||||
@@ -63,6 +63,7 @@ import {
|
||||
} from "./features/settings/SettingsOpenSourceLicensesRouteScreen";
|
||||
import { SettingsProjectGroupingRouteScreen } from "./features/settings/SettingsProjectGroupingRouteScreen";
|
||||
import { SettingsProvidersRouteScreen } from "./features/settings/SettingsProvidersRouteScreen";
|
||||
import { SettingsHermesRouteScreen } from "./features/settings/SettingsHermesRouteScreen";
|
||||
import { UsageLimitAccountScreen } from "./features/usage/UsageLimitsPooled";
|
||||
import { UsageRouteScreen } from "./features/usage/UsageRouteScreen";
|
||||
import { SettingsRouteScreen } from "./features/settings/SettingsRouteScreen";
|
||||
@@ -172,6 +173,13 @@ const SettingsContentStack = createNativeStackNavigator({
|
||||
title: "Providers",
|
||||
},
|
||||
}),
|
||||
SettingsHermes: createNativeStackScreen({
|
||||
screen: SettingsHermesRouteScreen,
|
||||
linking: "hermes",
|
||||
options: {
|
||||
title: "Hermes",
|
||||
},
|
||||
}),
|
||||
SettingsEnvironmentNew: createNativeStackScreen({
|
||||
screen: ConnectionsNewRouteScreen,
|
||||
linking: "environment-new",
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
hermesRecord,
|
||||
hermesText,
|
||||
hermesArray,
|
||||
hermesErrorMessage,
|
||||
hermesPretty,
|
||||
hermesCronJobs,
|
||||
hermesCronEditor,
|
||||
@@ -43,11 +44,15 @@ import { environmentServerConfigsAtom } from "../../state/server";
|
||||
import { useAtomCommand } from "../../state/use-atom-command";
|
||||
import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { SymbolView } from "../../components/AppSymbol";
|
||||
|
||||
type Section = "chat" | "skills" | "memories" | "cron" | "logs";
|
||||
type Section = "skills" | "memories" | "cron" | "logs";
|
||||
const inputClass = "rounded-xl border border-border bg-sheet px-3 py-3 text-foreground";
|
||||
const HermesForegroundContext = createContext(true);
|
||||
|
||||
const prettyHermesCause = (cause: Cause.Cause<unknown>) => hermesErrorMessage(Cause.pretty(cause));
|
||||
|
||||
function Action({
|
||||
label,
|
||||
onPress,
|
||||
@@ -141,17 +146,13 @@ function Detail({
|
||||
}
|
||||
|
||||
export function HermesMobileWorkspace({ mode = "full" }: { mode?: "full" | "list" | "detail" }) {
|
||||
const navigation = useNavigation();
|
||||
const configs = useAtomValue(environmentServerConfigsAtom);
|
||||
const { savedConnectionsById } = useSavedRemoteConnections();
|
||||
const saved = useAtomValue(hermesConnectionAtom);
|
||||
const setConnection = useAtomSet(hermesConnectionAtom);
|
||||
const selection = useAtomValue(hermesSelectionAtom);
|
||||
const setSelection = useAtomSet(hermesSelectionAtom);
|
||||
const [sectionState, setSectionState] = useState<{ session: typeof selection; section: Section }>(
|
||||
{ session: selection, section: "chat" },
|
||||
);
|
||||
const section = sectionState.session === selection ? sectionState.section : "chat";
|
||||
const setSection = (section: Section) => setSectionState({ session: selection, section });
|
||||
const [foreground, setForeground] = useState(AppState.currentState === "active");
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
@@ -213,7 +214,7 @@ export function HermesMobileWorkspace({ mode = "full" }: { mode?: "full" | "list
|
||||
id: hermesText(hermesRecord(result.value.data).stored_session_id),
|
||||
title: "New Hermes chat",
|
||||
});
|
||||
else if (AsyncResult.isFailure(result)) setError(Cause.pretty(result.cause));
|
||||
else if (AsyncResult.isFailure(result)) setError(prettyHermesCause(result.cause));
|
||||
};
|
||||
const createRequested = useEffectEvent(create);
|
||||
const canCreate = mode !== "detail" && connection !== null && foreground && !busy;
|
||||
@@ -228,6 +229,29 @@ export function HermesMobileWorkspace({ mode = "full" }: { mode?: "full" | "list
|
||||
<View className="flex-1 bg-screen">
|
||||
{mode !== "detail" && (
|
||||
<View className="gap-2 px-3 pb-2">
|
||||
{mode === "list" && (
|
||||
<View className="flex-row items-center justify-between py-1">
|
||||
<Text className="text-lg font-t3-bold text-foreground">Hermes</Text>
|
||||
<Pressable
|
||||
accessibilityLabel="Open Hermes settings"
|
||||
accessibilityRole="button"
|
||||
className="size-11 items-center justify-center rounded-full bg-subtle"
|
||||
onPress={() =>
|
||||
navigation.navigate("SettingsSheet", {
|
||||
screen: "SettingsContent",
|
||||
params: { screen: "SettingsHermes" },
|
||||
})
|
||||
}
|
||||
>
|
||||
<SymbolView
|
||||
name="gearshape"
|
||||
size={18}
|
||||
tintColorClassName="accent-icon"
|
||||
type="monochrome"
|
||||
/>
|
||||
</Pressable>
|
||||
</View>
|
||||
)}
|
||||
{choices.length > 1 && (
|
||||
<ScrollView horizontal>
|
||||
<View className="flex-row gap-2">
|
||||
@@ -252,32 +276,14 @@ export function HermesMobileWorkspace({ mode = "full" }: { mode?: "full" | "list
|
||||
{mode === "full" && selection && (
|
||||
<Action label="Sessions" onPress={() => setSelection(null)} />
|
||||
)}
|
||||
<Action
|
||||
label={busy ? "Starting Hermes…" : "New task"}
|
||||
disabled={!connection || busy}
|
||||
onPress={() => void create()}
|
||||
/>
|
||||
{(mode !== "full" || Platform.OS !== "android") && (
|
||||
<Action
|
||||
label={busy ? "Starting Hermes…" : "New task"}
|
||||
disabled={!connection || busy}
|
||||
onPress={() => void create()}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
{mode === "full" && !selection && (
|
||||
<ScrollView horizontal>
|
||||
<View className="flex-row gap-2">
|
||||
{(["chat", "skills", "memories", "cron", "logs"] as const).map((item) => (
|
||||
<Action
|
||||
key={item}
|
||||
label={
|
||||
item === "chat"
|
||||
? "Sessions"
|
||||
: item === "cron"
|
||||
? "Cron jobs"
|
||||
: item[0]?.toUpperCase() + item.slice(1)
|
||||
}
|
||||
selected={section === item}
|
||||
onPress={() => setSection(item)}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</ScrollView>
|
||||
)}
|
||||
{error && <ErrorDetail message={error} />}
|
||||
</View>
|
||||
)}
|
||||
@@ -285,51 +291,24 @@ export function HermesMobileWorkspace({ mode = "full" }: { mode?: "full" | "list
|
||||
<Text className="p-5 text-foreground">
|
||||
Enable Hermes in Settings → Providers on a connected environment. No project is needed.
|
||||
</Text>
|
||||
) : mode === "list" || (mode === "full" && !selection && section === "chat") ? (
|
||||
) : mode === "list" || (mode === "full" && !selection) ? (
|
||||
<HermesSessionList
|
||||
key={`${target.environmentId}:${target.target.instanceId}`}
|
||||
connection={connection ?? target}
|
||||
onOpen={() => setSection("chat")}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<Text numberOfLines={1} className="px-3 py-2 text-lg font-semibold text-foreground">
|
||||
{selection?.title ?? "Hermes"}
|
||||
</Text>
|
||||
{(mode === "detail" || selection) && (
|
||||
<View>
|
||||
<ScrollView
|
||||
horizontal
|
||||
showsHorizontalScrollIndicator={false}
|
||||
contentContainerStyle={{ paddingHorizontal: 12, gap: 8, paddingBottom: 8 }}
|
||||
>
|
||||
{(["chat", "skills", "memories", "cron", "logs"] as const).map((item) => (
|
||||
<Action
|
||||
key={item}
|
||||
label={item === "cron" ? "Cron jobs" : item[0]?.toUpperCase() + item.slice(1)}
|
||||
selected={section === item}
|
||||
onPress={() => setSection(item)}
|
||||
/>
|
||||
))}
|
||||
</ScrollView>
|
||||
</View>
|
||||
)}
|
||||
{section === "chat" ? (
|
||||
selection ? (
|
||||
<HermesChat
|
||||
key={`${selection.connection.environmentId}:${selection.connection.target.instanceId}:${selection.connection.target.profile}:${selection.id}`}
|
||||
connection={selection.connection}
|
||||
id={selection.id}
|
||||
/>
|
||||
) : (
|
||||
<Text className="p-5 text-foreground">Choose a session or start a new task.</Text>
|
||||
)
|
||||
) : (
|
||||
<HermesManager
|
||||
key={`${target.environmentId}:${target.target.instanceId}:${section}`}
|
||||
connection={target}
|
||||
section={section}
|
||||
{selection ? (
|
||||
<HermesChat
|
||||
key={`${selection.connection.environmentId}:${selection.connection.target.instanceId}:${selection.connection.target.profile}:${selection.id}`}
|
||||
connection={selection.connection}
|
||||
id={selection.id}
|
||||
/>
|
||||
) : (
|
||||
<Text className="p-5 text-foreground">Choose a session or start a new task.</Text>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
@@ -338,13 +317,94 @@ export function HermesMobileWorkspace({ mode = "full" }: { mode?: "full" | "list
|
||||
);
|
||||
}
|
||||
|
||||
function HermesSessionList({
|
||||
connection,
|
||||
onOpen,
|
||||
}: {
|
||||
connection: HermesConnection;
|
||||
onOpen: () => void;
|
||||
}) {
|
||||
export function HermesSettingsMobileWorkspace() {
|
||||
const configs = useAtomValue(environmentServerConfigsAtom);
|
||||
const { savedConnectionsById } = useSavedRemoteConnections();
|
||||
const saved = useAtomValue(hermesConnectionAtom);
|
||||
const setConnection = useAtomSet(hermesConnectionAtom);
|
||||
const [section, setSection] = useState<Section>("skills");
|
||||
const [foreground, setForeground] = useState(AppState.currentState === "active");
|
||||
const choices = hermesConnections(
|
||||
configs,
|
||||
new Map(
|
||||
Object.values(savedConnectionsById).map((connection) => [
|
||||
connection.environmentId,
|
||||
connection.environmentLabel,
|
||||
]),
|
||||
),
|
||||
);
|
||||
const connection =
|
||||
choices.find(
|
||||
(choice) =>
|
||||
choice.environmentId === saved?.environmentId &&
|
||||
choice.target.instanceId === saved.target.instanceId,
|
||||
) ??
|
||||
choices[0] ??
|
||||
null;
|
||||
useEffect(() => {
|
||||
const listener = AppState.addEventListener("change", (state) =>
|
||||
setForeground(state === "active"),
|
||||
);
|
||||
return () => listener.remove();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (
|
||||
connection &&
|
||||
(saved?.environmentId !== connection.environmentId ||
|
||||
saved.target.instanceId !== connection.target.instanceId)
|
||||
)
|
||||
setConnection(connection);
|
||||
}, [connection, saved, setConnection]);
|
||||
return (
|
||||
<HermesForegroundContext value={foreground}>
|
||||
<View className="flex-1 bg-screen">
|
||||
<View className="gap-3 border-b border-border px-3 py-3">
|
||||
{choices.length > 1 && (
|
||||
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
||||
<View className="flex-row gap-2">
|
||||
{choices.map((choice) => (
|
||||
<Action
|
||||
key={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
label={choice.label}
|
||||
selected={choice === connection}
|
||||
onPress={() => setConnection(choice)}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</ScrollView>
|
||||
)}
|
||||
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
||||
<View className="flex-row gap-2">
|
||||
{(["skills", "memories", "cron", "logs"] as const).map((item) => (
|
||||
<Action
|
||||
key={item}
|
||||
label={
|
||||
item === "cron" ? "Cron jobs" : (item[0]?.toUpperCase() ?? "") + item.slice(1)
|
||||
}
|
||||
selected={section === item}
|
||||
onPress={() => setSection(item)}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
{connection ? (
|
||||
<HermesManager
|
||||
key={`${connection.environmentId}:${connection.target.instanceId}:${section}`}
|
||||
connection={connection}
|
||||
section={section}
|
||||
/>
|
||||
) : (
|
||||
<Text className="p-5 text-foreground">
|
||||
Enable Hermes in Settings → Providers on a connected environment.
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
</HermesForegroundContext>
|
||||
);
|
||||
}
|
||||
|
||||
function HermesSessionList({ connection }: { connection: HermesConnection }) {
|
||||
const foreground = useContext(HermesForegroundContext);
|
||||
const registry = useContext(RegistryContext);
|
||||
const query = (foreground ? hermes.live : hermes.read)({
|
||||
@@ -352,6 +412,7 @@ function HermesSessionList({
|
||||
input: { ...connection.target, resource: "sessions" },
|
||||
});
|
||||
const result = useAtomValue(query);
|
||||
const selection = useAtomValue(hermesSelectionAtom);
|
||||
const setSelection = useAtomSet(hermesSelectionAtom);
|
||||
const read = useAtomCommand(hermes.request, { reportFailure: false });
|
||||
const [older, setOlder] = useState<ReturnType<typeof hermesSessions>>([]);
|
||||
@@ -363,11 +424,11 @@ function HermesSessionList({
|
||||
<FlatList
|
||||
data={combined.filter((row) => row.title.toLowerCase().includes(search.toLowerCase()))}
|
||||
keyExtractor={(row) => `${row.profile}:${row.id}`}
|
||||
contentContainerStyle={{ padding: 12, gap: 8, flexGrow: 1 }}
|
||||
contentContainerStyle={{ paddingHorizontal: 12, flexGrow: 1 }}
|
||||
refreshing={false}
|
||||
onRefresh={() => registry.refresh(query)}
|
||||
ListHeaderComponent={
|
||||
<View className="gap-2 pb-2">
|
||||
<View className="gap-3 pb-3">
|
||||
<TextInput
|
||||
accessibilityLabel="Search Hermes sessions"
|
||||
placeholder="Search Hermes sessions"
|
||||
@@ -376,12 +437,9 @@ function HermesSessionList({
|
||||
onChangeText={setSearch}
|
||||
className={inputClass}
|
||||
/>
|
||||
<Text className="text-xs text-muted-foreground">
|
||||
Live Hermes sessions · updates every 5 seconds
|
||||
</Text>
|
||||
{AsyncResult.isFailure(result) && (
|
||||
<>
|
||||
<ErrorDetail message={Cause.pretty(result.cause)} />
|
||||
<ErrorDetail message={prettyHermesCause(result.cause)} />
|
||||
<HermesLogin connection={connection} onSuccess={() => registry.refresh(query)} />
|
||||
</>
|
||||
)}
|
||||
@@ -395,7 +453,7 @@ function HermesSessionList({
|
||||
: "No Hermes sessions. Use New task to start chatting."}
|
||||
</Text>
|
||||
}
|
||||
renderItem={({ item }) => (
|
||||
renderItem={({ item, index }) => (
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
onPress={() => {
|
||||
@@ -410,11 +468,10 @@ function HermesSessionList({
|
||||
id: item.id,
|
||||
title: item.title,
|
||||
});
|
||||
onOpen();
|
||||
}}
|
||||
className="min-h-16 rounded-xl bg-sheet p-3"
|
||||
className={`min-h-16 justify-center border-b border-separator px-3 py-2.5 active:bg-subtle ${selection?.id === item.id ? "bg-thread-selected" : ""} ${index === combined.length - 1 ? "border-b-0" : ""}`}
|
||||
>
|
||||
<Text numberOfLines={2} className="font-medium text-foreground">
|
||||
<Text numberOfLines={1} className="text-base font-t3-medium text-foreground">
|
||||
{item.title}
|
||||
</Text>
|
||||
<Text className="mt-1 text-xs text-muted-foreground">
|
||||
@@ -436,7 +493,7 @@ function HermesSessionList({
|
||||
});
|
||||
if (AsyncResult.isSuccess(next))
|
||||
setOlder((value) => [...value, ...hermesSessions(next.value.data)]);
|
||||
else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
/>
|
||||
) : null
|
||||
@@ -494,7 +551,7 @@ function HermesLogin({
|
||||
setPassword("");
|
||||
setBusy(false);
|
||||
if (AsyncResult.isSuccess(result)) onSuccess();
|
||||
else if (AsyncResult.isFailure(result)) setError(Cause.pretty(result.cause));
|
||||
else if (AsyncResult.isFailure(result)) setError(prettyHermesCause(result.cause));
|
||||
}}
|
||||
/>
|
||||
{error && <ErrorDetail message={error} />}
|
||||
@@ -540,7 +597,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
environmentId: connection.environmentId,
|
||||
input: { ...connection.target, action: "attach", id },
|
||||
}).then((next) => {
|
||||
if (active && AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
if (active && AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
});
|
||||
return () => {
|
||||
active = false;
|
||||
@@ -567,7 +624,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
setCommands([]);
|
||||
setOutput(action === "command" ? hermesPretty(next.value.data) : "");
|
||||
registry.refresh(query);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
};
|
||||
return (
|
||||
<KeyboardAvoidingView
|
||||
@@ -582,7 +639,9 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
keyboardShouldPersistTaps="handled"
|
||||
ListHeaderComponent={
|
||||
<View className="gap-2">
|
||||
{AsyncResult.isFailure(result) && <ErrorDetail message={Cause.pretty(result.cause)} />}
|
||||
{AsyncResult.isFailure(result) && (
|
||||
<ErrorDetail message={prettyHermesCause(result.cause)} />
|
||||
)}
|
||||
{messages.length === 100 && hasEarlier && (
|
||||
<Action
|
||||
label="Load earlier messages"
|
||||
@@ -600,7 +659,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
const page = hermesMessages(next.value.data);
|
||||
setOlder((value) => mergeHermesMessages(page, value, messages));
|
||||
setHasEarlier(page.length === 100);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
@@ -659,7 +718,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
fields: { requestId: request.id, response },
|
||||
},
|
||||
});
|
||||
if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
@@ -726,7 +785,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
if (AsyncResult.isSuccess(next)) {
|
||||
setCommands(hermesArray(hermesRecord(next.value.data).items));
|
||||
setCompletion({ input, replaceFrom: hermesRecord(next.value.data).replace_from });
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
@@ -828,7 +887,7 @@ function HermesManager({
|
||||
section,
|
||||
}: {
|
||||
connection: HermesConnection;
|
||||
section: Exclude<Section, "chat">;
|
||||
section: Section;
|
||||
}) {
|
||||
const foreground = useContext(HermesForegroundContext);
|
||||
const registry = useContext(RegistryContext);
|
||||
@@ -866,7 +925,7 @@ function HermesManager({
|
||||
if (AsyncResult.isSuccess(next)) {
|
||||
setEditor(null);
|
||||
registry.refresh(query);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
};
|
||||
return (
|
||||
<FlatList
|
||||
@@ -906,7 +965,9 @@ function HermesManager({
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
{AsyncResult.isFailure(result) && <ErrorDetail message={Cause.pretty(result.cause)} />}
|
||||
{AsyncResult.isFailure(result) && (
|
||||
<ErrorDetail message={prettyHermesCause(result.cause)} />
|
||||
)}
|
||||
{error && <ErrorDetail message={error} />}
|
||||
{section === "logs" && (
|
||||
<>
|
||||
@@ -1010,7 +1071,7 @@ function HermesManager({
|
||||
if (AsyncResult.isSuccess(next)) {
|
||||
const content = hermesText(hermesRecord(next.value.data).content);
|
||||
setEditor({ id, text: content, original: content });
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
/>
|
||||
{section === "cron" && (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as Arr from "effect/Array";
|
||||
import { useAtomValue } from "@effect/atom-react";
|
||||
import { conversationSourceAtom } from "@t3tools/client-runtime/hermes";
|
||||
import { useAtomSet, useAtomValue } from "@effect/atom-react";
|
||||
import { conversationSourceAtom, hermesNewSessionAtom } from "@t3tools/client-runtime/hermes";
|
||||
import { ConversationTabs, HermesMobileWorkspace } from "../hermes/HermesWorkspace";
|
||||
import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
|
||||
import * as Order from "effect/Order";
|
||||
@@ -31,6 +31,7 @@ import { getConnectionAwareBrandHeaderOptions } from "./WorkspaceConnectionTitle
|
||||
|
||||
export function HomeRouteScreen() {
|
||||
const conversationSource = useAtomValue(conversationSourceAtom);
|
||||
const requestHermesSession = useAtomSet(hermesNewSessionAtom);
|
||||
const { width: windowWidth } = useWindowDimensions();
|
||||
const { layout } = useAdaptiveWorkspaceLayout();
|
||||
const projects = useProjects();
|
||||
@@ -112,7 +113,7 @@ export function HomeRouteScreen() {
|
||||
// In split layouts the persistent sidebar IS the thread list — Home becomes
|
||||
// an empty detail pane so selecting a thread never transitions layouts.
|
||||
if (conversationSource === "hermes" && !layout.usesSplitView) {
|
||||
return (
|
||||
const content = (
|
||||
<View className="flex-1 bg-screen">
|
||||
<NativeStackScreenOptions
|
||||
options={{ title: "Hermes", headerShown: Platform.OS !== "android" }}
|
||||
@@ -127,7 +128,7 @@ export function HomeRouteScreen() {
|
||||
onPress: () =>
|
||||
navigation.navigate("SettingsSheet", {
|
||||
screen: "SettingsContent",
|
||||
params: { screen: "Settings" },
|
||||
params: { screen: "SettingsHermes" },
|
||||
}),
|
||||
},
|
||||
]}
|
||||
@@ -137,6 +138,13 @@ export function HomeRouteScreen() {
|
||||
<HermesMobileWorkspace />
|
||||
</View>
|
||||
);
|
||||
return Platform.OS === "android" ? (
|
||||
<AndroidHomeFabLayout onStartNewTask={() => requestHermesSession((value) => value + 1)}>
|
||||
{content}
|
||||
</AndroidHomeFabLayout>
|
||||
) : (
|
||||
content
|
||||
);
|
||||
}
|
||||
|
||||
if (layout.usesSplitView) {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { useNavigation } from "@react-navigation/native";
|
||||
import { Platform, View } from "react-native";
|
||||
|
||||
import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
|
||||
import { NativeStackScreenOptions } from "../../native/StackHeader";
|
||||
import { HermesSettingsMobileWorkspace } from "../hermes/HermesWorkspace";
|
||||
|
||||
export function SettingsHermesRouteScreen() {
|
||||
const navigation = useNavigation();
|
||||
return (
|
||||
<View className="flex-1 bg-screen">
|
||||
{Platform.OS === "android" ? (
|
||||
<>
|
||||
<NativeStackScreenOptions options={{ headerShown: false }} />
|
||||
<AndroidScreenHeader title="Hermes" onBack={() => navigation.goBack()} />
|
||||
</>
|
||||
) : null}
|
||||
<HermesSettingsMobileWorkspace />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -128,6 +128,7 @@ function LocalSettingsRouteScreen() {
|
||||
target="SettingsEnvironments"
|
||||
/>
|
||||
<SettingsRow icon="terminal" label="Providers" target="SettingsProviders" />
|
||||
<SettingsRow icon="gearshape.2" label="Hermes" target="SettingsHermes" />
|
||||
</SettingsSection>
|
||||
|
||||
<GeneralSettingsSection />
|
||||
@@ -512,6 +513,7 @@ function ConfiguredSettingsRouteScreen() {
|
||||
target="SettingsEnvironments"
|
||||
/>
|
||||
<SettingsRow icon="terminal" label="Providers" target="SettingsProviders" />
|
||||
<SettingsRow icon="gearshape.2" label="Hermes" target="SettingsHermes" />
|
||||
<SettingsSwitchRow
|
||||
icon="bell.badge"
|
||||
label="Device Notifications"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export type SettingsSheetTarget =
|
||||
| "SettingsEnvironments"
|
||||
| "SettingsProviders"
|
||||
| "SettingsHermes"
|
||||
| "SettingsArchive"
|
||||
| "SettingsAppearance"
|
||||
| "SettingsProjectGrouping"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "t3",
|
||||
"version": "0.0.41-hermes.1",
|
||||
"version": "0.0.41-hermes.2",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
hermesRecord,
|
||||
hermesText,
|
||||
hermesArray,
|
||||
hermesErrorMessage,
|
||||
hermesPretty,
|
||||
hermesCronJobs,
|
||||
hermesCronEditor,
|
||||
@@ -25,6 +26,8 @@ import { pendingHermesRequests } from "@t3tools/client-runtime/hermes";
|
||||
import { AsyncResult } from "effect/unstable/reactivity";
|
||||
import * as Cause from "effect/Cause";
|
||||
import { useContext, useEffect, useEffectEvent, useState } from "react";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { SettingsIcon } from "lucide-react";
|
||||
import { hermes } from "../../state/hermes";
|
||||
import { environmentServerConfigsAtom, primaryServerKeybindingsAtom } from "../../state/server";
|
||||
import { useEnvironments } from "../../state/environments";
|
||||
@@ -35,7 +38,9 @@ import { isCommandPaletteOpen } from "../../commandPaletteBus";
|
||||
const buttonClass =
|
||||
"rounded-md border border-border px-3 py-2 text-sm hover:bg-accent disabled:opacity-50";
|
||||
const inputClass = "w-full rounded-md border border-border bg-background px-3 py-2 text-sm";
|
||||
type Section = "chat" | "skills" | "memories" | "cron" | "logs";
|
||||
type Section = "skills" | "memories" | "cron" | "logs";
|
||||
|
||||
const prettyHermesCause = (cause: Cause.Cause<unknown>) => hermesErrorMessage(Cause.pretty(cause));
|
||||
|
||||
export function ConversationTabs() {
|
||||
const source = useAtomValue(conversationSourceAtom);
|
||||
@@ -87,6 +92,7 @@ function useHermesConnection() {
|
||||
}
|
||||
|
||||
export function HermesSidebar() {
|
||||
const navigate = useNavigate();
|
||||
const { choices, connection, setConnection } = useHermesConnection();
|
||||
const selection = useAtomValue(hermesSelectionAtom);
|
||||
const setSelection = useAtomSet(hermesSelectionAtom);
|
||||
@@ -107,31 +113,41 @@ export function HermesSidebar() {
|
||||
}, [keybindings, newSession]);
|
||||
return (
|
||||
<div className="flex min-h-0 flex-1 flex-col gap-2 p-2">
|
||||
<select
|
||||
aria-label="Hermes environment"
|
||||
className={inputClass}
|
||||
value={connection ? `${connection.environmentId}:${connection.target.instanceId}` : ""}
|
||||
onChange={(event) => {
|
||||
const chosen = choices.find(
|
||||
(choice) =>
|
||||
`${choice.environmentId}:${choice.target.instanceId}` === event.target.value,
|
||||
);
|
||||
if (chosen) {
|
||||
setConnection(chosen);
|
||||
setSelection(null);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{choices.length === 0 && <option value="">No enabled Hermes provider</option>}
|
||||
{choices.map((choice) => (
|
||||
<option
|
||||
key={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
value={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
>
|
||||
{choice.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<div className="flex gap-2">
|
||||
<select
|
||||
aria-label="Hermes environment"
|
||||
className={`${inputClass} min-w-0 flex-1`}
|
||||
value={connection ? `${connection.environmentId}:${connection.target.instanceId}` : ""}
|
||||
onChange={(event) => {
|
||||
const chosen = choices.find(
|
||||
(choice) =>
|
||||
`${choice.environmentId}:${choice.target.instanceId}` === event.target.value,
|
||||
);
|
||||
if (chosen) {
|
||||
setConnection(chosen);
|
||||
setSelection(null);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{choices.length === 0 && <option value="">No enabled Hermes provider</option>}
|
||||
{choices.map((choice) => (
|
||||
<option
|
||||
key={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
value={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
>
|
||||
{choice.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="grid size-10 shrink-0 place-items-center rounded-md hover:bg-accent"
|
||||
aria-label="Open Hermes settings"
|
||||
onClick={() => void navigate({ to: "/settings/hermes" })}
|
||||
>
|
||||
<SettingsIcon className="size-4" />
|
||||
</button>
|
||||
</div>
|
||||
{connection ? (
|
||||
<HermesSessionList
|
||||
key={`${connection.environmentId}:${connection.target.instanceId}`}
|
||||
@@ -190,7 +206,7 @@ function HermesSessionList({
|
||||
title: "New Hermes chat",
|
||||
});
|
||||
registry.refresh(atom);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
};
|
||||
const createRequested = useEffectEvent(create);
|
||||
useEffect(() => {
|
||||
@@ -212,16 +228,10 @@ function HermesSessionList({
|
||||
value={search}
|
||||
onChange={(event) => setSearch(event.target.value)}
|
||||
/>
|
||||
<button
|
||||
className="text-left text-xs text-muted-foreground"
|
||||
onClick={() => registry.refresh(atom)}
|
||||
>
|
||||
Refresh · updates every 5 seconds
|
||||
</button>
|
||||
{error && <ErrorDetail message={error} />}
|
||||
{AsyncResult.isFailure(result) ? (
|
||||
<>
|
||||
<ErrorDetail message={Cause.pretty(result.cause)} />
|
||||
<ErrorDetail message={prettyHermesCause(result.cause)} />
|
||||
<HermesLogin connection={connection} onSuccess={() => registry.refresh(atom)} />
|
||||
</>
|
||||
) : null}
|
||||
@@ -230,7 +240,7 @@ function HermesSessionList({
|
||||
.filter((row) => row.title.toLowerCase().includes(search.toLowerCase()))
|
||||
.map((row) => (
|
||||
<button
|
||||
className={`mb-1 w-full rounded-md p-2 text-left hover:bg-accent ${selectedId === row.id ? "bg-accent" : ""}`}
|
||||
className={`w-full border-b border-sidebar-border px-3 py-2.5 text-left hover:bg-sidebar-accent ${selectedId === row.id ? "bg-sidebar-accent" : ""}`}
|
||||
key={`${row.profile}:${row.id}`}
|
||||
onClick={() =>
|
||||
setSelection({
|
||||
@@ -246,7 +256,7 @@ function HermesSessionList({
|
||||
})
|
||||
}
|
||||
>
|
||||
<span className="block truncate text-sm">{row.title}</span>
|
||||
<span className="block truncate text-sm font-medium">{row.title}</span>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{row.active ? "Active · " : ""}
|
||||
{row.source || "Hermes"}
|
||||
@@ -271,7 +281,7 @@ function HermesSessionList({
|
||||
});
|
||||
if (AsyncResult.isSuccess(next))
|
||||
setOlder((value) => [...value, ...hermesSessions(next.value.data)]);
|
||||
else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
>
|
||||
Load older sessions
|
||||
@@ -321,7 +331,7 @@ function HermesLogin({
|
||||
setPassword("");
|
||||
setBusy(false);
|
||||
if (AsyncResult.isSuccess(result)) onSuccess();
|
||||
else if (AsyncResult.isFailure(result)) setError(Cause.pretty(result.cause));
|
||||
else if (AsyncResult.isFailure(result)) setError(prettyHermesCause(result.cause));
|
||||
}}
|
||||
>
|
||||
<input
|
||||
@@ -351,20 +361,65 @@ function HermesLogin({
|
||||
export function HermesWorkspace() {
|
||||
const selection = useAtomValue(hermesSelectionAtom);
|
||||
const { connection } = useHermesConnection();
|
||||
const [sectionState, setSectionState] = useState<{ session: typeof selection; section: Section }>(
|
||||
{ session: selection, section: "chat" },
|
||||
);
|
||||
const section = sectionState.session === selection ? sectionState.section : "chat";
|
||||
const setSection = (section: Section) => setSectionState({ session: selection, section });
|
||||
const target = selection?.connection ?? connection;
|
||||
return (
|
||||
<main className="flex h-dvh min-w-0 flex-1 flex-col bg-background text-foreground">
|
||||
<header className="border-b border-border px-5 pb-3 pt-14">
|
||||
<h1 className="truncate text-lg font-semibold">{selection?.title ?? "Hermes"}</h1>
|
||||
<nav className="mt-3 flex flex-wrap gap-2" aria-label="Hermes tools">
|
||||
{(["chat", "skills", "memories", "cron", "logs"] as const).map((item) => (
|
||||
</header>
|
||||
{target ? (
|
||||
selection ? (
|
||||
<HermesChat
|
||||
key={`${selection.connection.environmentId}:${selection.connection.target.instanceId}:${selection.connection.target.profile}:${selection.id}`}
|
||||
connection={selection.connection}
|
||||
id={selection.id}
|
||||
/>
|
||||
) : (
|
||||
<p className="p-6 text-muted-foreground">
|
||||
Choose a Hermes session or use New task. No project or repository is required.
|
||||
</p>
|
||||
)
|
||||
) : (
|
||||
<p className="p-6">Enable Hermes in Settings → Providers to connect.</p>
|
||||
)}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export function HermesSettingsWorkspace() {
|
||||
const { choices, connection, setConnection } = useHermesConnection();
|
||||
const [section, setSection] = useState<Section>("skills");
|
||||
return (
|
||||
<div className="flex h-full min-h-0 flex-col">
|
||||
<header className="space-y-3 border-b border-border p-5">
|
||||
{choices.length > 1 ? (
|
||||
<select
|
||||
aria-label="Hermes environment"
|
||||
className={inputClass}
|
||||
value={connection ? `${connection.environmentId}:${connection.target.instanceId}` : ""}
|
||||
onChange={(event) => {
|
||||
const chosen = choices.find(
|
||||
(choice) =>
|
||||
`${choice.environmentId}:${choice.target.instanceId}` === event.target.value,
|
||||
);
|
||||
if (chosen) setConnection(chosen);
|
||||
}}
|
||||
>
|
||||
{choices.map((choice) => (
|
||||
<option
|
||||
key={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
value={`${choice.environmentId}:${choice.target.instanceId}`}
|
||||
>
|
||||
{choice.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
) : null}
|
||||
<nav className="flex flex-wrap gap-2" aria-label="Hermes management">
|
||||
{(["skills", "memories", "cron", "logs"] as const).map((item) => (
|
||||
<button
|
||||
key={item}
|
||||
type="button"
|
||||
className={`${buttonClass} ${section === item ? "bg-accent" : ""}`}
|
||||
aria-pressed={section === item}
|
||||
onClick={() => setSection(item)}
|
||||
@@ -374,30 +429,18 @@ export function HermesWorkspace() {
|
||||
))}
|
||||
</nav>
|
||||
</header>
|
||||
{target ? (
|
||||
section === "chat" ? (
|
||||
selection ? (
|
||||
<HermesChat
|
||||
key={`${selection.connection.environmentId}:${selection.connection.target.instanceId}:${selection.connection.target.profile}:${selection.id}`}
|
||||
connection={selection.connection}
|
||||
id={selection.id}
|
||||
/>
|
||||
) : (
|
||||
<p className="p-6 text-muted-foreground">
|
||||
Choose a Hermes session or use New task. No project or repository is required.
|
||||
</p>
|
||||
)
|
||||
) : (
|
||||
<HermesManager
|
||||
key={`${target.environmentId}:${target.target.instanceId}:${section}`}
|
||||
connection={target}
|
||||
section={section}
|
||||
/>
|
||||
)
|
||||
{connection ? (
|
||||
<HermesManager
|
||||
key={`${connection.environmentId}:${connection.target.instanceId}:${section}`}
|
||||
connection={connection}
|
||||
section={section}
|
||||
/>
|
||||
) : (
|
||||
<p className="p-6">Enable Hermes in Settings → Providers to connect.</p>
|
||||
<p className="p-6 text-muted-foreground">
|
||||
Enable Hermes in Settings → Providers on a connected environment.
|
||||
</p>
|
||||
)}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -432,7 +475,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
input: { ...connection.target, action: "attach", id },
|
||||
}).then((next) => {
|
||||
if (!active) return;
|
||||
if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
});
|
||||
return () => {
|
||||
active = false;
|
||||
@@ -459,7 +502,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
setCommands([]);
|
||||
setOutput(action === "command" ? hermesPretty(next.value.data) : "");
|
||||
registry.refresh(query);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
};
|
||||
const eventRows = AsyncResult.isSuccess(events) ? events.value : [];
|
||||
const messages = AsyncResult.isSuccess(result) ? hermesMessages(result.value.data) : [];
|
||||
@@ -467,7 +510,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
return (
|
||||
<div className="flex min-h-0 flex-1 flex-col">
|
||||
<div className="min-h-0 flex-1 space-y-4 overflow-auto p-5">
|
||||
{AsyncResult.isFailure(result) && <ErrorDetail message={Cause.pretty(result.cause)} />}
|
||||
{AsyncResult.isFailure(result) && <ErrorDetail message={prettyHermesCause(result.cause)} />}
|
||||
{messages.length === 100 && hasEarlier && (
|
||||
<button
|
||||
className={buttonClass}
|
||||
@@ -485,7 +528,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
const page = hermesMessages(next.value.data);
|
||||
setOlder((value) => mergeHermesMessages(page, value, messages));
|
||||
setHasEarlier(page.length === 100);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
>
|
||||
Load earlier messages
|
||||
@@ -548,7 +591,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
fields: { requestId: request.id, response },
|
||||
},
|
||||
});
|
||||
if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
@@ -623,7 +666,7 @@ function HermesChat({ connection, id }: { connection: HermesConnection; id: stri
|
||||
if (AsyncResult.isSuccess(next)) {
|
||||
setCommands(hermesArray(hermesRecord(next.value.data).items));
|
||||
setCompletion({ input, replaceFrom: hermesRecord(next.value.data).replace_from });
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
>
|
||||
/ Commands & skills
|
||||
@@ -745,7 +788,7 @@ function HermesManager({
|
||||
section,
|
||||
}: {
|
||||
connection: HermesConnection;
|
||||
section: Exclude<Section, "chat">;
|
||||
section: Section;
|
||||
}) {
|
||||
const registry = useContext(RegistryContext);
|
||||
const [logFile, setLogFile] = useState<"agent" | "gateway" | "errors">("agent");
|
||||
@@ -783,7 +826,7 @@ function HermesManager({
|
||||
if (AsyncResult.isSuccess(next)) {
|
||||
setEditor(null);
|
||||
registry.refresh(query);
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
};
|
||||
return (
|
||||
<div className="min-h-0 flex-1 space-y-3 overflow-auto p-5">
|
||||
@@ -831,7 +874,7 @@ function HermesManager({
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{AsyncResult.isFailure(result) && <ErrorDetail message={Cause.pretty(result.cause)} />}
|
||||
{AsyncResult.isFailure(result) && <ErrorDetail message={prettyHermesCause(result.cause)} />}
|
||||
{error && <ErrorDetail message={error} />}
|
||||
{section === "logs" ? (
|
||||
<pre className="max-h-full overflow-auto whitespace-pre-wrap break-words rounded border border-border p-3 text-xs">
|
||||
@@ -912,7 +955,7 @@ function HermesManager({
|
||||
if (AsyncResult.isSuccess(next)) {
|
||||
const content = hermesText(hermesRecord(next.value.data).content);
|
||||
setEditor({ id, text: content, original: content });
|
||||
} else if (AsyncResult.isFailure(next)) setError(Cause.pretty(next.cause));
|
||||
} else if (AsyncResult.isFailure(next)) setError(prettyHermesCause(next.cause));
|
||||
}}
|
||||
>
|
||||
View / edit
|
||||
|
||||
@@ -82,6 +82,7 @@ const SETTINGS_SECTION_ICONS: Readonly<
|
||||
"/settings/keybindings": KeyboardIcon,
|
||||
"/settings/snap-shot": SnapShotIcon,
|
||||
"/settings/providers": BotIcon,
|
||||
"/settings/hermes": BotIcon,
|
||||
"/settings/integrations": BlocksIcon,
|
||||
"/settings/source-control": GitBranchIcon,
|
||||
"/settings/connections": Link2Icon,
|
||||
|
||||
@@ -15,6 +15,7 @@ export type SettingsPath =
|
||||
| "/settings/keybindings"
|
||||
| "/settings/snap-shot"
|
||||
| "/settings/providers"
|
||||
| "/settings/hermes"
|
||||
| "/settings/integrations"
|
||||
| "/settings/source-control"
|
||||
| "/settings/connections"
|
||||
@@ -76,6 +77,7 @@ export const SETTINGS_SECTION_LABELS: Readonly<Record<SettingsPath, string>> = {
|
||||
"/settings/keybindings": "Keybindings",
|
||||
"/settings/snap-shot": "SnapShots",
|
||||
"/settings/providers": "Providers",
|
||||
"/settings/hermes": "Hermes",
|
||||
"/settings/integrations": "Integrations",
|
||||
"/settings/source-control": "Source Control",
|
||||
"/settings/connections": "Connections",
|
||||
@@ -729,6 +731,7 @@ const SETTINGS_CATEGORY_SCOPES: Readonly<Record<SettingsPath, SettingsSearchScop
|
||||
// environment at any selection. Neither needs a particular scope to render.
|
||||
"/settings/keybindings": null,
|
||||
"/settings/providers": null,
|
||||
"/settings/hermes": null,
|
||||
"/settings/integrations": null,
|
||||
"/settings/source-control": "environment-defaults",
|
||||
"/settings/connections": "connections",
|
||||
|
||||
@@ -23,6 +23,7 @@ import { Route as SettingsProjectsRouteImport } from './routes/settings.projects
|
||||
import { Route as SettingsOpenSourceLicensesRouteImport } from './routes/settings.open-source-licenses'
|
||||
import { Route as SettingsKeybindingsRouteImport } from './routes/settings.keybindings'
|
||||
import { Route as SettingsIntegrationsRouteImport } from './routes/settings.integrations'
|
||||
import { Route as SettingsHermesRouteImport } from './routes/settings.hermes'
|
||||
import { Route as SettingsGeneralRouteImport } from './routes/settings.general'
|
||||
import { Route as SettingsDiagnosticsRouteImport } from './routes/settings.diagnostics'
|
||||
import { Route as SettingsConnectionsRouteImport } from './routes/settings.connections'
|
||||
@@ -104,6 +105,11 @@ const SettingsIntegrationsRoute = SettingsIntegrationsRouteImport.update({
|
||||
path: '/integrations',
|
||||
getParentRoute: () => SettingsRoute,
|
||||
} as any)
|
||||
const SettingsHermesRoute = SettingsHermesRouteImport.update({
|
||||
id: '/hermes',
|
||||
path: '/hermes',
|
||||
getParentRoute: () => SettingsRoute,
|
||||
} as any)
|
||||
const SettingsGeneralRoute = SettingsGeneralRouteImport.update({
|
||||
id: '/general',
|
||||
path: '/general',
|
||||
@@ -171,6 +177,7 @@ export interface FileRoutesByFullPath {
|
||||
'/settings/connections': typeof SettingsConnectionsRoute
|
||||
'/settings/diagnostics': typeof SettingsDiagnosticsRoute
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/hermes': typeof SettingsHermesRoute
|
||||
'/settings/integrations': typeof SettingsIntegrationsRoute
|
||||
'/settings/keybindings': typeof SettingsKeybindingsRoute
|
||||
'/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
|
||||
@@ -195,6 +202,7 @@ export interface FileRoutesByTo {
|
||||
'/settings/connections': typeof SettingsConnectionsRoute
|
||||
'/settings/diagnostics': typeof SettingsDiagnosticsRoute
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/hermes': typeof SettingsHermesRoute
|
||||
'/settings/integrations': typeof SettingsIntegrationsRoute
|
||||
'/settings/keybindings': typeof SettingsKeybindingsRoute
|
||||
'/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
|
||||
@@ -222,6 +230,7 @@ export interface FileRoutesById {
|
||||
'/settings/connections': typeof SettingsConnectionsRoute
|
||||
'/settings/diagnostics': typeof SettingsDiagnosticsRoute
|
||||
'/settings/general': typeof SettingsGeneralRoute
|
||||
'/settings/hermes': typeof SettingsHermesRoute
|
||||
'/settings/integrations': typeof SettingsIntegrationsRoute
|
||||
'/settings/keybindings': typeof SettingsKeybindingsRoute
|
||||
'/settings/open-source-licenses': typeof SettingsOpenSourceLicensesRoute
|
||||
@@ -250,6 +259,7 @@ export interface FileRouteTypes {
|
||||
| '/settings/connections'
|
||||
| '/settings/diagnostics'
|
||||
| '/settings/general'
|
||||
| '/settings/hermes'
|
||||
| '/settings/integrations'
|
||||
| '/settings/keybindings'
|
||||
| '/settings/open-source-licenses'
|
||||
@@ -274,6 +284,7 @@ export interface FileRouteTypes {
|
||||
| '/settings/connections'
|
||||
| '/settings/diagnostics'
|
||||
| '/settings/general'
|
||||
| '/settings/hermes'
|
||||
| '/settings/integrations'
|
||||
| '/settings/keybindings'
|
||||
| '/settings/open-source-licenses'
|
||||
@@ -300,6 +311,7 @@ export interface FileRouteTypes {
|
||||
| '/settings/connections'
|
||||
| '/settings/diagnostics'
|
||||
| '/settings/general'
|
||||
| '/settings/hermes'
|
||||
| '/settings/integrations'
|
||||
| '/settings/keybindings'
|
||||
| '/settings/open-source-licenses'
|
||||
@@ -423,6 +435,13 @@ declare module '@tanstack/react-router' {
|
||||
preLoaderRoute: typeof SettingsIntegrationsRouteImport
|
||||
parentRoute: typeof SettingsRoute
|
||||
}
|
||||
'/settings/hermes': {
|
||||
id: '/settings/hermes'
|
||||
path: '/hermes'
|
||||
fullPath: '/settings/hermes'
|
||||
preLoaderRoute: typeof SettingsHermesRouteImport
|
||||
parentRoute: typeof SettingsRoute
|
||||
}
|
||||
'/settings/general': {
|
||||
id: '/settings/general'
|
||||
path: '/general'
|
||||
@@ -518,6 +537,7 @@ interface SettingsRouteChildren {
|
||||
SettingsConnectionsRoute: typeof SettingsConnectionsRoute
|
||||
SettingsDiagnosticsRoute: typeof SettingsDiagnosticsRoute
|
||||
SettingsGeneralRoute: typeof SettingsGeneralRoute
|
||||
SettingsHermesRoute: typeof SettingsHermesRoute
|
||||
SettingsIntegrationsRoute: typeof SettingsIntegrationsRoute
|
||||
SettingsKeybindingsRoute: typeof SettingsKeybindingsRoute
|
||||
SettingsOpenSourceLicensesRoute: typeof SettingsOpenSourceLicensesRoute
|
||||
@@ -533,6 +553,7 @@ const SettingsRouteChildren: SettingsRouteChildren = {
|
||||
SettingsConnectionsRoute: SettingsConnectionsRoute,
|
||||
SettingsDiagnosticsRoute: SettingsDiagnosticsRoute,
|
||||
SettingsGeneralRoute: SettingsGeneralRoute,
|
||||
SettingsHermesRoute: SettingsHermesRoute,
|
||||
SettingsIntegrationsRoute: SettingsIntegrationsRoute,
|
||||
SettingsKeybindingsRoute: SettingsKeybindingsRoute,
|
||||
SettingsOpenSourceLicensesRoute: SettingsOpenSourceLicensesRoute,
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
import { HermesSettingsWorkspace } from "../components/hermes/HermesWorkspace";
|
||||
|
||||
export const Route = createFileRoute("/settings/hermes")({
|
||||
component: HermesSettingsWorkspace,
|
||||
});
|
||||
@@ -54,7 +54,7 @@ embedded; Hermes reports their availability. Use **Reconnect** after a gateway d
|
||||
|
||||
## Inspect and manage Hermes
|
||||
|
||||
In the Hermes workspace, you can:
|
||||
Choose the gear button on the Hermes tab to open its management page. There you can:
|
||||
|
||||
- Expand complete tool inputs, commands, outputs, and live activity instead of only summaries.
|
||||
- View agent, gateway, and error logs, refreshed while open, and inspect detailed failures.
|
||||
@@ -66,6 +66,10 @@ Skill and memory saves check for changes since loading; reload a conflicting edi
|
||||
Without a selected session, management uses the dashboard's default profile. Native Hermes chats
|
||||
do not use T3's Git checkpoints or project worktrees.
|
||||
|
||||
The Android app and the connected T3 server must both include native Hermes support. If the app
|
||||
reports that the host is too old, update and restart T3 Code on the machine running the server;
|
||||
updating only the phone cannot add server-side Hermes commands.
|
||||
|
||||
## Models
|
||||
|
||||
For project threads, T3 Code asks Hermes for the catalog it advertises
|
||||
|
||||
@@ -10,10 +10,16 @@ import {
|
||||
hermesCronPaused,
|
||||
mergeHermesSessions,
|
||||
mergeHermesMessages,
|
||||
hermesErrorMessage,
|
||||
} from "./hermes.ts";
|
||||
import type { HermesEvent } from "@t3tools/contracts";
|
||||
|
||||
describe("native Hermes presentation", () => {
|
||||
it("explains when the connected host lacks Hermes RPC support", () => {
|
||||
expect(hermesErrorMessage("Error: Unknown request tag: hermes.write")).toContain(
|
||||
"Update and restart the T3 desktop app or server",
|
||||
);
|
||||
});
|
||||
it("merges overlapping transcript pages with stable message identities", () => {
|
||||
const older = hermesMessages({
|
||||
messages: [
|
||||
|
||||
@@ -44,6 +44,13 @@ export function hermesArray(value: unknown): ReadonlyArray<unknown> {
|
||||
export function hermesPretty(value: unknown): string {
|
||||
return typeof value === "string" ? value : (JSON.stringify(value, null, 2) ?? "");
|
||||
}
|
||||
|
||||
export function hermesErrorMessage(message: string): string {
|
||||
if (/Unknown request tag: hermes\.(?:read|write|events)/i.test(message)) {
|
||||
return "This T3 host is too old for native Hermes controls. Update and restart the T3 desktop app or server on the connected machine, then try again.";
|
||||
}
|
||||
return message;
|
||||
}
|
||||
export function hermesCronJobs(value: unknown): ReadonlyArray<unknown> {
|
||||
return Array.isArray(value) ? value : hermesArray(hermesRecord(value).jobs);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user