refactor: extract dashboard and message-runtime from index.ts

- Extract dashboard code into src/dashboard.ts
- Extract message runtime into src/message-runtime.ts
- Improve group-queue with better concurrency handling
- Update agent-runner with enhanced env/config passing
- Simplify DB operations and cleanup unused code
- Update README for Codex SDK architecture
This commit is contained in:
Eyejoker
2026-03-16 05:08:19 +09:00
parent e23315ed48
commit 7e77f37948
14 changed files with 1392 additions and 1084 deletions

View File

@@ -3,12 +3,15 @@ import { describe, it, expect, beforeEach } from 'vitest';
import {
_initTestDatabase,
createTask,
deleteSession,
deleteTask,
getAllChats,
getAllRegisteredGroups,
getMessagesSince,
getNewMessages,
getSession,
getTaskById,
setSession,
setRegisteredGroup,
storeChatMetadata,
storeMessage,
@@ -300,6 +303,16 @@ describe('getNewMessages', () => {
});
});
describe('session accessors', () => {
it('deletes only the current service session for a group', () => {
setSession('group-a', 'session-123');
expect(getSession('group-a')).toBe('session-123');
deleteSession('group-a');
expect(getSession('group-a')).toBeUndefined();
});
});
// --- storeChatMetadata ---
describe('storeChatMetadata', () => {