From b19df8156a512d9e268d2332e85d499e829f8049 Mon Sep 17 00:00:00 2001 From: Acbox Date: Wed, 18 Feb 2026 22:21:32 +0800 Subject: [PATCH] chore: add husky hook --- .husky/pre-commit | 7 ++ package.json | 10 +- .../src/pages/bots/components/bot-memory.vue | 85 ++++++++++++---- .../pages/bots/components/bot-settings.vue | 5 +- packages/web/src/pages/bots/detail.vue | 96 ++++++++++++++----- .../chat/components/attachment-block.vue | 2 +- .../src/pages/chat/components/chat-area.vue | 30 ++++-- .../components/media-gallery-lightbox.vue | 17 +++- .../pages/chat/components/tool-call-block.vue | 14 ++- packages/web/src/pages/login/index.vue | 18 +++- .../components/brave-settings.vue | 11 ++- pnpm-lock.yaml | 29 ++++++ 12 files changed, 255 insertions(+), 69 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..64f922d1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +export PATH="$HOME/.local/share/mise/shims:$HOME/.local/bin:$HOME/.npm-global/bin:/opt/homebrew/bin:/usr/local/bin:$PATH" + +pnpm lint:fix || true + +pnpm web:build diff --git a/package.json b/package.json index fd76c958..2f778a07 100644 --- a/package.json +++ b/package.json @@ -9,14 +9,15 @@ "docs:dev": "pnpm --filter @memoh/docs dev", "docs:build": "pnpm --filter @memoh/docs build", "docs:preview": "pnpm --filter @memoh/docs preview", - "agent:dev": "go run ./agent-go/cmd/agent_gateway", - "agent:build": "go build ./agent-go/cmd/agent_gateway", - "agent:start": "go run ./agent-go/cmd/agent_gateway", + "agent:dev": "pnpm --filter @memoh/agent-gateway dev", + "agent:build": "pnpm --filter @memoh/agent-gateway build", + "agent:start": "pnpm --filter @memoh/agent-gateway start", "release": "bumpp --all", "generate-sdk": "openapi-ts", "lint": "eslint .", "lint:fix": "eslint . --fix", - "test": "vitest" + "test": "vitest", + "prepare": "husky" }, "keywords": [], "author": "", @@ -27,6 +28,7 @@ "bumpp": "^10.4.1", "eslint": "^9.39.2", "eslint-plugin-vue": "^10.6.2", + "husky": "^9.1.7", "typescript": "^5.9.3", "typescript-eslint": "^8.52.0", "vitest": "^4.0.16", diff --git a/packages/web/src/pages/bots/components/bot-memory.vue b/packages/web/src/pages/bots/components/bot-memory.vue index 4fc89307..7e936f18 100644 --- a/packages/web/src/pages/bots/components/bot-memory.vue +++ b/packages/web/src/pages/bots/components/bot-memory.vue @@ -4,7 +4,9 @@
-

{{ $t('bots.memory.files') }}

+

+ {{ $t('bots.memory.files') }} +

@@ -169,12 +174,16 @@
-
Vector Manifold
+
+ Vector Manifold +
-

Top-K Bucket

+

+ Top-K Bucket +

@@ -201,11 +212,25 @@
-

Energy Gradient (CDF)

+

+ Energy Gradient (CDF) +

- + - + -

K: {{ hoveredCdfPoint.k }}

-

P: {{ hoveredCdfPoint.cumulative.toFixed(6) }}

+

+ K: {{ hoveredCdfPoint.k }} +

+

+ P: {{ hoveredCdfPoint.cumulative.toFixed(6) }} +

@@ -301,7 +330,9 @@ class="size-6 opacity-20" />
-

{{ $t('bots.memory.title') }}

+

+ {{ $t('bots.memory.title') }} +

Select a file from the sidebar to view or edit, or create a new one to persist long-term information for your bot.

@@ -403,7 +434,10 @@ :disabled="actionLoading || !newMemoryContent.trim()" @click="handleCreateMemory" > - + {{ $t('common.confirm') }} @@ -432,7 +466,10 @@ class="flex items-start gap-3 p-3 rounded-md border cursor-pointer hover:bg-muted/50 transition-colors" :class="{ 'bg-muted border-primary': compactRatio === '0.8' }" > - +

