@vatio-ai/cli 0.78.0 → 0.79.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/README.md +1 -1
- package/bin/vatio.mjs +2 -2
- package/lib/api-client.mjs +1 -1
- package/lib/commands/channels.mjs +14 -12
- package/lib/commands/chat.mjs +1 -1
- package/lib/commands/deploy.mjs +3 -2
- package/lib/commands/env.mjs +2 -2
- package/lib/commands/improve.mjs +2 -2
- package/lib/commands/misc.mjs +3 -2
- package/lib/commands/supabase-auth.mjs +2 -2
- package/lib/device-auth.mjs +1 -1
- package/lib/help.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ tokens list|create|origins|revoke Publishable tokens and the origins each accep
|
|
|
76
76
|
auth --new-key Keypair that signs the visitor's JWT
|
|
77
77
|
auth --supabase [URL] Your users sign in with Supabase: no keys, no code
|
|
78
78
|
|
|
79
|
-
whatsapp | instagram Set up in the
|
|
79
|
+
whatsapp | instagram Set up in the inbox; prints the link
|
|
80
80
|
|
|
81
81
|
docs [--save [PATH]] The whole developer contract
|
|
82
82
|
config show|set|unset base_url and token, per developer
|
package/bin/vatio.mjs
CHANGED
|
@@ -33,8 +33,8 @@ const RETIRED = {
|
|
|
33
33
|
"or read the manifest at GET /api/developer/v1/:slug/manifest.",
|
|
34
34
|
issue: "was removed: report a problem on the public repository it belongs to --\n" +
|
|
35
35
|
"https://github.com/vatio-ai/cli/issues (or sdk, ios, ruby under github.com/vatio-ai).",
|
|
36
|
-
widget: "was removed: `vatio env` prints the snippet and its token, and the look is edited
|
|
37
|
-
"the
|
|
36
|
+
widget: "was removed: `vatio env` prints the snippet and its token, and the look is edited in\n" +
|
|
37
|
+
"the inbox, under Channels → Widget.",
|
|
38
38
|
mcp: "was removed. Point your coding agent at `vatio docs --save` and let it run the CLI.",
|
|
39
39
|
update: "is npm's job now: `npx @vatio-ai/cli@latest` always runs the current release, and\n" +
|
|
40
40
|
"`npm install -g @vatio-ai/cli@latest` updates a global install.",
|
package/lib/api-client.mjs
CHANGED
|
@@ -73,7 +73,7 @@ export class ApiClient extends HttpClient {
|
|
|
73
73
|
return this.get(`/env/${encode(name)}`);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// The project "Connect Supabase" picked in the
|
|
76
|
+
// The project "Connect Supabase" picked in the inbox (Channels), if any.
|
|
77
77
|
supabase() {
|
|
78
78
|
return this.get("/supabase");
|
|
79
79
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// whatsapp / instagram -- both are set up in the
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// whatsapp / instagram -- both are set up in the inbox: connecting your own
|
|
2
|
+
// number or account needs Meta's consent screen, and test phones and accounts
|
|
3
|
+
// are a form with a code. The CLI only says where, and that depends on whether
|
|
4
|
+
// the workspace has published: before, the Test page, where test phones and
|
|
5
|
+
// accounts are verified; after, the channel's own page under Channels.
|
|
6
|
+
// vatio.ai/workspaces is only for a server too old to send the link, and
|
|
7
|
+
// redirects to the inbox.
|
|
6
8
|
//
|
|
7
9
|
// One thing about your own WhatsApp number is set here too: who the agent
|
|
8
10
|
// answers on it (`vatio whatsapp only` / `everyone`). Everyone else's messages
|
|
@@ -16,7 +18,7 @@ const WHATSAPP_USAGE = "Usage: vatio whatsapp [only NUMBER [NUMBER]... | everyon
|
|
|
16
18
|
export async function whatsapp(config, args = []) {
|
|
17
19
|
const sub = args.shift();
|
|
18
20
|
if (sub === undefined) {
|
|
19
|
-
await
|
|
21
|
+
await inInbox(config, { name: "WhatsApp", key: "whatsapp", own: "number", test: "phone" });
|
|
20
22
|
return printAgentNumbers(config);
|
|
21
23
|
}
|
|
22
24
|
if (sub === "only") {
|
|
@@ -31,18 +33,18 @@ export async function whatsapp(config, args = []) {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export const instagram = (config) =>
|
|
34
|
-
|
|
36
|
+
inInbox(config, { name: "Instagram", key: "instagram", own: "account", test: "account" });
|
|
35
37
|
|
|
36
|
-
async function
|
|
38
|
+
async function inInbox(config, channel) {
|
|
37
39
|
const status = await deployClient(config, config.resolveWorkspaceRequired()).deployStatus();
|
|
38
40
|
const url = status[`${channel.key}_url`] ?? status.integrations_url ?? `${config.resolveBaseUrl()}/workspaces`;
|
|
39
41
|
// An older server sends no `published`; a live deployment means the same.
|
|
40
42
|
const published = status.published ?? Boolean(status.live);
|
|
41
43
|
|
|
42
44
|
if (published) {
|
|
43
|
-
console.log(`Connect your own ${channel.own} and manage test ${channel.test}s in the
|
|
45
|
+
console.log(`Connect your own ${channel.own} and manage test ${channel.test}s in the inbox, under Channels:`);
|
|
44
46
|
} else {
|
|
45
|
-
console.log(`Test ${channel.name} on the
|
|
47
|
+
console.log(`Test ${channel.name} on the inbox's Test page: verify your ${channel.test} there and talk to your agent.`);
|
|
46
48
|
}
|
|
47
49
|
console.log(` ${url}`);
|
|
48
50
|
}
|
|
@@ -52,7 +54,7 @@ async function setAgentNumbers(config, numbers) {
|
|
|
52
54
|
printAnswers(await client.updateWhatsapp({ agent_numbers: numbers }));
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
// After the
|
|
57
|
+
// After the inbox link: a workspace with no number of its own has nothing
|
|
56
58
|
// more to show, and the link already says what to do.
|
|
57
59
|
async function printAgentNumbers(config) {
|
|
58
60
|
const client = deployClient(config, config.resolveWorkspaceRequired());
|
|
@@ -66,7 +68,7 @@ async function printAgentNumbers(config) {
|
|
|
66
68
|
|
|
67
69
|
function printAnswers(number) {
|
|
68
70
|
const list = Array.isArray(number.agent_numbers) ? number.agent_numbers : [];
|
|
69
|
-
const live = number.live ? paint("green", "live") : paint("cyan", "paused: Live is off in the
|
|
71
|
+
const live = number.live ? paint("green", "live") : paint("cyan", "paused: Live is off in the inbox, under Channels → WhatsApp");
|
|
70
72
|
console.log(`\n${number.display_phone_number ?? "Your number"}: ${live}`);
|
|
71
73
|
if (list.length === 0) {
|
|
72
74
|
console.log(" The agent answers everyone. To answer only some numbers: vatio whatsapp only +56912345678");
|
package/lib/commands/chat.mjs
CHANGED
|
@@ -30,7 +30,7 @@ export async function chat(config, args) {
|
|
|
30
30
|
if (REMOVED_FLAGS.some((flag) => arg === flag || arg.startsWith(`${flag}=`))) {
|
|
31
31
|
fail(
|
|
32
32
|
`\`${arg}\` was removed. A CLI chat is you, the developer holding the token. ` +
|
|
33
|
-
"To test a real channel add a test phone or Instagram account
|
|
33
|
+
"To test a real channel add a test phone or Instagram account on the inbox's Test page; " +
|
|
34
34
|
"to pick a deployment use --env."
|
|
35
35
|
);
|
|
36
36
|
}
|
package/lib/commands/deploy.mjs
CHANGED
|
@@ -95,7 +95,8 @@ export async function push(config, args) {
|
|
|
95
95
|
|
|
96
96
|
// The remote has to exist before the workspace can be checked: the slug is in
|
|
97
97
|
// the URL of the call that checks it. It is created unnamed; the display name
|
|
98
|
-
// is
|
|
98
|
+
// is the business name (`vatio business set --name`, or the inbox's Business
|
|
99
|
+
// page), not part of a push.
|
|
99
100
|
const clients = workspacesClient(config);
|
|
100
101
|
const created = !(await clients.workspaceExists(workspace));
|
|
101
102
|
if (created) {
|
|
@@ -119,7 +120,7 @@ export async function push(config, args) {
|
|
|
119
120
|
|
|
120
121
|
const landedOn = payload.environment ?? "preview";
|
|
121
122
|
console.log(`Pushed deployment #${payload.deployment_id} to ${landedOn} (git_sha=${JSON.stringify(payload.git_sha ?? null)})`);
|
|
122
|
-
// Where to try it: the
|
|
123
|
+
// Where to try it: the inbox's Test page for that environment.
|
|
123
124
|
if (payload.share_url) console.log(`Try it: ${payload.share_url}`);
|
|
124
125
|
for (const warning of asArray(payload.warnings)) console.log(` warning: ${warning}`);
|
|
125
126
|
if (payload.preview_url) console.log(`Preview: ${payload.preview_url}`);
|
package/lib/commands/env.mjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// There are two: preview, the next version, which `vatio push` updates and
|
|
4
4
|
// where its knowledge changes and secret values sit on top of live; and live,
|
|
5
5
|
// what visitors talk to. This hands over what an app needs to talk to one --
|
|
6
|
-
// the publishable token and the widget snippet -- and the link to try it
|
|
7
|
-
// the
|
|
6
|
+
// the publishable token and the widget snippet -- and the link to try it on
|
|
7
|
+
// the inbox's Test page.
|
|
8
8
|
|
|
9
9
|
import { deployClient } from "./deploy.mjs";
|
|
10
10
|
import { fail, takeEnv } from "../support.mjs";
|
package/lib/commands/improve.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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 eval` is the
|
|
6
6
|
// evidence that the fix worked on preview before `vatio publish` takes it
|
|
7
|
-
// live, and `vatio tools` is the
|
|
7
|
+
// live, and `vatio tools` is the inbox's Tools page for the failures nobody
|
|
8
8
|
// reported.
|
|
9
9
|
|
|
10
10
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
@@ -69,7 +69,7 @@ export async function flags(config, args) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// Each tool's calls, error rate, timeouts and p50/p95 latency over a period,
|
|
72
|
-
// then the calls that failed with what your backend answered: the
|
|
72
|
+
// then the calls that failed with what your backend answered: the inbox's
|
|
73
73
|
// Tools page.
|
|
74
74
|
export async function tools(config, args) {
|
|
75
75
|
const environment = takeEnv(args, { fallback: "live" });
|
package/lib/commands/misc.mjs
CHANGED
|
@@ -116,7 +116,7 @@ export async function init(config, args) {
|
|
|
116
116
|
if (agentsNote) console.log(agentsNote);
|
|
117
117
|
if (!authorized) console.log(`Local only for now — \`vatio push\` is what creates ${slug} on the platform.`);
|
|
118
118
|
if (!authorized && String(name ?? "").trim() !== "") {
|
|
119
|
-
console.log("
|
|
119
|
+
console.log("Set the display name once it exists: `vatio business set --name NAME`, or the inbox's Business page.");
|
|
120
120
|
}
|
|
121
121
|
console.log("");
|
|
122
122
|
console.log("Next:");
|
|
@@ -162,7 +162,8 @@ function writeAgentsNote(target) {
|
|
|
162
162
|
|
|
163
163
|
// The smallest file that deploys: which workspace, and what the agent does.
|
|
164
164
|
// The slug is already validated as a slug, so it needs no quoting. The display
|
|
165
|
-
// name is not here: it is
|
|
165
|
+
// name is not here: it is the business name, set with `vatio business set --name`
|
|
166
|
+
// or on the inbox's Business page.
|
|
166
167
|
function starterManifest(slug) {
|
|
167
168
|
const lines = ["# Which Vatio workspace this directory deploys to.", `workspace: ${slug}`, ""];
|
|
168
169
|
lines.push("agent:");
|
|
@@ -40,7 +40,7 @@ export async function supabaseAuth(config, args) {
|
|
|
40
40
|
|
|
41
41
|
if (signInUrl && !/^https:\/\/[^/\s?#]+/.test(signInUrl)) fail("--sign-in-url must be an https url on your own site");
|
|
42
42
|
|
|
43
|
-
//
|
|
43
|
+
// "Connect Supabase" in the inbox (Channels) is the one explicit answer short of a URL
|
|
44
44
|
// on the command line; a .env is a guess about which project the app uses.
|
|
45
45
|
const connected = given ? null : await connectedProject(config, workspace);
|
|
46
46
|
const found = connected ? {} : detect([process.cwd(), root]);
|
|
@@ -49,7 +49,7 @@ export async function supabaseAuth(config, args) {
|
|
|
49
49
|
fail(
|
|
50
50
|
"Could not find your Supabase project URL in a .env or src/integrations/supabase/client.ts.\n" +
|
|
51
51
|
"Pass it: vatio auth --supabase https://<project-ref>.supabase.co\n" +
|
|
52
|
-
"or connect Supabase in the
|
|
52
|
+
"or connect Supabase in the inbox, under Channels → Supabase."
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
if (!PROJECT_URL.test(url)) {
|
package/lib/device-auth.mjs
CHANGED
|
@@ -18,7 +18,7 @@ export class DeviceAuthClient {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// A `workspace` lets the page the developer signs in on wait for that push
|
|
21
|
-
// and land on its
|
|
21
|
+
// and land on its Test page in the inbox.
|
|
22
22
|
start({ workspace } = {}) {
|
|
23
23
|
const body = {};
|
|
24
24
|
if (workspace) body.workspace = workspace;
|
package/lib/help.mjs
CHANGED
|
@@ -65,7 +65,7 @@ Commands default as listed.
|
|
|
65
65
|
Every open report: the conversation, what each tool
|
|
66
66
|
answered, and what should have happened
|
|
67
67
|
tools [--env NAME] [--period 1h|1d|7d|30d] [--json]
|
|
68
|
-
The
|
|
68
|
+
The inbox's Tools page: each tool's calls, error
|
|
69
69
|
rate, timeouts and p50/p95, then the calls that
|
|
70
70
|
failed with what your backend answered. Default:
|
|
71
71
|
live, 7d
|
|
@@ -134,8 +134,8 @@ Commands default as listed.
|
|
|
134
134
|
conversations with these numbers
|
|
135
135
|
|
|
136
136
|
Channels:
|
|
137
|
-
whatsapp Set up in the
|
|
138
|
-
until you publish, then
|
|
137
|
+
whatsapp Set up in the inbox; prints the link (Test page
|
|
138
|
+
until you publish, then Channels)
|
|
139
139
|
whatsapp only NUMBER...|everyone
|
|
140
140
|
Who the agent answers on your own number; the
|
|
141
141
|
rest still reach the inbox
|