mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-06-02 13:13:43 -04:00
* feat(agents): create agent registry and service * fix: mark agent offline only if the session was removed properly * refactor: centralize agent backup lifecycle state * refactor: simplify session management * refactor: move effect / async boundary in one place * chore: regen migration * refactor: improve error handling * chore: pr feedback
41 lines
1022 B
TypeScript
41 lines
1022 B
TypeScript
import { vi } from "vitest";
|
|
import { Effect } from "effect";
|
|
|
|
process.env.BASE_URL = "http://localhost:3000";
|
|
process.env.TRUSTED_ORIGINS = "http://localhost:3000";
|
|
|
|
vi.mock(import("@zerobyte/core/node"), async () => {
|
|
const utils = await vi.importActual<typeof import("@zerobyte/core/node")>("@zerobyte/core/node");
|
|
|
|
return {
|
|
...utils,
|
|
logger: {
|
|
debug: () => {},
|
|
info: () => {},
|
|
warn: () => {},
|
|
error: () => {},
|
|
effect: {
|
|
debug: () => Effect.void,
|
|
info: () => Effect.void,
|
|
warn: () => Effect.void,
|
|
error: () => Effect.void,
|
|
},
|
|
},
|
|
};
|
|
});
|
|
|
|
vi.mock(import("~/server/utils/crypto"), async () => {
|
|
const cryptoModule = await vi.importActual<typeof import("~/server/utils/crypto")>("~/server/utils/crypto");
|
|
|
|
return {
|
|
...cryptoModule,
|
|
cryptoUtils: {
|
|
...cryptoModule.cryptoUtils,
|
|
deriveSecret: async () => "test-secret",
|
|
sealSecret: async (v: string) => v,
|
|
resolveSecret: async (v: string) => v,
|
|
generateResticPassword: () => "test-restic-password",
|
|
},
|
|
};
|
|
});
|