@2kw/ai 6.3.0-dev.53 → 6.3.0-dev.62

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.
@@ -106,6 +106,9 @@ export declare const agentSchema: {
106
106
  readonly destructiveHint: {
107
107
  readonly type: "boolean";
108
108
  };
109
+ readonly openWorldHint: {
110
+ readonly type: "boolean";
111
+ };
109
112
  };
110
113
  };
111
114
  readonly fileSearchTool: {
@@ -84,7 +84,13 @@ export const agentSchema = {
84
84
  annotations: {
85
85
  type: "object",
86
86
  required: ["readOnlyHint", "destructiveHint"],
87
- properties: { readOnlyHint: { type: "boolean" }, destructiveHint: { type: "boolean" } },
87
+ properties: {
88
+ readOnlyHint: { type: "boolean" },
89
+ destructiveHint: { type: "boolean" },
90
+ // Optional. With destructiveHint: false it declares the tool harmless, so a write under
91
+ // `auto` may reach the approver (#938).
92
+ openWorldHint: { type: "boolean" },
93
+ },
88
94
  },
89
95
  fileSearchTool: {
90
96
  type: "object",
@@ -43,7 +43,7 @@ tools: []
43
43
  # properties:
44
44
  # order: { type: string }
45
45
  # required: [order]
46
- # annotations: { readOnlyHint: true, destructiveHint: false }
46
+ # annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false }
47
47
  # Approval policy. Defaults: read allow, write approve, destructive block. Rules can only tighten.
48
48
  # hitlPolicy:
49
49
  # version: 1
@@ -49,10 +49,12 @@ export function makeBillingCommand() {
49
49
  }
50
50
  console.log();
51
51
  }
52
+ // A null maximum is "unlimited" (schemas and prompts in every tier since #971), not 0.
53
+ const max = (value) => (value == null ? "unlimited" : String(value));
52
54
  console.log(chalk.bold("Usage:"));
53
- console.log(` Schemas: ${data?.currentSchemas ?? 0} / ${data?.maxSchemas ?? 0}`);
54
- console.log(` Prompts: ${data?.currentPrompts ?? 0} / ${data?.maxPrompts ?? 0}`);
55
- console.log(` Team members: ${data?.currentTeamMembers ?? 0} / ${data?.maxTeamMembers ?? 0}`);
55
+ console.log(` Schemas: ${data?.currentSchemas ?? 0} / ${max(data?.maxSchemas)}`);
56
+ console.log(` Prompts: ${data?.currentPrompts ?? 0} / ${max(data?.maxPrompts)}`);
57
+ console.log(` Team members: ${data?.currentTeamMembers ?? 0} / ${max(data?.maxTeamMembers)}`);
56
58
  console.log();
57
59
  console.log(chalk.bold("Features:"));
58
60
  console.log(` BYOK: ${data?.byokEnabled ? chalk.green("yes") : chalk.dim("no")}`);
@@ -1,4 +1,4 @@
1
- import { Command } from "commander";
1
+ import { Command, InvalidArgumentError } from "commander";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { getClient, runAction } from "../lib/client.js";
4
4
  import { formatPage, formatDetail } from "../lib/output.js";
@@ -48,6 +48,32 @@ export function makeSkillVersionsCommand() {
48
48
  formatDetail(data, command);
49
49
  });
50
50
  });
51
+ cmd
52
+ .command("restore")
53
+ .description("Restore a version as a new version; latest moves to it (the newest version is reused when it already has the content)")
54
+ .argument("<id>", "Skill ID")
55
+ .argument("<versionNumber>", "Version number to restore", parseVersionNumber)
56
+ .action(async (id, versionNumber, _opts, command) => {
57
+ await runAction(command, async () => {
58
+ const client = getClient(command);
59
+ const { data, response } = await client.POST("/v1/skills/{id}/versions/{versionNumber}/restore", {
60
+ params: { path: { id, versionNumber } },
61
+ });
62
+ // 200, not 201: the newest version already had the content and latest moved to it.
63
+ if (response.status === 200 && data) {
64
+ console.error(`No new version: v${data.versionNumber} already has the content of v${versionNumber}; latest now points at v${data.versionNumber}.`);
65
+ }
66
+ formatDetail(data, command);
67
+ });
68
+ });
51
69
  return cmd;
52
70
  }
71
+ /** A restore names an existing version by number; refuse anything else before calling the API (#783). */
72
+ function parseVersionNumber(value) {
73
+ const n = Number(value);
74
+ if (!/^\d+$/.test(value) || n < 1) {
75
+ throw new InvalidArgumentError("Version number must be a positive integer.");
76
+ }
77
+ return n;
78
+ }
53
79
  //# sourceMappingURL=skill-versions.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2kw/ai",
3
- "version": "6.3.0-dev.53",
3
+ "version": "6.3.0-dev.62",
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",