feat: update desktop workflows and app center

This commit is contained in:
inman
2026-05-13 19:14:56 +08:00
parent 20b5aff4ad
commit 7c8781a6e3
160 changed files with 55492 additions and 1423 deletions

View File

@@ -133,7 +133,11 @@ describe('chat session actions', () => {
actions.newSession();
const next = h.read();
expect(next.currentSessionKey).toBe('agent:main:session-1711111111111');
expect(next.sessions.some((s) => s.key === 'agent:main:session-1711111111111')).toBe(true);
expect(next.sessions.find((s) => s.key === 'agent:main:session-1711111111111')).toMatchObject({
key: 'agent:main:session-1711111111111',
updatedAt: 1711111111111,
});
expect(next.sessionLastActivity['agent:main:session-1711111111111']).toBeUndefined();
expect(next.messages).toEqual([]);
expect(next.streamingText).toBe('');
expect(next.activeRunId).toBeNull();
@@ -141,6 +145,24 @@ describe('chat session actions', () => {
nowSpy.mockRestore();
});
it('switchSession adds a missing target session immediately', async () => {
const { createSessionActions } = await import('@/stores/chat/session-actions');
const h = makeHarness({
currentSessionKey: 'agent:main:main',
sessions: [{ key: 'agent:main:main' }],
});
const actions = createSessionActions(h.set as never, h.get as never);
actions.switchSession('agent:main:cron:job-1');
const next = h.read();
expect(next.currentSessionKey).toBe('agent:main:cron:job-1');
expect(next.sessions.find((s) => s.key === 'agent:main:cron:job-1')).toMatchObject({
key: 'agent:main:cron:job-1',
displayName: 'agent:main:cron:job-1',
});
expect(h.read().loadHistory).toHaveBeenCalledTimes(1);
});
it('seeds sessionLastActivity from backend updatedAt metadata', async () => {
const { createSessionActions } = await import('@/stores/chat/session-actions');
const h = makeHarness({