6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/kward/cli/project_skills_commands.rb', line 6
def handle_project_skills_cli_command(arguments)
argument = Array(arguments).join(" ").strip.downcase
_workspace_root, candidates, coordinator = project_skill_trust_coordinator
if candidates.empty? && argument != "untrust"
@prompt.say("No project skills found in the current workspace.")
return
end
case argument
when "", "status"
lines = candidates.empty? ? ["No project skills found in the current workspace."] : candidates.map { |candidate| "#{relative_workspace_path(candidate.path)}: #{coordinator.decision(candidate) || "needs review"}" }
@prompt.say(lines.join("\n"))
when "trust"
coordinator.record!(candidates, "allow")
@prompt.say("Project skills trusted for the current skill snapshots.")
when "untrust"
coordinator.remove_workspace!
@prompt.say("Project skill trust removed for this workspace.")
when "review"
review_project_skills(candidates)
else
raise ArgumentError, "Usage: kward skills [status|trust|untrust|review]"
end
end
|