fix: fix some displays and features

This commit is contained in:
2026-06-06 17:06:45 +02:00
parent 2332b7f815
commit 3be55795a6
31 changed files with 3118 additions and 30 deletions

View File

@ -0,0 +1,70 @@
/**
* Tauri adapter for {@link SkillGateway} (L12).
*
* Commands use snake_case (Tauri convention); payload keys are camelCase
* (matching the backend DTO `#[serde(rename_all = "camelCase")]`), consistent
* with the other adapters in this directory. The `scope` value (`"global"` /
* `"project"`) maps directly onto the backend `SkillScope` serde enum.
*/
import { invoke } from "@tauri-apps/api/core";
import type { Skill, SkillScope } from "@/domain";
import type { CreateSkillInput, SkillGateway } from "@/ports";
export class TauriSkillGateway implements SkillGateway {
listSkills(projectId: string, scope: SkillScope): Promise<Skill[]> {
return invoke<Skill[]>("list_skills", { projectId, scope });
}
createSkill(input: CreateSkillInput): Promise<Skill> {
return invoke<Skill>("create_skill", {
request: {
projectId: input.projectId,
name: input.name,
content: input.content,
scope: input.scope,
},
});
}
updateSkill(
projectId: string,
scope: SkillScope,
skillId: string,
content: string,
): Promise<Skill> {
return invoke<Skill>("update_skill", {
request: { projectId, scope, skillId, content },
});
}
async deleteSkill(
projectId: string,
scope: SkillScope,
skillId: string,
): Promise<void> {
await invoke("delete_skill", { projectId, scope, skillId });
}
async assignSkill(
projectId: string,
agentId: string,
skillId: string,
scope: SkillScope,
): Promise<void> {
await invoke("assign_skill_to_agent", {
request: { projectId, agentId, skillId, scope },
});
}
async unassignSkill(
projectId: string,
agentId: string,
skillId: string,
): Promise<void> {
await invoke("unassign_skill_from_agent", {
request: { projectId, agentId, skillId },
});
}
}