@2kw/ai 6.3.0-dev.72 → 6.3.0-dev.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,17 @@ async function checkResponse(res) {
21
21
  timestamp: body.timestamp ?? new Date().toISOString(),
22
22
  });
23
23
  }
24
+ const MIN_ROLES = ["user", "viewer", "member", "admin", "owner"];
25
+ /** A role word as the API's `Role`, or null for `none` (#785). */
26
+ function parseMinRole(word) {
27
+ const lower = word.trim().toLowerCase();
28
+ if (lower === "none")
29
+ return null;
30
+ if (MIN_ROLES.includes(lower)) {
31
+ return lower.toUpperCase();
32
+ }
33
+ throw new Error(`Role must be one of: ${MIN_ROLES.join(", ")}, none`);
34
+ }
24
35
  /** Manage skills, versions and labels (#642). */
25
36
  export function makeSkillsCommand() {
26
37
  const cmd = new Command("skills").description("Manage skills");
@@ -75,6 +86,24 @@ export function makeSkillsCommand() {
75
86
  formatDetail(data, command);
76
87
  });
77
88
  });
89
+ cmd
90
+ .command("min-role")
91
+ .description("Set the minimum organization role that sees this skill in agent runs (admin only); none removes it")
92
+ .argument("<id>", "Skill ID")
93
+ .argument("<role>", "user, viewer, member, admin, owner or none")
94
+ .action(async (id, role, _opts, command) => {
95
+ await runAction(command, async () => {
96
+ const minRole = parseMinRole(role);
97
+ const client = getClient(command);
98
+ const { data } = await client.PUT("/v1/skills/{id}/min-role", {
99
+ params: { path: { id } },
100
+ // The spec publishes minRole without null (springdoc marks no record component
101
+ // nullable); the operation documents null as "remove the minimum", and it is sent as such.
102
+ body: { minRole: minRole },
103
+ });
104
+ formatDetail(data, command);
105
+ });
106
+ });
78
107
  cmd
79
108
  .command("delete")
80
109
  .description("Delete a skill")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2kw/ai",
3
- "version": "6.3.0-dev.72",
3
+ "version": "6.3.0-dev.75",
4
4
  "description": "CLI for 2kw.ai — schema-driven document extraction, an OpenAI-compatible EU LLM gateway, transcription, prompts, datasets, and experiments from your terminal or agentic workflows. Ships as 2kw, backbone, and bb.",
5
5
  "keywords": [
6
6
  "cli",