Download apps/desktop/src/sdk/plugin-open-session-plan.test.ts from SaylorTwift/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 2.29 kB
-
https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/apps/desktop/src/sdk/plugin-open-session-plan.test.ts
- Command line
-
hf download hf://SaylorTwift/hermes-agent/apps/desktop/src/sdk/plugin-open-session-plan.test.ts
-
curl -L -o plugin-open-session-plan.test.ts https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/apps/desktop/src/sdk/plugin-open-session-plan.test.ts
2.29 kB
| import { describe, expect, it } from 'vitest' | |
| import { planPluginOpenSession } from './plugin-open-session-plan' | |
| describe('planPluginOpenSession', () => { | |
| it('defaults to navigation: dial the worker, do not steal chrome', () => { | |
| const plan = planPluginOpenSession({ | |
| activeProfile: 'default', | |
| profile: 'worker' | |
| }) | |
| expect(plan.switchWorkspace).toBeNull() | |
| expect(plan.dialWithoutSwitching).toBe('worker') | |
| expect(plan.showAllProfiles).toBe(true) | |
| expect(plan.requireActiveProfileForHydration).toBe(false) | |
| }) | |
| it('does not steal chrome even when keepAllProfilesScope is explicitly true', () => { | |
| const plan = planPluginOpenSession({ | |
| activeProfile: 'default', | |
| keepAllProfilesScope: true, | |
| profile: 'worker' | |
| }) | |
| expect(plan.switchWorkspace).toBeNull() | |
| expect(plan.dialWithoutSwitching).toBe('worker') | |
| expect(plan.showAllProfiles).toBe(true) | |
| expect(plan.requireActiveProfileForHydration).toBe(false) | |
| }) | |
| it('does not re-dial when chrome is already on that profile', () => { | |
| const plan = planPluginOpenSession({ | |
| activeProfile: 'worker', | |
| keepAllProfilesScope: true, | |
| profile: 'worker' | |
| }) | |
| expect(plan.switchWorkspace).toBeNull() | |
| expect(plan.dialWithoutSwitching).toBeNull() | |
| // Still restores the unified list: re-opening an already-live bot must not | |
| // leave Sessions collapsed onto a profile whose forever-chat is hidden. | |
| expect(plan.showAllProfiles).toBe(true) | |
| }) | |
| it('treats keepAllProfilesScope:false as an explicit workspace switch', () => { | |
| const plan = planPluginOpenSession({ | |
| activeProfile: 'default', | |
| keepAllProfilesScope: false, | |
| profile: 'worker' | |
| }) | |
| expect(plan.switchWorkspace).toBe('worker') | |
| expect(plan.dialWithoutSwitching).toBeNull() | |
| expect(plan.showAllProfiles).toBe(false) | |
| expect(plan.requireActiveProfileForHydration).toBe(true) | |
| }) | |
| it('treats an empty profile as neither a dial nor a workspace switch', () => { | |
| const plan = planPluginOpenSession({ | |
| activeProfile: 'default', | |
| keepAllProfilesScope: true, | |
| profile: ' ' | |
| }) | |
| expect(plan.switchWorkspace).toBeNull() | |
| expect(plan.dialWithoutSwitching).toBeNull() | |
| expect(plan.showAllProfiles).toBeNull() | |
| }) | |
| }) | |