diff --git a/.github/workflows/pr-ci-healchecks.yml b/.github/workflows/pr-ci-healchecks.yml index 5647cf5cf..c9eaeb1fd 100644 --- a/.github/workflows/pr-ci-healchecks.yml +++ b/.github/workflows/pr-ci-healchecks.yml @@ -38,7 +38,7 @@ jobs: - name: Download side binaries env: ARCH: x86_64-unknown-linux-gnu - SHINKAI_NODE_VERSION: v0.7.27 + SHINKAI_NODE_VERSION: v0.7.28 OLLAMA_VERSION: v0.3.3 run: | npx ts-node ./ci-scripts/download-side-binaries.ts diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 95d5dd08d..d1628b8ff 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -210,7 +210,7 @@ jobs: - name: Download side binaries env: ARCH: ${{ matrix.arch }} - SHINKAI_NODE_VERSION: v0.7.27 + SHINKAI_NODE_VERSION: v0.7.28 OLLAMA_VERSION: v0.3.3 run: | npx ts-node ./ci-scripts/download-side-binaries.ts diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 446a708ca..cb845008f 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -208,7 +208,7 @@ jobs: - name: Download side binaries env: ARCH: ${{ matrix.arch }} - SHINKAI_NODE_VERSION: v0.7.27 + SHINKAI_NODE_VERSION: v0.7.28 OLLAMA_VERSION: v0.3.3 run: | npx ts-node ./ci-scripts/download-side-binaries.ts diff --git a/README.md b/README.md index d89d26fe6..89edfe538 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ $ git clone https://github.com/dcSpark/shinkai-apps ``` ARCH="aarch64-apple-darwin" \ OLLAMA_VERSION="v0.3.3" \ -SHINKAI_NODE_VERSION="v0.7.27" \ +SHINKAI_NODE_VERSION="v0.7.28" \ npx ts-node ./ci-scripts/download-side-binaries.ts ``` @@ -55,14 +55,14 @@ npx ts-node ./ci-scripts/download-side-binaries.ts ``` ARCH="x86_64-unknown-linux-gnu" \ OLLAMA_VERSION="v0.3.3"\ -SHINKAI_NODE_VERSION="v0.7.27" \ +SHINKAI_NODE_VERSION="v0.7.28" \ npx ts-node ./ci-scripts/download-side-binaries.ts ``` #### Windows ``` $ENV:OLLAMA_VERSION="v0.3.3" -$ENV:SHINKAI_NODE_VERSION="v0.7.27" +$ENV:SHINKAI_NODE_VERSION="v0.7.28" $ENV:ARCH="x86_64-pc-windows-msvc" npx ts-node ./ci-scripts/download-side-binaries.ts ``` diff --git a/apps/shinkai-desktop/src-tauri/src/local_shinkai_node/process_handlers/process_utils.rs b/apps/shinkai-desktop/src-tauri/src/local_shinkai_node/process_handlers/process_utils.rs index c522ac1e0..4999aaedd 100644 --- a/apps/shinkai-desktop/src-tauri/src/local_shinkai_node/process_handlers/process_utils.rs +++ b/apps/shinkai-desktop/src-tauri/src/local_shinkai_node/process_handlers/process_utils.rs @@ -8,8 +8,9 @@ pub fn options_to_env(options: &T) -> HashMap { // const navigate = useNavigate(); const { t } = useTranslation(); - + const { setShinkaiNodeOptions } = useShinkaiNodeManager(); const { mutateAsync: shinkaiNodeKill } = useShinkaiNodeKillMutation(); const { mutateAsync: shinkaiNodeSpawn } = useShinkaiNodeSpawnMutation(); const { mutateAsync: shinkaiNodeRemoveStorage } = @@ -51,6 +51,7 @@ export const ResetStorageBeforeConnectConfirmationPrompt = ({ const reset = async (preserveKeys: boolean) => { await shinkaiNodeKill(); await shinkaiNodeRemoveStorage({ preserveKeys }); + setShinkaiNodeOptions(null); await shinkaiNodeSpawn(); if (typeof onReset === 'function') { onReset(); diff --git a/apps/shinkai-desktop/src/lib/shinkai-node-manager/shinkai-node-manager-client.ts b/apps/shinkai-desktop/src/lib/shinkai-node-manager/shinkai-node-manager-client.ts index a7512dd43..2da10534f 100644 --- a/apps/shinkai-desktop/src/lib/shinkai-node-manager/shinkai-node-manager-client.ts +++ b/apps/shinkai-desktop/src/lib/shinkai-node-manager/shinkai-node-manager-client.ts @@ -124,9 +124,10 @@ export const useShinkaiNodeRemoveStorageMutation = ( >, ) => { const response = useMutation({ - mutationFn: ( + mutationFn: async ( options: Partial, ): Promise => { + await invoke('shinkai_node_set_default_options'); return invoke('shinkai_node_remove_storage', { preserveKeys: options?.preserveKeys, }); diff --git a/apps/shinkai-desktop/src/store/settings.ts b/apps/shinkai-desktop/src/store/settings.ts index 0a063377d..ee419fb19 100644 --- a/apps/shinkai-desktop/src/store/settings.ts +++ b/apps/shinkai-desktop/src/store/settings.ts @@ -2,6 +2,8 @@ import { LocaleMode, switchLanguage } from '@shinkai_network/shinkai-i18n'; import { create } from 'zustand'; import { devtools, persist } from 'zustand/middleware'; +import { SetupData, useAuth } from './auth'; + type SettingsStore = { defaultAgentId: string; setDefaultAgentId: (defaultAgentId: string) => void; @@ -76,3 +78,15 @@ export const useSettings = create()( ), ), ); + +useAuth.subscribe((state, prevState) => { + handleAuthSideEffect(state.auth, prevState.auth); +}); + +const handleAuthSideEffect = async (auth: SetupData | null, prevAuth: SetupData | null) => { + // SignOut case + if (prevAuth && !auth) { + useSettings.getState().setDefaultAgentId(''); + return; + } +}; diff --git a/apps/shinkai-desktop/src/store/shinkai-node-manager.ts b/apps/shinkai-desktop/src/store/shinkai-node-manager.ts index 9abbfee9f..8bb792344 100644 --- a/apps/shinkai-desktop/src/store/shinkai-node-manager.ts +++ b/apps/shinkai-desktop/src/store/shinkai-node-manager.ts @@ -11,7 +11,7 @@ type ShinkaiNodeManagerStore = { setIsInUse: (value: boolean) => void; shinkaiNodeOptions: Partial | null; setShinkaiNodeOptions: ( - shinkaiNodeOptions: Partial, + shinkaiNodeOptions: Partial | null, ) => void; }; diff --git a/apps/shinkai-desktop/src/windows/shinkai-node-manager/main.tsx b/apps/shinkai-desktop/src/windows/shinkai-node-manager/main.tsx index 06ceb42e2..14dc869c1 100644 --- a/apps/shinkai-desktop/src/windows/shinkai-node-manager/main.tsx +++ b/apps/shinkai-desktop/src/windows/shinkai-node-manager/main.tsx @@ -125,8 +125,9 @@ const App = () => { isPending: shinkaiNodeRemoveStorageIsPending, mutateAsync: shinkaiNodeRemoveStorage, } = useShinkaiNodeRemoveStorageMutation({ - onSuccess: () => { + onSuccess: async () => { successRemovingShinkaiNodeStorageToast(); + setShinkaiNodeOptions(null); setLogout(); }, onError: () => { diff --git a/package-lock.json b/package-lock.json index 1d3d1aae4..938c9d3df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@shinkai/source", - "version": "0.7.28", + "version": "0.7.29", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@shinkai/source", - "version": "0.7.28", + "version": "0.7.29", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "workspaces": [ diff --git a/package.json b/package.json index 7c644fd72..25e8ffffb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@shinkai/source", - "version": "0.7.28", + "version": "0.7.29", "license": "SEE LICENSE IN LICENSE", "files": [ "LICENSE"