@vatio-ai/cli 0.112.0 → 0.113.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.
@@ -34,15 +34,6 @@ export class ApiClient extends HttpClient {
34
34
  return this.get("/test_phones");
35
35
  }
36
36
 
37
- // "Your numbers", which need no number connected.
38
- ownerNumbers() {
39
- return this.get("/whatsapp/owner_numbers");
40
- }
41
-
42
- updateOwnerNumbers(numbers) {
43
- return this.patch("/whatsapp/owner_numbers", { owner_numbers: numbers });
44
- }
45
-
46
37
  deployedManifest({ environment = "live" } = {}) {
47
38
  return this.get("/manifest", { environment });
48
39
  }
@@ -2,23 +2,25 @@
2
2
  // number or account needs Meta's consent screen, and test phones and accounts
3
3
  // are a form with a code. The CLI only says where, and that depends on whether
4
4
  // the workspace has published: before, "Try the agent", where test phones and
5
- // accounts are verified; after, the channel's own page under Channels.
5
+ // accounts are verified; after, the channel's own page (WhatsApp, Instagram).
6
6
  // vatio.ai/workspaces is only for a server too old to send the link, and
7
7
  // redirects to the inbox.
8
- //
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.
11
8
 
12
9
  import { deployClient } from "./deploy.mjs";
13
10
  import { fail, paint, takeFlag } from "../support.mjs";
14
11
 
15
12
  const WHATSAPP_USAGE =
16
- "Usage: vatio whatsapp [test-phones [--json] | mine [NUMBER... | --clear]]";
13
+ "Usage: vatio whatsapp [test-phones [--json]]";
17
14
  // The list of who the agent answered on your own number is gone: it answers
18
15
  // everyone, and Live off in the inbox is how it answers nobody.
19
16
  const AGENT_NUMBERS_REMOVED =
20
17
  "`vatio whatsapp only` and `everyone` were removed: the agent answers everyone who writes to your number. " +
21
18
  "To have it answer nobody, turn Live off in the inbox, on the WhatsApp page.";
19
+ // "Your numbers" were a list typed by hand; the team's numbers took its place.
20
+ const MINE_REMOVED =
21
+ "`vatio whatsapp mine` was removed: the team's numbers are the ones each member verified on their account " +
22
+ "(Account in the inbox), so there is no list to set. A tool declares which role may use it with " +
23
+ "`access: supervisor`, `developer` or `owner`.";
22
24
 
23
25
  export async function whatsapp(config, args = []) {
24
26
  const sub = args.shift();
@@ -28,11 +30,7 @@ export async function whatsapp(config, args = []) {
28
30
  await printTestPhones(config).catch((error) => {
29
31
  if (error?.status !== 404 && error?.body?.error?.code !== "not_found") throw error;
30
32
  });
31
- await printNumber(config);
32
- // A server that predates the route answers 404; nothing more to show.
33
- return printOwnerNumbers(config).catch((error) => {
34
- if (error?.status !== 404 && error?.body?.error?.code !== "not_found") throw error;
35
- });
33
+ return printNumber(config);
36
34
  }
37
35
  if (sub === "test-phones") {
38
36
  const json = takeFlag(args, "--json");
@@ -40,12 +38,7 @@ export async function whatsapp(config, args = []) {
40
38
  return printTestPhones(config, { json });
41
39
  }
42
40
  if (sub === "only" || sub === "everyone") fail(AGENT_NUMBERS_REMOVED);
43
- if (sub === "mine") {
44
- const clear = takeFlag(args, "--clear");
45
- if (clear && args.length > 0) fail(WHATSAPP_USAGE);
46
- if (!clear && args.length === 0) return printOwnerNumbers(config);
47
- return setOwnerNumbers(config, clear ? [] : args.splice(0));
48
- }
41
+ if (sub === "mine") fail(MINE_REMOVED);
49
42
  fail(WHATSAPP_USAGE);
50
43
  }
51
44
 
@@ -91,30 +84,6 @@ async function printNumber(config) {
91
84
  }
92
85
  }
93
86
 
94
- async function setOwnerNumbers(config, numbers) {
95
- const client = deployClient(config, config.resolveWorkspaceRequired());
96
- printOwners(await client.updateOwnerNumbers(numbers));
97
- }
98
-
99
- async function printOwnerNumbers(config) {
100
- const client = deployClient(config, config.resolveWorkspaceRequired());
101
- printOwners(await client.ownerNumbers());
102
- }
103
-
104
- function printOwners(body) {
105
- const list = Array.isArray(body.owner_numbers) ? body.owner_numbers : [];
106
- if (list.length === 0) {
107
- console.log("\nYour numbers: none yet.");
108
- console.log(" On the preview number every verified test phone counts as one until you list some.");
109
- console.log(" List the business's own: vatio whatsapp mine +56912345678");
110
- return;
111
- }
112
- console.log(`\nYour numbers: ${list.join(", ")}`);
113
- console.log(" In these conversations the agent works for the business: `access: owner` tools are");
114
- console.log(" there, and what you send from the WhatsApp Business app is a message to the agent.");
115
- console.log(" Change them: vatio whatsapp mine NUMBER... Empty the list: vatio whatsapp mine --clear");
116
- }
117
-
118
87
  function printLive(number) {
119
88
  const live = number.live
120
89
  ? paint("green", "live: the agent answers everyone who writes")
package/lib/help.mjs CHANGED
@@ -203,10 +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 mine [NUMBER...|--clear]
207
- Your numbers: the business's own conversations,
208
- the only ones with access: owner tools. Needs
209
- no number connected; prints them without args
210
206
  instagram The same, for Instagram
211
207
 
212
208
  Everything else:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vatio-ai/cli",
3
- "version": "0.112.0",
3
+ "version": "0.113.0",
4
4
  "description": "Vatio CLI — deploy and manage Vatio agent workspaces",
5
5
  "keywords": [
6
6
  "vatio",