@2kw/ai 8.5.0-dev.8 → 8.5.1
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.
|
@@ -701,9 +701,36 @@ export declare const agentSchema: {
|
|
|
701
701
|
readonly propertyNames: {
|
|
702
702
|
readonly pattern: "\\S";
|
|
703
703
|
};
|
|
704
|
+
readonly patternProperties: {
|
|
705
|
+
readonly "\\*": {
|
|
706
|
+
readonly type: "string";
|
|
707
|
+
readonly enum: readonly ["read", "write", "destructive", "approve", "deny"];
|
|
708
|
+
};
|
|
709
|
+
};
|
|
704
710
|
readonly additionalProperties: {
|
|
705
711
|
readonly type: "string";
|
|
706
|
-
readonly enum: readonly ["read", "write", "destructive", "approve", "deny"];
|
|
712
|
+
readonly enum: readonly ["read", "write", "destructive", "approve", "deny", "allow", "ask"];
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
readonly connectors: {
|
|
716
|
+
readonly type: "object";
|
|
717
|
+
readonly additionalProperties: {
|
|
718
|
+
readonly type: "object";
|
|
719
|
+
readonly additionalProperties: false;
|
|
720
|
+
readonly properties: {
|
|
721
|
+
readonly read: {
|
|
722
|
+
readonly type: "string";
|
|
723
|
+
readonly enum: readonly ["approve", "block"];
|
|
724
|
+
};
|
|
725
|
+
readonly write: {
|
|
726
|
+
readonly type: "string";
|
|
727
|
+
readonly enum: readonly ["approve", "block"];
|
|
728
|
+
};
|
|
729
|
+
readonly destructive: {
|
|
730
|
+
readonly type: "string";
|
|
731
|
+
readonly enum: readonly ["approve", "block"];
|
|
732
|
+
};
|
|
733
|
+
};
|
|
707
734
|
};
|
|
708
735
|
};
|
|
709
736
|
};
|
|
@@ -362,7 +362,7 @@ export const agentSchema = {
|
|
|
362
362
|
additionalProperties: false,
|
|
363
363
|
properties: {
|
|
364
364
|
read: oneOfLowercase("allow", "approve", "block", "deny"),
|
|
365
|
-
write: oneOfLowercase("approve", "block", "deny"),
|
|
365
|
+
write: oneOfLowercase("allow", "approve", "block", "deny"),
|
|
366
366
|
destructive: oneOfLowercase("approve", "block", "deny"),
|
|
367
367
|
},
|
|
368
368
|
},
|
|
@@ -371,7 +371,22 @@ export const agentSchema = {
|
|
|
371
371
|
// classes (read, write, destructive) are case-insensitive and lowercased by the validator.
|
|
372
372
|
type: "object",
|
|
373
373
|
propertyNames: { pattern: "\\S" },
|
|
374
|
-
|
|
374
|
+
// A tool's own level (allow, ask; #2066) names one tool exactly, so a pattern with `*` may not take it.
|
|
375
|
+
patternProperties: { "\\*": { type: "string", enum: ["read", "write", "destructive", "approve", "deny"] } },
|
|
376
|
+
additionalProperties: { type: "string", enum: ["read", "write", "destructive", "approve", "deny", "allow", "ask"] },
|
|
377
|
+
},
|
|
378
|
+
connectors: {
|
|
379
|
+
// A connector's group level per kind (#2066): approve or block; Always allow is set per tool.
|
|
380
|
+
type: "object",
|
|
381
|
+
additionalProperties: {
|
|
382
|
+
type: "object",
|
|
383
|
+
additionalProperties: false,
|
|
384
|
+
properties: {
|
|
385
|
+
read: { type: "string", enum: ["approve", "block"] },
|
|
386
|
+
write: { type: "string", enum: ["approve", "block"] },
|
|
387
|
+
destructive: { type: "string", enum: ["approve", "block"] },
|
|
388
|
+
},
|
|
389
|
+
},
|
|
375
390
|
},
|
|
376
391
|
},
|
|
377
392
|
},
|
|
@@ -53,7 +53,8 @@ tools:
|
|
|
53
53
|
# order: { type: string }
|
|
54
54
|
# required: [order]
|
|
55
55
|
# annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false }
|
|
56
|
-
# Approval policy. Defaults: read allow, write approve, destructive block. Rules
|
|
56
|
+
# Approval policy. Defaults: read allow, write approve, destructive block. Rules only tighten.
|
|
57
|
+
# Where the deployment offers Always allow, write: allow and an exact tool rule allow or ask loosen.
|
|
57
58
|
# hitlPolicy:
|
|
58
59
|
# version: 1
|
|
59
60
|
# classes: { read: allow, write: approve, destructive: block }
|
package/dist/commands/tracing.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import { usageLabel } from "../lib/call-usage.js";
|
|
2
3
|
import { getClient, runAction } from "../lib/client.js";
|
|
4
|
+
import { isJsonOutput } from "../lib/config.js";
|
|
3
5
|
import { formatDetail, formatList } from "../lib/output.js";
|
|
4
6
|
import { tracingSettingsBody } from "../lib/tracing-settings.js";
|
|
5
7
|
export function makeTracingCommand() {
|
|
@@ -102,7 +104,13 @@ export function makeTracingCommand() {
|
|
|
102
104
|
},
|
|
103
105
|
});
|
|
104
106
|
const page = data;
|
|
105
|
-
|
|
107
|
+
const content = (page?.content ?? []);
|
|
108
|
+
formatList(isJsonOutput(command)
|
|
109
|
+
? content
|
|
110
|
+
: content.map((s) => ({
|
|
111
|
+
...s,
|
|
112
|
+
usage: usageLabel(s.usage, s.costUsd),
|
|
113
|
+
})), command, ["id", "sessionId", "name", "startTime", "durationMs", "turnCount", "errorCount", "usage"]);
|
|
106
114
|
});
|
|
107
115
|
});
|
|
108
116
|
sessions.addCommand(sessionsList);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One line for what a session's model calls used (#1774): on a built-in model the share of the
|
|
3
|
+
* included usage, on your own key the estimate in euros, for spans you sent the cost your SDK
|
|
4
|
+
* recorded. Never a cost for a built-in model.
|
|
5
|
+
*/
|
|
6
|
+
type Usage = {
|
|
7
|
+
platform?: {
|
|
8
|
+
poolSharePercent?: string | null;
|
|
9
|
+
} | null;
|
|
10
|
+
byok?: {
|
|
11
|
+
estimatedCostEur?: string | null;
|
|
12
|
+
} | null;
|
|
13
|
+
} | null;
|
|
14
|
+
/**
|
|
15
|
+
* `0.4% of included usage`, `<0.1% of included usage` below 0.1, `0% of included usage` for a call
|
|
16
|
+
* that took nothing from it (paid from extra usage), `—` before the call is settled. Twin of
|
|
17
|
+
* `poolShare` in mcp/src/tools/tracing.ts (separate packages): change both.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatPoolShare(percent: string | null | undefined): string;
|
|
20
|
+
export declare function usageLabel(usage: Usage | undefined, costUsd: number | null | undefined): string;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=call-usage.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `0.4% of included usage`, `<0.1% of included usage` below 0.1, `0% of included usage` for a call
|
|
3
|
+
* that took nothing from it (paid from extra usage), `—` before the call is settled. Twin of
|
|
4
|
+
* `poolShare` in mcp/src/tools/tracing.ts (separate packages): change both.
|
|
5
|
+
*/
|
|
6
|
+
export function formatPoolShare(percent) {
|
|
7
|
+
if (percent == null)
|
|
8
|
+
return "—";
|
|
9
|
+
if (Number(percent) === 0)
|
|
10
|
+
return "0% of included usage";
|
|
11
|
+
if (Number(percent) < 0.1)
|
|
12
|
+
return "<0.1% of included usage";
|
|
13
|
+
// one place, rounded down, on the decimal string: no float can round 0.30 to 0.2
|
|
14
|
+
const [whole, fraction = ""] = percent.split(".");
|
|
15
|
+
const tenth = fraction[0] && fraction[0] !== "0" ? `.${fraction[0]}` : "";
|
|
16
|
+
return `${whole}${tenth}% of included usage`;
|
|
17
|
+
}
|
|
18
|
+
export function usageLabel(usage, costUsd) {
|
|
19
|
+
const parts = [];
|
|
20
|
+
if (usage?.platform)
|
|
21
|
+
parts.push(formatPoolShare(usage.platform.poolSharePercent));
|
|
22
|
+
if (usage?.byok)
|
|
23
|
+
parts.push(usage.byok.estimatedCostEur == null ? "~€—" : `~€${usage.byok.estimatedCostEur}`);
|
|
24
|
+
if (costUsd != null)
|
|
25
|
+
parts.push(`$${costUsd}`);
|
|
26
|
+
return parts.length ? parts.join(" · ") : "-";
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=call-usage.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.1",
|
|
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",
|