@2kw/ai 8.1.0-dev.2 → 8.1.0-dev.21
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.
- package/dist/agent-config/schema.d.ts +9 -1
- package/dist/agent-config/schema.js +12 -1
- package/dist/commands/datasets.js +1 -1
- package/dist/lib/agent-run.js +3 -0
- package/dist/lib/output.d.ts +2 -0
- package/dist/lib/output.js +11 -0
- package/dist/lib/response-stream.js +2 -0
- package/package.json +1 -1
|
@@ -73,7 +73,15 @@ export declare const agentSchema: {
|
|
|
73
73
|
};
|
|
74
74
|
readonly options: {
|
|
75
75
|
readonly type: "object";
|
|
76
|
-
readonly description: "
|
|
76
|
+
readonly description: "Model and run options. Sending options replaces the whole object: a key left out is removed. reasoning.effort and maxToolRounds take effect on every run.";
|
|
77
|
+
readonly properties: {
|
|
78
|
+
readonly maxToolRounds: {
|
|
79
|
+
readonly type: readonly ["integer", "null"];
|
|
80
|
+
readonly minimum: 1;
|
|
81
|
+
readonly maximum: 100;
|
|
82
|
+
readonly description: "Maximum rounds of tool calls one request may take, 1 to 100; the platform default applies when absent. Also bounded by the deployment's run limit.";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
77
85
|
};
|
|
78
86
|
readonly skills: {
|
|
79
87
|
readonly type: "array";
|
|
@@ -84,7 +84,18 @@ export const agentSchema = {
|
|
|
84
84
|
instructions: { type: "string", maxLength: 20000 },
|
|
85
85
|
tools: { type: "array", items: { $ref: "#/$defs/tool" } },
|
|
86
86
|
hitlPolicy: { $ref: "#/$defs/hitlPolicy" },
|
|
87
|
-
options: {
|
|
87
|
+
options: {
|
|
88
|
+
type: "object",
|
|
89
|
+
description: "Model and run options. Sending options replaces the whole object: a key left out is removed. reasoning.effort and maxToolRounds take effect on every run.",
|
|
90
|
+
properties: {
|
|
91
|
+
maxToolRounds: {
|
|
92
|
+
type: ["integer", "null"],
|
|
93
|
+
minimum: 1,
|
|
94
|
+
maximum: 100,
|
|
95
|
+
description: "Maximum rounds of tool calls one request may take, 1 to 100; the platform default applies when absent. Also bounded by the deployment's run limit.",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
88
99
|
skills: {
|
|
89
100
|
type: "array",
|
|
90
101
|
maxItems: 20,
|
|
@@ -41,7 +41,7 @@ export function makeDatasetsCommand() {
|
|
|
41
41
|
.description("Create a new dataset")
|
|
42
42
|
.requiredOption("-n, --name <name>", "Dataset name")
|
|
43
43
|
.option("-d, --description <text>", "Dataset description")
|
|
44
|
-
.option("-t, --type <type>", "Dataset type")
|
|
44
|
+
.option("-t, --type <type>", "Dataset type (default: text)")
|
|
45
45
|
.option("--input-schema <json>", "Input JSON Schema")
|
|
46
46
|
.option("--expected-output-schema <json>", "Expected output JSON Schema")
|
|
47
47
|
.option("--metadata <json>", "Metadata (JSON)")
|
package/dist/lib/agent-run.js
CHANGED
|
@@ -189,6 +189,9 @@ const DECODED_ITEM_TYPES = new Set([
|
|
|
189
189
|
"backbone:tool_image",
|
|
190
190
|
// A table or chart a finished ShowTable or ShowChart call showed (#1419): it never holds a run either.
|
|
191
191
|
"backbone:ui",
|
|
192
|
+
// A canvas a finished CanvasWrite or CanvasEdit call saved, and a member's selection (#1698): neither holds a run.
|
|
193
|
+
"backbone:canvas",
|
|
194
|
+
"backbone:canvas_selection",
|
|
192
195
|
"mcp_approval_request",
|
|
193
196
|
"mcp_call",
|
|
194
197
|
"mcp_list_tools",
|
package/dist/lib/output.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare function formatList(items: AnyRecord[] | undefined, command: Comm
|
|
|
22
22
|
* Display a success message.
|
|
23
23
|
*/
|
|
24
24
|
export declare function formatSuccess(message: string, command: Command): void;
|
|
25
|
+
/** Stops the running spinner, if any, which shows the cursor again. Call it before `process.exit`. */
|
|
26
|
+
export declare function stopSpinner(): void;
|
|
25
27
|
/**
|
|
26
28
|
* Run an async action with a spinner.
|
|
27
29
|
*/
|
package/dist/lib/output.js
CHANGED
|
@@ -82,11 +82,18 @@ export function formatSuccess(message, command) {
|
|
|
82
82
|
console.log(chalk.green(message));
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
/** The spinner `withSpinner` runs now, so an exit on Ctrl+C can stop it: ora hides the cursor while it spins (#1733). */
|
|
86
|
+
let running;
|
|
87
|
+
/** Stops the running spinner, if any, which shows the cursor again. Call it before `process.exit`. */
|
|
88
|
+
export function stopSpinner() {
|
|
89
|
+
running?.stop();
|
|
90
|
+
}
|
|
85
91
|
/**
|
|
86
92
|
* Run an async action with a spinner.
|
|
87
93
|
*/
|
|
88
94
|
export async function withSpinner(text, action) {
|
|
89
95
|
const spinner = ora(text).start();
|
|
96
|
+
running = spinner;
|
|
90
97
|
try {
|
|
91
98
|
const result = await action(spinner);
|
|
92
99
|
spinner.succeed();
|
|
@@ -96,6 +103,10 @@ export async function withSpinner(text, action) {
|
|
|
96
103
|
spinner.fail();
|
|
97
104
|
throw err;
|
|
98
105
|
}
|
|
106
|
+
finally {
|
|
107
|
+
if (running === spinner)
|
|
108
|
+
running = undefined;
|
|
109
|
+
}
|
|
99
110
|
}
|
|
100
111
|
function formatValue(value) {
|
|
101
112
|
if (value === null || value === undefined)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BackboneApiError } from "./errors.js";
|
|
2
|
+
import { stopSpinner } from "./output.js";
|
|
2
3
|
/**
|
|
3
4
|
* POSTs an agent turn to `/v1/responses` and returns its terminal response, as `stream: false` would (#1729).
|
|
4
5
|
* The turn is streamed: a proxy in front of the API cuts a request that answers nothing for 100 s (HTTP 524),
|
|
@@ -47,6 +48,7 @@ async function readResponseStream(body, onStart) {
|
|
|
47
48
|
timestamp: new Date().toISOString(),
|
|
48
49
|
});
|
|
49
50
|
const onInterrupt = () => {
|
|
51
|
+
stopSpinner(); // a spinning ora hides the cursor, and process.exit would leave it hidden (#1733)
|
|
50
52
|
console.error(`Interrupted.${readHint(started)}`);
|
|
51
53
|
process.exit(130);
|
|
52
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai",
|
|
3
|
-
"version": "8.1.0-dev.
|
|
3
|
+
"version": "8.1.0-dev.21",
|
|
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",
|