@vatio-ai/cli 0.92.0 → 0.93.0
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/lib/api-client.mjs +2 -2
- package/lib/commands/business.mjs +23 -15
- package/lib/commands/deploy.mjs +2 -2
- package/lib/commands/improve.mjs +21 -11
- package/lib/commands/misc.mjs +2 -2
- package/lib/help.mjs +16 -13
- package/package.json +1 -1
package/lib/api-client.mjs
CHANGED
|
@@ -189,8 +189,8 @@ export class ApiClient extends HttpClient {
|
|
|
189
189
|
|
|
190
190
|
// --- business -------------------------------------------------------
|
|
191
191
|
|
|
192
|
-
// Name
|
|
193
|
-
//
|
|
192
|
+
// Name and brand: one row for every environment, the same one the inbox
|
|
193
|
+
// edits under Channels → Web widget.
|
|
194
194
|
business() {
|
|
195
195
|
return this.get("/business");
|
|
196
196
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// business — the business the agent works for: name
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// business — the business the agent works for: its name and brand (logo,
|
|
2
|
+
// color, about), the same row the inbox edits under Channels → Web widget.
|
|
3
|
+
// Not part of vatio.yml: one value for every environment, live on save.
|
|
4
|
+
//
|
|
5
|
+
// It also held a description of the business, which moved into the agent's
|
|
6
|
+
// instructions: one written before is shown here, and --clear-description
|
|
7
|
+
// removes it once the instructions say it.
|
|
6
8
|
|
|
7
9
|
import { readFileSync, statSync } from "node:fs";
|
|
8
10
|
import { basename, extname } from "node:path";
|
|
@@ -16,9 +18,12 @@ const LOGO_MAX_BYTES = 2 * 1024 * 1024;
|
|
|
16
18
|
|
|
17
19
|
const USAGE =
|
|
18
20
|
"Usage: vatio business [show]\n" +
|
|
19
|
-
" vatio business set [--name NAME] [--
|
|
20
|
-
" [--
|
|
21
|
-
|
|
21
|
+
" vatio business set [--name NAME] [--about TEXT] [--color #RRGGBB | --color default]\n" +
|
|
22
|
+
" [--logo FILE | --remove-logo] [--clear-description]";
|
|
23
|
+
|
|
24
|
+
const DESCRIPTION_MOVED =
|
|
25
|
+
"The business description moved into the agent's instructions: write what the business does in " +
|
|
26
|
+
"`agent.instructions` in vatio.yml, where it is tested and published like the rest.";
|
|
22
27
|
|
|
23
28
|
export async function business(config, args) {
|
|
24
29
|
const workspace = config.resolveWorkspaceRequired();
|
|
@@ -31,13 +36,10 @@ export async function business(config, args) {
|
|
|
31
36
|
}
|
|
32
37
|
if (sub === "set") {
|
|
33
38
|
const fields = {};
|
|
39
|
+
if (args.includes("--description") || args.includes("--description-file")) fail(DESCRIPTION_MOVED);
|
|
34
40
|
const name = takeValue(args, "--name");
|
|
35
|
-
const description = takeValue(args, "--description");
|
|
36
|
-
const file = takeValue(args, "--description-file");
|
|
37
|
-
if (description !== null && file !== null) fail("Give --description or --description-file, not both");
|
|
38
41
|
if (name !== null) fields.name = name;
|
|
39
|
-
if (description
|
|
40
|
-
if (file !== null) fields.summary = readFileSync(file === "-" ? 0 : file, "utf8");
|
|
42
|
+
if (takeFlag(args, "--clear-description")) fields.summary = "";
|
|
41
43
|
|
|
42
44
|
const about = takeValue(args, "--about");
|
|
43
45
|
if (about !== null) fields.about = about;
|
|
@@ -90,8 +92,14 @@ function rejectLeftovers(args) {
|
|
|
90
92
|
function print(payload, workspace) {
|
|
91
93
|
console.log(`${payload.name} (workspace ${workspace})`);
|
|
92
94
|
console.log("");
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
if (payload.summary) {
|
|
96
|
+
console.log("Business description (Vatio still adds it to every prompt):");
|
|
97
|
+
console.log(indent(payload.summary));
|
|
98
|
+
console.log(
|
|
99
|
+
` ${DESCRIPTION_MOVED} Once live runs that version, \`vatio business set --clear-description\` removes this one.`
|
|
100
|
+
);
|
|
101
|
+
console.log("");
|
|
102
|
+
}
|
|
95
103
|
|
|
96
104
|
console.log("Brand:");
|
|
97
105
|
console.log(` logo ${payload.logo_url ?? "none (vatio business set --logo FILE)"}`);
|
package/lib/commands/deploy.mjs
CHANGED
|
@@ -108,8 +108,8 @@ export async function push(config, args) {
|
|
|
108
108
|
|
|
109
109
|
// The remote has to exist before the workspace can be checked: the slug is in
|
|
110
110
|
// the URL of the call that checks it. It is created unnamed; the display name
|
|
111
|
-
// is the business name (`vatio business set --name`, or the inbox's
|
|
112
|
-
//
|
|
111
|
+
// is the business name (`vatio business set --name`, or the inbox's Channels
|
|
112
|
+
// → Web widget), not part of a push.
|
|
113
113
|
const clients = workspacesClient(config);
|
|
114
114
|
const created = !(await clients.workspaceExists(workspace));
|
|
115
115
|
if (created) {
|
package/lib/commands/improve.mjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// All print markdown, because the reader is usually a coding agent: `vatio
|
|
5
5
|
// flags` is the document it fixes the agent from, `vatio test` is the
|
|
6
6
|
// evidence that the fix worked on preview before `vatio publish` takes it
|
|
7
|
-
// live, and `vatio tools` is
|
|
8
|
-
// reported.
|
|
7
|
+
// live, and `vatio tools` is how each tool's backend has been answering, for
|
|
8
|
+
// the failures nobody reported.
|
|
9
9
|
|
|
10
10
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { dirname, resolve } from "node:path";
|
|
@@ -93,8 +93,10 @@ function replyTarget(config, args, usage) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// What the inbox's Reportar does, from the terminal: a reply that was wrong,
|
|
96
|
-
// and what it should have done.
|
|
97
|
-
//
|
|
96
|
+
// and what it should have done. On live the note makes it a report and a
|
|
97
|
+
// test case; on preview it is a note for the coding agent, closed by the
|
|
98
|
+
// next push. A reply that is already right is not a flag: `vatio test add`
|
|
99
|
+
// keeps it.
|
|
98
100
|
async function addFlag(config, args) {
|
|
99
101
|
if (args.includes("--passes")) {
|
|
100
102
|
fail('A reply that is already right is a test, not a report: `vatio test add "WHAT IT SHOULD DO"` keeps it.');
|
|
@@ -112,9 +114,17 @@ async function addFlag(config, args) {
|
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
const reply = String(flag.reply ?? "").trim().replace(/\s+/g, " ");
|
|
115
|
-
|
|
117
|
+
const note = flag.environment === "preview";
|
|
118
|
+
console.log(
|
|
119
|
+
`${flag.rewritten ? "Rewrote" : note ? "Noted" : "Reported"} ${flag.public_id}, chat ${flag.chat_id} on ${flag.environment}:`
|
|
120
|
+
);
|
|
116
121
|
console.log(` [agent #${flag.message_id}] ${reply.length > 200 ? `${reply.slice(0, 200)}…` : reply}`);
|
|
117
|
-
if (
|
|
122
|
+
if (note) {
|
|
123
|
+
console.log(
|
|
124
|
+
"A note on preview, not a test case: `vatio flags` lists it for your coding agent until your next `vatio push` closes it. " +
|
|
125
|
+
'Once the agent gets it right, `vatio test add "WHAT IT SHOULD DO"` keeps that reply as a test.'
|
|
126
|
+
);
|
|
127
|
+
} else if (flag.test_case) {
|
|
118
128
|
console.log("It is a test case now: `vatio test` replays it, `vatio flags` lists it, `vatio flags rm` removes it.");
|
|
119
129
|
} else {
|
|
120
130
|
console.log("No visitor message comes before that reply, so there is nothing to replay: it is not a test case.");
|
|
@@ -144,8 +154,7 @@ async function removeFlags(config, ids) {
|
|
|
144
154
|
}
|
|
145
155
|
|
|
146
156
|
// Each tool's calls, error rate, timeouts and p50/p95 latency over a period,
|
|
147
|
-
// then the calls that failed with what your backend answered
|
|
148
|
-
// Tools page.
|
|
157
|
+
// then the calls that failed with what your backend answered.
|
|
149
158
|
export async function tools(config, args) {
|
|
150
159
|
const environment = takeEnv(args, { fallback: "live" });
|
|
151
160
|
const period = takeValue(args, "--period");
|
|
@@ -176,9 +185,10 @@ export async function test(config, args) {
|
|
|
176
185
|
|
|
177
186
|
const TEST_ADD_USAGE = 'vatio test add "WHAT IT SHOULD DO" [--chat ID | --message ID] [--env NAME]';
|
|
178
187
|
|
|
179
|
-
// A reply
|
|
180
|
-
// turn, like a report's case, with no report for Vatio to
|
|
181
|
-
// set of `vatio chat --new` + `vatio test add` is a test
|
|
188
|
+
// A reply kept as a test of what it should do, right already or not yet: a
|
|
189
|
+
// photo of its turn, like a report's case, with no report for Vatio to
|
|
190
|
+
// triage or fix. A set of `vatio chat --new` + `vatio test add` is a test
|
|
191
|
+
// suite, and on preview the only way to make one: a flag there is a note.
|
|
182
192
|
async function addTest(config, args) {
|
|
183
193
|
const body = replyTarget(config, args, TEST_ADD_USAGE);
|
|
184
194
|
const { url, token } = workspaceBase(config);
|
package/lib/commands/misc.mjs
CHANGED
|
@@ -153,7 +153,7 @@ export async function init(config, args) {
|
|
|
153
153
|
if (agentsNote) console.log(agentsNote);
|
|
154
154
|
if (!authorized) console.log(`Local only for now — \`vatio push\` is what creates ${slug} on the platform.`);
|
|
155
155
|
if (!authorized && String(name ?? "").trim() !== "") {
|
|
156
|
-
console.log("Set the display name once it exists: `vatio business set --name NAME`, or the inbox
|
|
156
|
+
console.log("Set the display name once it exists: `vatio business set --name NAME`, or in the inbox under Channels → Web widget.");
|
|
157
157
|
}
|
|
158
158
|
console.log("");
|
|
159
159
|
console.log("Next:");
|
|
@@ -200,7 +200,7 @@ function writeAgentsNote(target) {
|
|
|
200
200
|
// The smallest file that deploys: which workspace, and what the agent does.
|
|
201
201
|
// The slug is already validated as a slug, so it needs no quoting. The display
|
|
202
202
|
// name is not here: it is the business name, set with `vatio business set --name`
|
|
203
|
-
// or
|
|
203
|
+
// or in the inbox under Channels → Web widget.
|
|
204
204
|
function starterManifest(slug) {
|
|
205
205
|
const lines = ["# Which Vatio workspace this directory deploys to.", `workspace: ${slug}`, ""];
|
|
206
206
|
lines.push("agent:");
|
package/lib/help.mjs
CHANGED
|
@@ -79,16 +79,17 @@ Commands default as listed.
|
|
|
79
79
|
Every open report: the conversation, what each tool
|
|
80
80
|
answered, and what should have happened
|
|
81
81
|
flags add "NOTE" [--chat ID|--message ID] [--env NAME]
|
|
82
|
-
|
|
82
|
+
Flag a reply and what should have happened:
|
|
83
83
|
the agent's last one in the chat \`vatio chat\`
|
|
84
|
-
is in (default: preview).
|
|
84
|
+
is in (default: preview). On live it is a report
|
|
85
|
+
and a test case; on preview, a note for your
|
|
86
|
+
coding agent that the next push closes
|
|
85
87
|
flags rm ID [ID...] Remove a report and its test case, open or
|
|
86
88
|
resolved, as the inbox's Remove does
|
|
87
89
|
tools [--env NAME] [--period 1h|1d|7d|30d] [--json]
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
live, 7d
|
|
90
|
+
Each tool's calls, error rate, timeouts and
|
|
91
|
+
p50/p95, then the calls that failed with what
|
|
92
|
+
your backend answered. Default: live, 7d
|
|
92
93
|
test [--env NAME] [--agent SLUG]
|
|
93
94
|
Test every report and test against preview
|
|
94
95
|
(default): starts the runs on Vatio's servers,
|
|
@@ -99,8 +100,8 @@ Commands default as listed.
|
|
|
99
100
|
test --show RUN_ID One run's report so far, with the replay chat of
|
|
100
101
|
each case that did not pass (vatio chat show ID)
|
|
101
102
|
test add "NOTE" [--chat ID|--message ID] [--env NAME]
|
|
102
|
-
Keep a reply
|
|
103
|
-
last one in the chat \`vatio chat\` is in
|
|
103
|
+
Keep a reply as a test of what it should do: the
|
|
104
|
+
agent's last one in the chat \`vatio chat\` is in
|
|
104
105
|
test list [--json] | test rm ID [ID...]
|
|
105
106
|
The tests \`test add\` made; reports are \`flags\`
|
|
106
107
|
eval Deprecated: \`vatio test --wait\` under its old name
|
|
@@ -119,11 +120,13 @@ Commands default as listed.
|
|
|
119
120
|
kb history BASE What reached live, newest first
|
|
120
121
|
(entry commands take --env; --env live writes live)
|
|
121
122
|
|
|
122
|
-
Business (one value for every environment, live on save; also
|
|
123
|
-
|
|
124
|
-
business [show] Name, description
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
Business (one value for every environment, live on save; also in the inbox,
|
|
124
|
+
under Channels → Web widget):
|
|
125
|
+
business [show] Name and brand, and the old business description
|
|
126
|
+
if there is one
|
|
127
|
+
business set [--name NAME] [--about TEXT] [--color #RRGGBB|default]
|
|
128
|
+
[--logo FILE | --remove-logo] [--clear-description]
|
|
129
|
+
What the business does goes in agent.instructions
|
|
127
130
|
|
|
128
131
|
Credentials:
|
|
129
132
|
secrets list|set KEY [VALUE]|rm KEY [--env NAME | --tests]
|