{{ $t('bots.memory.compactRatioLight') }}

{{ $t('bots.memory.compactRatioLightDesc') }}

@@ -442,7 +479,10 @@ class="flex items-start gap-3 p-3 rounded-md border cursor-pointer hover:bg-muted/50 transition-colors" :class="{ 'bg-muted border-primary': compactRatio === '0.5' }" > - +

{{ $t('bots.memory.compactRatioMedium') }}

{{ $t('bots.memory.compactRatioMediumDesc') }}

@@ -452,7 +492,10 @@ class="flex items-start gap-3 p-3 rounded-md border cursor-pointer hover:bg-muted/50 transition-colors" :class="{ 'bg-muted border-primary': compactRatio === '0.3' }" > - +

{{ $t('bots.memory.compactRatioAggressive') }}

{{ $t('bots.memory.compactRatioAggressiveDesc') }}

@@ -468,7 +511,10 @@ type="date" class="w-full" /> -

+

Calculated: {{ compactDecayDays }} days old

@@ -485,7 +531,10 @@ :disabled="compactLoading" @click="handleCompact" > - + {{ $t('common.confirm') }} @@ -870,7 +919,7 @@ function generateSmoothPath(data: any[], closePath: boolean = false) { } if (closePath) { - d += ` L 100,100 L 0,100 Z` + d += ' L 100,100 L 0,100 Z' } return d diff --git a/packages/web/src/pages/bots/components/bot-settings.vue b/packages/web/src/pages/bots/components/bot-settings.vue index 25007313..79bbd4eb 100644 --- a/packages/web/src/pages/bots/components/bot-settings.vue +++ b/packages/web/src/pages/bots/components/bot-settings.vue @@ -125,7 +125,10 @@ variant="destructive" :disabled="deleteLoading" > - + {{ $t('bots.settings.deleteBot') }} diff --git a/packages/web/src/pages/bots/detail.vue b/packages/web/src/pages/bots/detail.vue index f6a14970..8a060880 100644 --- a/packages/web/src/pages/bots/detail.vue +++ b/packages/web/src/pages/bots/detail.vue @@ -138,7 +138,9 @@
-

{{ $t('bots.checks.title') }}

+

+ {{ $t('bots.checks.title') }} +

{{ $t('bots.checks.subtitle') }}

@@ -191,7 +193,9 @@ >
-

{{ checkTitleLabel(item) }}

+

+ {{ checkTitleLabel(item) }} +

-

{{ item.summary }}

+

+ {{ item.summary }} +

