- LOT C2 (§14.5.3) : use cases de configuration des embedders déclaratifs (List/Save/Delete + DescribeEmbedderEngines : modèles ONNX recommandés, environnement local détecté, stratégies compilées). UI EmbedderSettings. - LOT C3 (§14.5.5) : suggestion contextuelle best-effort à l'activation quand la mémoire dépasse le budget de recall sans embedder configuré (event EmbedderSuggested, anti-spam 1×/session, « ne plus demander »). - Contexte projet partagé .ideai/CONTEXT.md (model-agnostic) injecté à tous les agents/profils au lancement, avant la persona. UI ProjectContextPanel. Tests : backend workspace vert (0 échec) ; frontend 306/306. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
28 lines
912 B
TypeScript
28 lines
912 B
TypeScript
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
|
|
const invoke = vi.fn();
|
|
vi.mock("@tauri-apps/api/core", () => ({
|
|
invoke: (...args: unknown[]) => invoke(...args),
|
|
}));
|
|
|
|
import { TauriProjectGateway } from "./project";
|
|
|
|
describe("TauriProjectGateway invoke payloads", () => {
|
|
beforeEach(() => invoke.mockReset().mockResolvedValue({}));
|
|
|
|
it("reads and updates the project context under .ideai", async () => {
|
|
invoke.mockResolvedValueOnce("# shared");
|
|
await expect(new TauriProjectGateway().readProjectContext("proj-1")).resolves.toBe(
|
|
"# shared",
|
|
);
|
|
expect(invoke).toHaveBeenCalledWith("read_project_context", {
|
|
projectId: "proj-1",
|
|
});
|
|
|
|
await new TauriProjectGateway().updateProjectContext("proj-1", "# next");
|
|
expect(invoke).toHaveBeenCalledWith("update_project_context", {
|
|
request: { projectId: "proj-1", content: "# next" },
|
|
});
|
|
});
|
|
});
|