Phase 004: remove the desktop shell, website tooling, and bundled hermes CLI
- Drop all desktop/Electron branches, scripts, and UI (title bar, pets, desktop bridge); LAN endpoint kind is now web/custom only - Replace the bundled hermes CLI with user-side installation: add GET /api/hermes/cli-status plus a HermesMissingView onboarding guide - Remove the version-management UI (snapshots handled by git) and prune dead website/mcu/claude scripts and lockfile entries
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { setApiKey, clearApiKey, hasApiKey } from "@/api/client";
|
||||
import { setApiKey, hasApiKey } from "@/api/client";
|
||||
import { fetchAuthStatus, loginWithPassword } from "@/api/auth";
|
||||
import { isDesktopShell } from "@/utils/desktop-bridge";
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
@@ -14,13 +13,8 @@ const password = ref("");
|
||||
const loading = ref(false);
|
||||
const errorMsg = ref("");
|
||||
const showLockResetHint = ref(false);
|
||||
const desktopShell = isDesktopShell();
|
||||
|
||||
if (desktopShell) {
|
||||
// Desktop login is a recovery path. Drop stale JWTs before any background
|
||||
// request can reuse them and show an unrelated expiry notice.
|
||||
clearApiKey();
|
||||
} else if (hasApiKey()) {
|
||||
if (hasApiKey()) {
|
||||
router.replace("/hermes/chat");
|
||||
}
|
||||
|
||||
@@ -91,15 +85,10 @@ async function handlePasswordLogin() {
|
||||
|
||||
<div v-if="errorMsg" class="login-error">{{ errorMsg }}</div>
|
||||
<div v-if="showLockResetHint" class="login-lock-hint">
|
||||
<template v-if="desktopShell">
|
||||
<span>{{ t("login.desktopLockResetHint") }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{ t("login.lockResetHint") }}</span>
|
||||
<code>hermes-ui clear-login-locks --restart</code>
|
||||
<span>{{ t("login.defaultLoginResetHint") }}</span>
|
||||
<code>hermes-ui reset-default-login</code>
|
||||
</template>
|
||||
<span>{{ t("login.lockResetHint") }}</span>
|
||||
<code>hermes-ui clear-login-locks --restart</code>
|
||||
<span>{{ t("login.defaultLoginResetHint") }}</span>
|
||||
<code>hermes-ui reset-default-login</code>
|
||||
</div>
|
||||
<button type="submit" class="login-btn" :disabled="loading">
|
||||
{{ loading ? "..." : t("login.submit") }}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import WebPet from '@/components/hermes/pets/WebPet.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main class="desktop-pet-view">
|
||||
<WebPet desktop-window />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
:global(html.hermes-desktop-pet-window),
|
||||
:global(html.hermes-desktop-pet-window body),
|
||||
:global(html.hermes-desktop-pet-window #app) {
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border: 0 !important;
|
||||
box-shadow: none !important;
|
||||
outline: 0 !important;
|
||||
}
|
||||
|
||||
.desktop-pet-view {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border: 0 !important;
|
||||
box-shadow: none !important;
|
||||
outline: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -57,8 +57,7 @@ const pairingRequesting = computed(() =>
|
||||
|
||||
function endpointOrder(kind: LanEndpointKind): number {
|
||||
if (kind === 'web') return 0
|
||||
if (kind === 'desktop') return 1
|
||||
return 2
|
||||
return 1
|
||||
}
|
||||
|
||||
function endpointLabel(kind: LanEndpointKind): string {
|
||||
@@ -66,7 +65,6 @@ function endpointLabel(kind: LanEndpointKind): string {
|
||||
}
|
||||
|
||||
function endpointTagType(kind: LanEndpointKind) {
|
||||
if (kind === 'desktop') return 'success'
|
||||
if (kind === 'web') return 'info'
|
||||
return 'default'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { checkHermesCliAvailable, resetHermesCliProbe } from "@/api/hermes/system";
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const rechecking = ref(false);
|
||||
|
||||
async function handleRetry() {
|
||||
rechecking.value = true;
|
||||
try {
|
||||
resetHermesCliProbe();
|
||||
const available = await checkHermesCliAvailable();
|
||||
if (available) {
|
||||
router.replace("/hermes/chat");
|
||||
}
|
||||
} finally {
|
||||
rechecking.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="hermes-missing-view">
|
||||
<div class="hermes-missing-card">
|
||||
<h1 class="hermes-missing-title">{{ t("hermesMissing.title") }}</h1>
|
||||
<p class="hermes-missing-desc">{{ t("hermesMissing.intro") }}</p>
|
||||
<code class="hermes-missing-code">{{ t("hermesMissing.installCmd") }}</code>
|
||||
<p class="hermes-missing-desc">{{ t("hermesMissing.envIntro") }}</p>
|
||||
<code class="hermes-missing-code">{{ t("hermesMissing.envCmd") }}</code>
|
||||
<p class="hermes-missing-hint">{{ t("hermesMissing.restartHint") }}</p>
|
||||
<button class="hermes-missing-btn" :disabled="rechecking" @click="handleRetry">
|
||||
{{ rechecking ? "..." : t("hermesMissing.retry") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "@/styles/variables" as *;
|
||||
|
||||
.hermes-missing-view {
|
||||
height: calc(100 * var(--vh));
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: $bg-primary;
|
||||
}
|
||||
|
||||
.hermes-missing-card {
|
||||
width: 520px;
|
||||
max-width: calc(100vw - 32px);
|
||||
padding: 48px 56px;
|
||||
border: 1px solid $border-color;
|
||||
border-radius: $radius-lg;
|
||||
background: $bg-card;
|
||||
text-align: center;
|
||||
|
||||
@media (max-width: $breakpoint-mobile) {
|
||||
padding: 32px 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.hermes-missing-title {
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: $text-primary;
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
.hermes-missing-desc {
|
||||
font-size: 14px;
|
||||
color: $text-muted;
|
||||
margin: 0 0 10px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.hermes-missing-code {
|
||||
display: block;
|
||||
padding: 10px 12px;
|
||||
margin: 0 0 16px;
|
||||
border: 1px solid $border-color;
|
||||
border-radius: $radius-sm;
|
||||
background: $bg-input;
|
||||
color: $text-primary;
|
||||
font-family: $font-code;
|
||||
font-size: 13px;
|
||||
word-break: break-all;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.hermes-missing-hint {
|
||||
font-size: 13px;
|
||||
color: $text-secondary;
|
||||
margin: 0 0 24px;
|
||||
}
|
||||
|
||||
.hermes-missing-btn {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
border: none;
|
||||
border-radius: $radius-sm;
|
||||
background: $text-primary;
|
||||
color: var(--text-on-accent);
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: opacity $transition-fast;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,6 @@ import { NAlert, NButton, NEmpty, NInput, NSelect, NSpin, NTag, useMessage } fro
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { fetchPetdexManifest, type PetdexManifest, type PetdexPet } from '@/api/hermes/petdex'
|
||||
import { usePetsStore } from '@/stores/hermes/pets'
|
||||
import { desktopBridge } from '@/utils/desktop-bridge'
|
||||
|
||||
const { t } = useI18n()
|
||||
const message = useMessage()
|
||||
@@ -17,7 +16,6 @@ const error = ref('')
|
||||
const searchQuery = ref('')
|
||||
const kindFilter = ref<string | null>(null)
|
||||
const visibleLimit = ref(96)
|
||||
const DESKTOP_ADOPT_SCALE = 0.58
|
||||
|
||||
const pets = computed(() => manifest.value?.pets ?? [])
|
||||
const generatedAt = computed(() => {
|
||||
@@ -82,11 +80,6 @@ async function adopt(pet: PetdexPet) {
|
||||
adoptingSlug.value = pet.slug
|
||||
try {
|
||||
await petsStore.adopt(pet.slug)
|
||||
const bridge = desktopBridge()
|
||||
if (bridge?.isDesktop) {
|
||||
await petsStore.savePreferences({ scale: DESKTOP_ADOPT_SCALE })
|
||||
await bridge.setPetWindowVisible?.(true).catch(() => undefined)
|
||||
}
|
||||
message.success(t('petdex.adopted', { name: pet.displayName }))
|
||||
} catch (err: any) {
|
||||
message.error(err?.message || t('petdex.adoptFailed'))
|
||||
|
||||
Reference in New Issue
Block a user