@vatio-ai/cli 0.105.0 → 0.107.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 CHANGED
@@ -17,8 +17,8 @@ npx @vatio-ai/skills
17
17
 
18
18
  Then, in Claude Code, run `/vatio-init` (in Cursor or Codex, ask it to use
19
19
  vatio-init). It reads your app, asks only what the code can't answer, and
20
- pushes a preview for you to try. Then `/vatio-add-to-app` puts the agent in
21
- your web, iOS, Android or Flutter app. See the [docs](https://vatio.ai/docs/).
20
+ pushes a preview for you to try. Then ask your coding agent to put the agent
21
+ in your web, iOS, Android or Flutter app. See the [docs](https://vatio.ai/docs/).
22
22
 
23
23
  ## By hand
24
24
 
@@ -34,10 +34,6 @@ export class ApiClient extends HttpClient {
34
34
  return this.get("/test_phones");
35
35
  }
36
36
 
37
- updateWhatsapp(body) {
38
- return this.patch("/whatsapp", body);
39
- }
40
-
41
37
  // "Your numbers", which need no number connected.
42
38
  ownerNumbers() {
43
39
  return this.get("/whatsapp/owner_numbers");
@@ -207,7 +203,7 @@ export class ApiClient extends HttpClient {
207
203
  // --- business -------------------------------------------------------
208
204
 
209
205
  // Name and brand: one row for every environment, the same one the inbox
210
- // edits under Channels → Web widget.
206
+ // edits on the Web chat page.
211
207
  business() {
212
208
  return this.get("/business");
213
209
  }
@@ -1,5 +1,5 @@
1
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.
2
+ // color, about), the same row the inbox edits on the Web chat page.
3
3
  // Not part of vatio.yml: one value for every environment, live on save.
4
4
  //
5
5
  // It also held a description of the business, which moved into the agent's
@@ -6,16 +6,19 @@
6
6
  // vatio.ai/workspaces is only for a server too old to send the link, and
7
7
  // redirects to the inbox.
8
8
  //
9
- // Two things about WhatsApp are set here too: who the agent answers on your
10
- // own number (`vatio whatsapp only` / `everyone`; everyone else's messages
11
- // still reach the inbox), and your numbers (`vatio whatsapp mine`), the
12
- // business's own conversations, which need no number connected.
9
+ // One thing about WhatsApp is set here too: your numbers (`vatio whatsapp
10
+ // mine`), the business's own conversations, which need no number connected.
13
11
 
14
12
  import { deployClient } from "./deploy.mjs";
15
13
  import { fail, paint, takeFlag } from "../support.mjs";
16
14
 
17
15
  const WHATSAPP_USAGE =
18
- "Usage: vatio whatsapp [test-phones [--json] | only NUMBER [NUMBER]... | everyone | mine [NUMBER... | --clear]]";
16
+ "Usage: vatio whatsapp [test-phones [--json] | mine [NUMBER... | --clear]]";
17
+ // The list of who the agent answered on your own number is gone: it answers
18
+ // everyone, and Live off in the inbox is how it answers nobody.
19
+ const AGENT_NUMBERS_REMOVED =
20
+ "`vatio whatsapp only` and `everyone` were removed: the agent answers everyone who writes to your number. " +
21
+ "To have it answer nobody, turn Live off in the inbox, on the WhatsApp page.";
19
22
 
20
23
  export async function whatsapp(config, args = []) {
21
24
  const sub = args.shift();
@@ -25,7 +28,7 @@ export async function whatsapp(config, args = []) {
25
28
  await printTestPhones(config).catch((error) => {
26
29
  if (error?.status !== 404 && error?.body?.error?.code !== "not_found") throw error;
27
30
  });
28
- await printAgentNumbers(config);
31
+ await printNumber(config);
29
32
  // A server that predates the route answers 404; nothing more to show.
30
33
  return printOwnerNumbers(config).catch((error) => {
31
34
  if (error?.status !== 404 && error?.body?.error?.code !== "not_found") throw error;
@@ -36,14 +39,7 @@ export async function whatsapp(config, args = []) {
36
39
  if (args.length > 0) fail(WHATSAPP_USAGE);
37
40
  return printTestPhones(config, { json });
38
41
  }
39
- if (sub === "only") {
40
- if (args.length === 0) fail(WHATSAPP_USAGE);
41
- return setAgentNumbers(config, args.splice(0));
42
- }
43
- if (sub === "everyone") {
44
- if (args.length > 0) fail(WHATSAPP_USAGE);
45
- return setAgentNumbers(config, []);
46
- }
42
+ if (sub === "only" || sub === "everyone") fail(AGENT_NUMBERS_REMOVED);
47
43
  if (sub === "mine") {
48
44
  const clear = takeFlag(args, "--clear");
49
45
  if (clear && args.length > 0) fail(WHATSAPP_USAGE);
@@ -83,17 +79,12 @@ async function printTestPhones(config, { json = false } = {}) {
83
79
  for (const phone of data) console.log(` ${phone.phone_number}`);
84
80
  }
85
81
 
86
- async function setAgentNumbers(config, numbers) {
87
- const client = deployClient(config, config.resolveWorkspaceRequired());
88
- printAnswers(await client.updateWhatsapp({ agent_numbers: numbers }));
89
- }
90
-
91
82
  // After the inbox link: a workspace with no number of its own has nothing
92
83
  // more to show, and the link already says what to do.
93
- async function printAgentNumbers(config) {
84
+ async function printNumber(config) {
94
85
  const client = deployClient(config, config.resolveWorkspaceRequired());
95
86
  try {
96
- printAnswers(await client.getWhatsapp());
87
+ printLive(await client.getWhatsapp());
97
88
  } catch (error) {
98
89
  if (error?.body?.error?.code === "whatsapp_not_connected") return;
99
90
  throw error;
@@ -124,15 +115,9 @@ function printOwners(body) {
124
115
  console.log(" Change them: vatio whatsapp mine NUMBER... Empty the list: vatio whatsapp mine --clear");
125
116
  }
126
117
 
127
- function printAnswers(number) {
128
- const list = Array.isArray(number.agent_numbers) ? number.agent_numbers : [];
129
- const live = number.live ? paint("green", "live") : paint("cyan", "paused: Live is off in the inbox, under Channels → WhatsApp");
118
+ function printLive(number) {
119
+ const live = number.live
120
+ ? paint("green", "live: the agent answers everyone who writes")
121
+ : paint("cyan", "paused: Live is off in the inbox, on the WhatsApp page");
130
122
  console.log(`\n${number.display_phone_number ?? "Your number"}: ${live}`);
131
- if (list.length === 0) {
132
- console.log(" The agent answers everyone. To answer only some numbers: vatio whatsapp only +56912345678");
133
- return;
134
- }
135
- console.log(` The agent answers only: ${list.join(", ")}`);
136
- console.log(" Everyone else's messages reach the inbox unanswered.");
137
- console.log(" Back to everyone: vatio whatsapp everyone");
138
123
  }
@@ -23,6 +23,9 @@ const RETIRED = {
23
23
  destroy: "`vatio chat destroy` was removed.",
24
24
  delete: "`vatio chat delete` was removed."
25
25
  };
26
+ // Words a coding agent reaches for as subcommands. Alone, they are never what
27
+ // someone meant to say to their agent, and sending them starts a chat.
28
+ const NOT_SUBCOMMANDS = new Set(["list", "ls", "search", "find", "get", "read", "view", "open", "history", "status", "new", "start"]);
26
29
  const REMOVED_FLAGS = ["--channel", "--from", "--as", "--sandbox-url"];
27
30
 
28
31
  export async function chat(config, args) {
@@ -51,6 +54,13 @@ export async function chat(config, args) {
51
54
 
52
55
  const options = { environment, timeout, last, lastGiven: lastValue != null, json, apiUrl, token };
53
56
  if (args.length === 1 && RETIRED[args[0]]) fail(RETIRED[args[0]]);
57
+ if (args.length === 1 && NOT_SUBCOMMANDS.has(args[0].toLowerCase())) {
58
+ fail(
59
+ `\`vatio chat ${args[0]}\` is not a command, and nothing was sent. ` +
60
+ "`vatio chat show [CHAT_ID]` reads a conversation; `vatio chat export --from DATE` lists them with their ids. " +
61
+ "To say it to the agent, write a whole sentence."
62
+ );
63
+ }
54
64
  const sub = SUBCOMMANDS.has(args[0]) ? args.shift() : null;
55
65
 
56
66
  if (sub === "help") return console.log(chatHelp());
@@ -157,7 +157,7 @@ export async function init(config, args) {
157
157
  if (agentsNote) console.log(agentsNote);
158
158
  if (!authorized) console.log(`Local only for now — \`vatio push\` is what creates ${slug} on the platform.`);
159
159
  if (!authorized && String(name ?? "").trim() !== "") {
160
- console.log("Set the display name once it exists: `vatio business set --name NAME`, or in the inbox under Channels → Web widget.");
160
+ console.log("Set the display name once it exists: `vatio business set --name NAME`, or in the inbox on the Web chat page.");
161
161
  }
162
162
  console.log("");
163
163
  console.log("Next:");
@@ -204,7 +204,7 @@ function writeAgentsNote(target) {
204
204
  // The smallest file that deploys: which workspace, and what the agent does.
205
205
  // The slug is already validated as a slug, so it needs no quoting. The display
206
206
  // name is not here: it is the business name, set with `vatio business set --name`
207
- // or in the inbox under Channels → Web widget.
207
+ // or in the inbox on the Web chat page.
208
208
  function starterManifest(slug) {
209
209
  const lines = ["# Which Vatio workspace this directory deploys to.", `workspace: ${slug}`, ""];
210
210
  lines.push("agent:");
package/lib/help.mjs CHANGED
@@ -130,7 +130,7 @@ the two you are in. Commands default as listed.
130
130
  (entry commands take --env; --env live writes live)
131
131
 
132
132
  Business (one value for every environment, live on save; also in the inbox,
133
- under Channels → Web widget):
133
+ on the Web chat page):
134
134
  business [show] Name and brand, and the old business description
135
135
  if there is one
136
136
  business set [--name NAME] [--about TEXT] [--color #RRGGBB|default]
@@ -203,9 +203,6 @@ the two you are in. Commands default as listed.
203
203
  whatsapp test-phones [--json]
204
204
  The phones verified in Try the agent, to send a
205
205
  preview message to
206
- whatsapp only NUMBER...|everyone
207
- Who the agent answers on your own number; the
208
- rest still reach the inbox
209
206
  whatsapp mine [NUMBER...|--clear]
210
207
  Your numbers: the business's own conversations,
211
208
  the only ones with access: owner tools. Needs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vatio-ai/cli",
3
- "version": "0.105.0",
3
+ "version": "0.107.0",
4
4
  "description": "Vatio CLI — deploy and manage Vatio agent workspaces",
5
5
  "keywords": [
6
6
  "vatio",