@2kw/ai 6.3.0-dev.66 → 6.3.0-dev.70
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.
|
@@ -5,7 +5,8 @@ import { Command } from "commander";
|
|
|
5
5
|
*
|
|
6
6
|
* Answers the question an operator otherwise has to answer by running the agent
|
|
7
7
|
* and reading the transcript. The version defaults to the agent's latest, which
|
|
8
|
-
* is the one an unlabelled reference resolves to.
|
|
8
|
+
* is the one an unlabelled reference resolves to. `--mode` answers for a conversation in that
|
|
9
|
+
* mode (#1037); a contributing mode shows in the matched rules as `conversation_mode.<mode>`.
|
|
9
10
|
*/
|
|
10
11
|
export declare function makeAgentPolicyCommand(): Command;
|
|
11
12
|
//# sourceMappingURL=agent-policy.d.ts.map
|
|
@@ -4,6 +4,7 @@ import { getClient, runAction } from "../lib/client.js";
|
|
|
4
4
|
import { isJsonOutput } from "../lib/config.js";
|
|
5
5
|
import { formatDetail, formatList } from "../lib/output.js";
|
|
6
6
|
import { resolveAgent } from "../lib/agent-lookup.js";
|
|
7
|
+
import { parseModeOption } from "../lib/agent-run.js";
|
|
7
8
|
import { CliUsageError } from "../lib/errors.js";
|
|
8
9
|
import { getLatestVersion } from "./agent-apply.js";
|
|
9
10
|
/**
|
|
@@ -12,7 +13,8 @@ import { getLatestVersion } from "./agent-apply.js";
|
|
|
12
13
|
*
|
|
13
14
|
* Answers the question an operator otherwise has to answer by running the agent
|
|
14
15
|
* and reading the transcript. The version defaults to the agent's latest, which
|
|
15
|
-
* is the one an unlabelled reference resolves to.
|
|
16
|
+
* is the one an unlabelled reference resolves to. `--mode` answers for a conversation in that
|
|
17
|
+
* mode (#1037); a contributing mode shows in the matched rules as `conversation_mode.<mode>`.
|
|
16
18
|
*/
|
|
17
19
|
export function makeAgentPolicyCommand() {
|
|
18
20
|
return new Command("policy")
|
|
@@ -21,8 +23,11 @@ export function makeAgentPolicyCommand() {
|
|
|
21
23
|
.option("--version <id>", "Agent version ID (default: the agent's latest version)")
|
|
22
24
|
.option("--tool <name>", "Answer for one tool instead of every configured tool")
|
|
23
25
|
.option("--installation <id>", "Resolve the module tool catalog of this installation")
|
|
26
|
+
.option("--mode <mode>", "Answer as a conversation in this mode would be gated: plan (every call that is not read-only is refused), " +
|
|
27
|
+
"ask (a person decides where the policy would ask the judge), auto (the policy as written)")
|
|
24
28
|
.action(async (agentRef, opts, command) => {
|
|
25
29
|
await runAction(command, async () => {
|
|
30
|
+
const mode = parseModeOption(opts.mode);
|
|
26
31
|
const client = getClient(command);
|
|
27
32
|
const agent = await resolveAgent(client, agentRef);
|
|
28
33
|
const agentId = agent.id;
|
|
@@ -33,7 +38,7 @@ export function makeAgentPolicyCommand() {
|
|
|
33
38
|
const { data } = await client.GET("/v1/agents/{agentId}/versions/{versionId}/policy", {
|
|
34
39
|
params: {
|
|
35
40
|
path: { agentId, versionId },
|
|
36
|
-
query: { tool: opts.tool, installation: opts.installation },
|
|
41
|
+
query: { tool: opts.tool, installation: opts.installation, mode },
|
|
37
42
|
},
|
|
38
43
|
});
|
|
39
44
|
if (isJsonOutput(command)) {
|
|
@@ -47,6 +52,8 @@ export function makeAgentPolicyCommand() {
|
|
|
47
52
|
`auto-approval ${auto?.enabled ? "on" : "off (every auto pauses for a human)"}`,
|
|
48
53
|
`judge ${auto?.judgeConfigured ? "configured" : "not configured (every candidate escalates)"}`,
|
|
49
54
|
];
|
|
55
|
+
if (mode)
|
|
56
|
+
parts.push(`mode ${mode}`);
|
|
50
57
|
if (data?.catalogResolvedAt)
|
|
51
58
|
parts.push(`catalog resolved ${data.catalogResolvedAt}`);
|
|
52
59
|
console.log(chalk.dim(parts.join(", ")));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2kw/ai",
|
|
3
|
-
"version": "6.3.0-dev.
|
|
3
|
+
"version": "6.3.0-dev.70",
|
|
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",
|