refactor(FN-2162): rename kb-agent identifiers to fn-agent

- Rename core loader, dashboard server chat/planning routes, and frontend agent IDs/storage keys from kb-agent to fn-agent naming
- Update dashboard hooks and components (agent list, chat view, quick chat) to use the new fn agent key prefixes consistently
- Refresh engine, dashboard, core, and CLI tests/mocks to remove remaining kb-agent route and temp prefix references
- Update storage/gap-analysis docs to reflect fn agent key names and add a @gsxdsm/fusion patch changeset for the rename
This commit is contained in:
Fusion
2026-04-19 19:40:10 -07:00
committed by gsxdsm
parent 27b3709c4d
commit 19d62b41f5
51 changed files with 878 additions and 873 deletions

View File

@@ -2,12 +2,12 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
const { mockCreateKbAgent } = vi.hoisted(() => ({
mockCreateKbAgent: vi.fn(),
const { mockCreateFnAgent } = vi.hoisted(() => ({
mockCreateFnAgent: vi.fn(),
}));
vi.mock("@fusion/engine", () => ({
createFnAgent: mockCreateKbAgent,
createFnAgent: mockCreateFnAgent,
}));
import {
@@ -110,7 +110,7 @@ function createMockAgent(responses: string[]) {
};
// Setup mock to capture callbacks
mockCreateKbAgent.mockImplementation(async (options: any) => {
mockCreateFnAgent.mockImplementation(async (options: any) => {
thinkingCb = options?.onThinking;
textCb = options?.onText;
return agent;
@@ -220,7 +220,7 @@ describe("milestone-slice-interview module", () => {
// Reset cached createFnAgent to force re-import with mock
const mod = await import("./milestone-slice-interview.js") as any;
mod.__resetEngine?.();
mockCreateKbAgent.mockImplementation(async () => createMockAgent([createQuestionJson()]));
mockCreateFnAgent.mockImplementation(async () => createMockAgent([createQuestionJson()]));
});
describe("session lifecycle", () => {
@@ -439,7 +439,7 @@ describe("milestone-slice-interview module", () => {
}));
setAiSessionStore(store);
mockCreateKbAgent.mockImplementation(async () => createMockAgent([createQuestionJson()]));
mockCreateFnAgent.mockImplementation(async () => createMockAgent([createQuestionJson()]));
await expect(retryTargetInterviewSession(sessionId, "/tmp/project")).resolves.not.toThrow();
});