@vatio-ai/cli 0.135.0 → 0.137.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 +8 -0
- package/lib/commands/channels.mjs +26 -2
- package/lib/commands/misc.mjs +1 -1
- package/lib/help.mjs +2 -0
- package/lib/telemetry.mjs +1 -0
- package/package.json +1 -1
package/lib/api-client.mjs
CHANGED
|
@@ -58,6 +58,14 @@ export class ApiClient extends HttpClient {
|
|
|
58
58
|
return this.get("/whatsapp/team");
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
// --- instagram ------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
// A link that connects the account with no Vatio session, to send whoever
|
|
64
|
+
// holds it: { url, expires_at }.
|
|
65
|
+
instagramConnectLink() {
|
|
66
|
+
return this.post("/instagram/link", {});
|
|
67
|
+
}
|
|
68
|
+
|
|
61
69
|
syncTemplates() {
|
|
62
70
|
return this.post("/templates/sync", {});
|
|
63
71
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// whatsapp / instagram -- connecting your own number or account needs Meta's
|
|
2
|
-
// consent screen, so `connect` prints where in the inbox
|
|
2
|
+
// consent screen, so `connect` prints where in the inbox (and `instagram link`
|
|
3
|
+
// a page for whoever holds the account), and that depends on
|
|
3
4
|
// whether the workspace has published: before, "Try the agent"; after, the
|
|
4
5
|
// channel's own page. Everything else on the WhatsApp page is here too.
|
|
5
6
|
// vatio.ai/workspaces is only for a server too old to send the link, and
|
|
@@ -101,7 +102,30 @@ const INSTAGRAM = {
|
|
|
101
102
|
draft: "Test Instagram with Try the agent in the inbox: verify your account there and talk to your agent."
|
|
102
103
|
};
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
const INSTAGRAM_USAGE = "Usage: vatio instagram [connect] | link [--json]";
|
|
106
|
+
|
|
107
|
+
// `link` is the page that connects the account with no Vatio session, for
|
|
108
|
+
// whoever holds it -- often a client, sent the link by WhatsApp.
|
|
109
|
+
export async function instagram(config, args = []) {
|
|
110
|
+
const json = takeFlag(args, "--json");
|
|
111
|
+
const sub = args.shift();
|
|
112
|
+
if (args.length) fail(INSTAGRAM_USAGE);
|
|
113
|
+
switch (sub) {
|
|
114
|
+
case undefined:
|
|
115
|
+
case "connect":
|
|
116
|
+
return inInbox(config, INSTAGRAM);
|
|
117
|
+
case "link": {
|
|
118
|
+
const link = await deployClient(config, config.resolveWorkspaceRequired()).instagramConnectLink();
|
|
119
|
+
if (json) return console.log(JSON.stringify(link, null, 2));
|
|
120
|
+
console.log("Share this link with whoever holds the Instagram account. They connect it from Instagram, with no Vatio");
|
|
121
|
+
console.log(`account, and works until ${link.expires_at}:`);
|
|
122
|
+
console.log(` ${link.url}`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
default:
|
|
126
|
+
return fail(INSTAGRAM_USAGE);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
105
129
|
|
|
106
130
|
async function inInbox(config, channel) {
|
|
107
131
|
const status = await deployClient(config, config.resolveWorkspaceRequired()).deployStatus();
|
package/lib/commands/misc.mjs
CHANGED
|
@@ -192,7 +192,7 @@ const AGENTS_NOTE = [
|
|
|
192
192
|
"everyone once the tests that pass today pass on it. The `vatio-improve` skill",
|
|
193
193
|
"walks through it.",
|
|
194
194
|
"`vatio test add \"QUESTION\" \"WHAT IT SHOULD DO\"` adds a test.",
|
|
195
|
-
"`vatio tools
|
|
195
|
+
"`vatio tools` shows how each tool's backend has been answering:",
|
|
196
196
|
"error rate, timeouts, latency and the calls that failed.",
|
|
197
197
|
""
|
|
198
198
|
].join("\n");
|
package/lib/help.mjs
CHANGED
|
@@ -272,6 +272,8 @@ it made obsolete, moves it on. \`vatio rollback\` undoes the last change.
|
|
|
272
272
|
|
|
273
273
|
Channels:
|
|
274
274
|
instagram The same, for Instagram
|
|
275
|
+
instagram link [--json] The link to share with whoever holds the account:
|
|
276
|
+
they connect it with no Vatio account (7 days)
|
|
275
277
|
|
|
276
278
|
Everything else:
|
|
277
279
|
config show|get KEY|set KEY VALUE|unset KEY
|
package/lib/telemetry.mjs
CHANGED
|
@@ -39,6 +39,7 @@ const SUBCOMMANDS = {
|
|
|
39
39
|
webhooks: ["list", "create", "test", "deliveries", "enable", "rm"],
|
|
40
40
|
contacts: ["export", "delete"],
|
|
41
41
|
whatsapp: ["status", "connect", "live", "check", "disconnect", "invite", "team", "templates", "failed"],
|
|
42
|
+
instagram: ["connect", "link"],
|
|
42
43
|
config: ["show", "get", "set", "unset"],
|
|
43
44
|
"share-session": ["--should-ask", "--never"],
|
|
44
45
|
test: ["add", "list", "rm"],
|