feat: @agor/stores package (3 stores) + 58 BackendAdapter tests

@agor/stores:
- theme.svelte.ts, notifications.svelte.ts, health.svelte.ts extracted
- Original files replaced with re-exports (zero consumer changes needed)
- pnpm workspace + Vite/tsconfig aliases configured

BackendAdapter tests (58 new):
- backend-adapter.test.ts: 9 tests (lifecycle, singleton, testing seam)
- tauri-adapter.test.ts: 28 tests (invoke mapping, command names, params)
- electrobun-adapter.test.ts: 21 tests (RPC names, capabilities, stubs)

Total: 523 tests passing (was 465, +58)
This commit is contained in:
Hibryda 2026-03-22 04:45:56 +01:00
parent 5e1fd62ed9
commit f0850f0785
22 changed files with 1389 additions and 25 deletions

View file

@ -413,6 +413,21 @@ export type PtyRPCRequests = {
}>;
};
};
/** Feature 7: Join a channel. */
"btmsg.joinChannel": {
params: { channelId: string; agentId: string };
response: { ok: boolean; error?: string };
};
/** Feature 7: Leave a channel. */
"btmsg.leaveChannel": {
params: { channelId: string; agentId: string };
response: { ok: boolean; error?: string };
};
/** Feature 7: Get channel member list. */
"btmsg.getChannelMembers": {
params: { channelId: string };
response: { members: Array<{ agentId: string; name: string; role: string }> };
};
/** Send a channel message. */
"btmsg.sendChannelMessage": {
params: { channelId: string; fromAgent: string; content: string };
@ -587,6 +602,21 @@ export type PtyRPCRequests = {
params: { machineId: string; command: string; payload: Record<string, unknown> };
response: { ok: boolean; error?: string };
};
/** Feature 3: Get stored relay credentials. */
"remote.getStoredCredentials": {
params: Record<string, never>;
response: { credentials: Array<{ url: string; label: string }> };
};
/** Feature 3: Store a relay credential (XOR-obfuscated). */
"remote.storeCredential": {
params: { url: string; token: string; label?: string };
response: { ok: boolean };
};
/** Feature 3: Delete a stored relay credential. */
"remote.deleteCredential": {
params: { url: string };
response: { ok: boolean };
};
/** Get the status of a specific machine. */
"remote.status": {
params: { machineId: string };
@ -599,6 +629,18 @@ export type PtyRPCRequests = {
// ── Telemetry RPC ─────────────────────────────────────────────────────────
/** Feature 8: Transport diagnostics stats. */
"diagnostics.stats": {
params: Record<string, never>;
response: {
ptyConnected: boolean;
relayConnections: number;
activeSidecars: number;
rpcCallCount: number;
droppedEvents: number;
};
};
/** Log a telemetry event from the frontend. */
"telemetry.log": {
params: {
@ -680,6 +722,12 @@ export type PtyRPCMessages = {
status: "connecting" | "connected" | "disconnected" | "error";
error?: string;
};
// Feature 4: Push-based task/relay updates
/** Task board data changed (created, moved, deleted). */
"bttask.changed": { groupId: string };
/** New btmsg channel or DM message. */
"btmsg.newMessage": { groupId: string; channelId?: string };
};
// ── Combined schema ───────────────────────────────────────────────────────────