@2kw/ai 6.3.0-dev.45 → 6.3.0-dev.61

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
@@ -131,7 +131,7 @@ export function makeExperimentsCommand() {
131
131
  .description("Add a variant to an experiment")
132
132
  .requiredOption("--experiment <id>", "Experiment ID")
133
133
  .requiredOption("-n, --name <name>", "Variant name")
134
- .requiredOption("--task-type <type>", "Task type")
134
+ .requiredOption("--task-type <type>", "Task type: extraction or agent")
135
135
  .requiredOption("--config <json>", "Variant configuration (JSON)")
136
136
  .option("-d, --description <text>", "Variant description")
137
137
  .option("--sort-order <n>", "Sort order", parseInt)
@@ -179,7 +179,7 @@ export function makeExperimentsCommand() {
179
179
  .argument("<variantId>", "Variant ID")
180
180
  .requiredOption("--experiment <id>", "Experiment ID")
181
181
  .option("-n, --name <name>", "Variant name")
182
- .option("--task-type <type>", "Task type")
182
+ .option("--task-type <type>", "Task type; must equal the variant's current one (it cannot change)")
183
183
  .option("--config <json>", "Variant configuration (JSON)")
184
184
  .option("-d, --description <text>", "Variant description")
185
185
  .option("--sort-order <n>", "Sort order", parseInt)
@@ -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.45",
3
+ "version": "6.3.0-dev.61",
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",