feat(03-02): add SkillDetail pane, SkillAgentToggles, and assignment query IPC
- Add listSkillAgents and listAgentSkills IPC channels with Zod schemas - Create SkillDetail component with metadata, file viewer, update check, delete - Create SkillAgentToggles with discriminated union for skill/agent-centric modes - Wire SkillDetail into SkillsSection right column replacing placeholder - Remove duplicate skill method declarations from DesktopApi type
This commit is contained in:
1 parent
6397c118ea
commit
e71d2e5529
8 files changed
+489
-19
No files matched your search
@@ -19,5 +19,6 @@ export function registerDomainHandlers(dependencies: RegisterDomainHandlersDepen
|
||||
ensureCompanyExists: dependencies.ensureCompanyExists,
|
||||
publishDomainChanged: dependencies.publishDomainChanged,
|
||||
skillService: dependencies.skillService,
|
||||
db: dependencies.db,
|
||||
});
|
||||
}
|
||||
@@ -7,15 +7,19 @@ import {
|
||||
assignSkillToAgentSchema,
|
||||
removeSkillFromAgentSchema,
|
||||
checkSkillUpdateSchema,
|
||||
listSkillAgentsSchema,
|
||||
listAgentSkillsSchema,
|
||||
} from "@shared/contracts";
|
||||
import { fail, ok, type RegisterDomainHandlersDependencies } from "./ipc-domain-common";
|
||||
import type { createSkillService } from "./skill-service";
|
||||
import type { AppDatabase } from "./database";
|
||||
|
||||
interface SkillHandlerDependencies extends Pick<
|
||||
RegisterDomainHandlersDependencies,
|
||||
"registerHandle" | "ensureCompanyExists" | "publishDomainChanged"
|
||||
> {
|
||||
skillService: ReturnType<typeof createSkillService> | null;
|
||||
db: AppDatabase;
|
||||
}
|
||||
|
||||
export function registerSkillHandlers({
|
||||
@@ -23,6 +27,7 @@ export function registerSkillHandlers({
|
||||
ensureCompanyExists,
|
||||
publishDomainChanged,
|
||||
skillService,
|
||||
db,
|
||||
}: SkillHandlerDependencies) {
|
||||
function requireSkillService() {
|
||||
if (!skillService) {
|
||||
@@ -116,4 +121,20 @@ export function registerSkillHandlers({
|
||||
if (serviceError) return serviceError;
|
||||
return skillService!.checkUpdateStatus(parsed.companyId, parsed.skillId);
|
||||
});
|
||||
|
||||
// ---- List agent IDs assigned to a skill ----
|
||||
registerHandle(IPC_CHANNELS.listSkillAgents, async (_event, payload) => {
|
||||
const parsed = listSkillAgentsSchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
return ok(db.listSkillAgentAssignments(parsed.skillId));
|
||||
});
|
||||
|
||||
// ---- List skill IDs assigned to an agent ----
|
||||
registerHandle(IPC_CHANNELS.listAgentSkills, async (_event, payload) => {
|
||||
const parsed = listAgentSkillsSchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
return ok(db.listAgentSkillAssignments(parsed.agentId));
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user