-
{{ $t('bots.container.fields.id') }}
-
{{ containerInfo.container_id }}
+
+ {{ $t('bots.container.fields.id') }} +
+
+ {{ containerInfo.container_id }} +
-
{{ $t('bots.container.fields.status') }}
+
+ {{ $t('bots.container.fields.status') }} +
{{ containerStatusText }}
-
{{ $t('bots.container.fields.task') }}
+
+ {{ $t('bots.container.fields.task') }} +
{{ containerTaskText }}
-
{{ $t('bots.container.fields.namespace') }}
+
+ {{ $t('bots.container.fields.namespace') }} +
{{ containerInfo.namespace }}
-
{{ $t('bots.container.fields.image') }}
-
{{ containerInfo.image }}
+
+ {{ $t('bots.container.fields.image') }} +
+
+ {{ containerInfo.image }} +
-
{{ $t('bots.container.fields.hostPath') }}
-
{{ containerInfo.host_path || '-' }}
+
+ {{ $t('bots.container.fields.hostPath') }} +
+
+ {{ containerInfo.host_path || '-' }} +
-
{{ $t('bots.container.fields.containerPath') }}
-
{{ containerInfo.container_path }}
+
+ {{ $t('bots.container.fields.containerPath') }} +
+
+ {{ containerInfo.container_path }} +
-
{{ $t('bots.container.fields.createdAt') }}
+
+ {{ $t('bots.container.fields.createdAt') }} +
{{ formatDate(containerInfo.created_at) }}
-
{{ $t('bots.container.fields.updatedAt') }}
+
+ {{ $t('bots.container.fields.updatedAt') }} +
{{ formatDate(containerInfo.updated_at) }}
@@ -414,10 +446,18 @@ - - - - + + + + @@ -426,10 +466,18 @@ :key="`${item.snapshotter}:${item.name}`" class="border-t" > - - - - + + + +
{{ $t('bots.container.snapshotColumns.name') }}{{ $t('bots.container.snapshotColumns.kind') }}{{ $t('bots.container.snapshotColumns.parent') }}{{ $t('bots.container.snapshotColumns.createdAt') }} + {{ $t('bots.container.snapshotColumns.name') }} + + {{ $t('bots.container.snapshotColumns.kind') }} + + {{ $t('bots.container.snapshotColumns.parent') }} + + {{ $t('bots.container.snapshotColumns.createdAt') }} +
{{ item.name }}{{ item.kind }}{{ item.parent || '-' }}{{ formatDate(item.created_at) }} + {{ item.name }} + + {{ item.kind }} + + {{ item.parent || '-' }} + + {{ formatDate(item.created_at) }} +
diff --git a/packages/web/src/pages/chat/components/attachment-block.vue b/packages/web/src/pages/chat/components/attachment-block.vue index 0b04b6c3..8b3338e8 100644 --- a/packages/web/src/pages/chat/components/attachment-block.vue +++ b/packages/web/src/pages/chat/components/attachment-block.vue @@ -17,7 +17,7 @@ :alt="String(att.name ?? 'image')" class="w-full h-full object-contain pointer-events-none" loading="lazy" - /> + >
@@ -108,7 +112,10 @@ class="ml-1 text-muted-foreground hover:text-foreground" @click="pendingFiles.splice(i, 1)" > - +
@@ -128,7 +135,7 @@ multiple accept="image/*,audio/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip" @change="handleFileSelect" - /> + >
diff --git a/packages/web/src/pages/chat/components/media-gallery-lightbox.vue b/packages/web/src/pages/chat/components/media-gallery-lightbox.vue index 0f910650..c2db2629 100644 --- a/packages/web/src/pages/chat/components/media-gallery-lightbox.vue +++ b/packages/web/src/pages/chat/components/media-gallery-lightbox.vue @@ -12,7 +12,10 @@ aria-label="Close" @click="close" > - + @@ -22,7 +25,10 @@ aria-label="Previous" @click.stop="prev" > - + @@ -32,7 +38,10 @@ aria-label="Next" @click.stop="next" > - + @@ -44,7 +53,7 @@ class="max-w-full max-h-[90vh] object-contain select-none" draggable="false" @click.stop - /> + >
diff --git a/packages/web/src/pages/search-providers/components/brave-settings.vue b/packages/web/src/pages/search-providers/components/brave-settings.vue index 670418cb..d94afdc5 100644 --- a/packages/web/src/pages/search-providers/components/brave-settings.vue +++ b/packages/web/src/pages/search-providers/components/brave-settings.vue @@ -2,7 +2,10 @@
- +
@@ -10,7 +13,11 @@
- +
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0743eb24..9e75b7d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,9 @@ importers: eslint-plugin-vue: specifier: ^10.6.2 version: 10.6.2(@typescript-eslint/parser@8.52.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(vue-eslint-parser@10.2.0(eslint@9.39.2(jiti@2.6.1))) + husky: + specifier: ^9.1.7 + version: 9.1.7 typescript: specifier: ^5.9.3 version: 5.9.3 @@ -1743,56 +1746,67 @@ packages: resolution: {integrity: sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.54.0': resolution: {integrity: sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.54.0': resolution: {integrity: sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.54.0': resolution: {integrity: sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.54.0': resolution: {integrity: sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-ppc64-gnu@4.54.0': resolution: {integrity: sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.54.0': resolution: {integrity: sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.54.0': resolution: {integrity: sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.54.0': resolution: {integrity: sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.54.0': resolution: {integrity: sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.54.0': resolution: {integrity: sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-openharmony-arm64@4.54.0': resolution: {integrity: sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg==} @@ -1941,24 +1955,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.1.18': resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.1.18': resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.1.18': resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.1.18': resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==} @@ -3439,6 +3457,11 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -3686,24 +3709,28 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.30.2: resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.30.2: resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.30.2: resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.30.2: resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} @@ -8329,6 +8356,8 @@ snapshots: transitivePeerDependencies: - supports-color + husky@9.1.7: {} + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2