Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
fix(hardware,assistant): ACL for refresh_system_info + gate sampler UI on hydration
Akarshan99b075f23ad9
diff --git a/src-tauri/plugins/tauri-plugin-hardware/build.rs b/src-tauri/plugins/tauri-plugin-hardware/build.rsindex c90177818..79b159edf 100644--- a/src-tauri/plugins/tauri-plugin-hardware/build.rs+++ b/src-tauri/plugins/tauri-plugin-hardware/build.rs@@ -1,4 +1,4 @@-const COMMANDS: &[&str] = &["get_system_info", "get_system_usage"];+const COMMANDS: &[&str] = &["get_system_info", "get_system_usage", "refresh_system_info"];fn main() {tauri_plugin::Builder::new(COMMANDS).build();diff --git a/src-tauri/plugins/tauri-plugin-hardware/permissions/default.toml b/src-tauri/plugins/tauri-plugin-hardware/permissions/default.tomlindex 98a8de1b3..01fbef117 100644--- a/src-tauri/plugins/tauri-plugin-hardware/permissions/default.toml+++ b/src-tauri/plugins/tauri-plugin-hardware/permissions/default.toml@@ -2,5 +2,6 @@description = "Default permissions for the hardware plugin"permissions = ["allow-get-system-info",- "allow-get-system-usage"+ "allow-get-system-usage",+ "allow-refresh-system-info"]diff --git a/web-app/src/containers/SamplerPopover.tsx b/web-app/src/containers/SamplerPopover.tsxindex e002c154d..9e2b3db86 100644--- a/web-app/src/containers/SamplerPopover.tsx+++ b/web-app/src/containers/SamplerPopover.tsx@@ -60,6 +60,7 @@ export function SamplerPopover({}: SamplerPopoverProps) {const currentAssistant = useAssistant((s) => s.currentAssistant)const updateAssistant = useAssistant((s) => s.updateAssistant)+ const assistantsLoading = useAssistant((s) => s.loading)const providers = useModelProvider((s) => s.providers)const scopedProviders = useMemo(() => {@@ -119,9 +120,11 @@ export function SamplerPopover({if (isPredefinedRemoteProvider(providerId)) return null- const triggerLabel = currentAssistant- ? `Sampling — ${currentAssistant.name}`- : 'Sampling'+ const triggerLabel = assistantsLoading+ ? 'Loading assistant…'+ : currentAssistant+ ? `Sampling — ${currentAssistant.name}`+ : 'Sampling'return (<Popover>@@ -133,6 +136,7 @@ export function SamplerPopover({size="icon-xs"aria-label="Sampling parameters"className="relative"+ disabled={assistantsLoading}><IconAdjustmentsHorizontalsize={18}diff --git a/web-app/src/hooks/useAssistant.ts b/web-app/src/hooks/useAssistant.tsindex c2d44b60f..bc1035736 100644--- a/web-app/src/hooks/useAssistant.ts+++ b/web-app/src/hooks/useAssistant.ts@@ -31,12 +31,7 @@ export const defaultAssistant: Assistant = {id: 'jan',name: 'Jan',created_at: 1747029866.542,- parameters: {- temperature: 0.7,- top_k: 20,- top_p: 0.8,- repeat_penalty: 1.12,- },+ parameters: {},avatar: '👋',description:"Jan is a helpful desktop assistant that can reason through complex tasks and use tools to complete them on the user's behalf.",