@vatio-ai/cli 0.100.1 → 0.100.2
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 +1 -6
- package/lib/commands/channels.mjs +6 -6
- package/lib/commands/chat.mjs +1 -1
- package/lib/commands/deploy.mjs +1 -1
- package/lib/commands/env.mjs +1 -2
- package/lib/commands/knowledge.mjs +0 -1
- package/lib/commands/supabase-auth.mjs +5 -21
- package/lib/device-auth.mjs +1 -1
- package/lib/help.mjs +2 -2
- package/package.json +1 -1
package/lib/api-client.mjs
CHANGED
|
@@ -29,7 +29,7 @@ export class ApiClient extends HttpClient {
|
|
|
29
29
|
return this.get("/whatsapp");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
// The phones verified
|
|
32
|
+
// The phones verified in Try the agent.
|
|
33
33
|
testPhones() {
|
|
34
34
|
return this.get("/test_phones");
|
|
35
35
|
}
|
|
@@ -99,11 +99,6 @@ export class ApiClient extends HttpClient {
|
|
|
99
99
|
return this.get(`/env/${encode(name)}`);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
// The project "Connect Supabase" picked in the inbox (Channels), if any.
|
|
103
|
-
supabase() {
|
|
104
|
-
return this.get("/supabase");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
102
|
// --- secrets --------------------------------------------------------
|
|
108
103
|
|
|
109
104
|
// Without an environment, the value everywhere; with one, the value only
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// whatsapp / instagram -- both are set up in the inbox: connecting your own
|
|
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
|
-
// the workspace has published: before, the
|
|
4
|
+
// the workspace has published: before, "Try the agent", where test phones and
|
|
5
5
|
// accounts are verified; after, the channel's own page under Channels.
|
|
6
6
|
// vatio.ai/workspaces is only for a server too old to send the link, and
|
|
7
7
|
// redirects to the inbox.
|
|
@@ -53,21 +53,21 @@ async function inInbox(config, channel) {
|
|
|
53
53
|
if (published) {
|
|
54
54
|
console.log(`Connect your own ${channel.own} and manage test ${channel.test}s in the inbox, under Channels:`);
|
|
55
55
|
} else {
|
|
56
|
-
console.log(`Test ${channel.name}
|
|
56
|
+
console.log(`Test ${channel.name} with Try the agent in the inbox: verify your ${channel.test} there and talk to your agent.`);
|
|
57
57
|
}
|
|
58
|
-
console.log(` ${url}`);
|
|
58
|
+
console.log(` ${published ? url : (status.try_url ?? url)}`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// The phones that joined by sending the
|
|
61
|
+
// The phones that joined by sending Try the agent's code: the ones a preview
|
|
62
62
|
// message can go to. Adding one is only in the inbox.
|
|
63
63
|
async function printTestPhones(config, { json = false } = {}) {
|
|
64
64
|
const { data = [], max } = await deployClient(config, config.resolveWorkspaceRequired()).testPhones();
|
|
65
65
|
if (json) return console.log(JSON.stringify({ data, max }, null, 2));
|
|
66
66
|
if (data.length === 0) {
|
|
67
|
-
console.log("\nNo test phones yet. Add yours
|
|
67
|
+
console.log("\nNo test phones yet. Add yours with Try the agent in the inbox: send it the code it shows.");
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
console.log(`\nTest phones (${data.length} of ${max}), verified
|
|
70
|
+
console.log(`\nTest phones (${data.length} of ${max}), verified in Try the agent:`);
|
|
71
71
|
for (const phone of data) console.log(` ${phone.phone_number}`);
|
|
72
72
|
}
|
|
73
73
|
|
package/lib/commands/chat.mjs
CHANGED
|
@@ -34,7 +34,7 @@ export async function chat(config, args) {
|
|
|
34
34
|
if (REMOVED_FLAGS.some((flag) => arg === flag || arg.startsWith(`${flag}=`))) {
|
|
35
35
|
fail(
|
|
36
36
|
`\`${arg}\` was removed. A CLI chat is you, the developer holding the token. ` +
|
|
37
|
-
"To test a real channel add a test phone or Instagram account
|
|
37
|
+
"To test a real channel add a test phone or Instagram account with Try the agent in the inbox; " +
|
|
38
38
|
"to pick a deployment use --env."
|
|
39
39
|
);
|
|
40
40
|
}
|
package/lib/commands/deploy.mjs
CHANGED
|
@@ -154,7 +154,7 @@ export async function push(config, args) {
|
|
|
154
154
|
// live was following every push, which is the single thing new developers
|
|
155
155
|
// have to be told by hand.
|
|
156
156
|
for (const line of consequenceLines(payload)) console.log(line);
|
|
157
|
-
// Where to try it: the inbox's
|
|
157
|
+
// Where to try it: the inbox's Try the agent panel for that environment.
|
|
158
158
|
if (payload.share_url) console.log(`Try it: ${payload.share_url}`);
|
|
159
159
|
for (const warning of asArray(payload.warnings)) console.log(` warning: ${warning}`);
|
|
160
160
|
if (payload.preview_url) console.log(`Preview: ${payload.preview_url}`);
|
package/lib/commands/env.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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
6
|
// the publishable token and the widget snippet -- and the link to try it on
|
|
7
|
-
// the inbox's
|
|
7
|
+
// the inbox's Try the agent panel.
|
|
8
8
|
|
|
9
9
|
import { deployClient } from "./deploy.mjs";
|
|
10
10
|
import { fail, takeEnv } from "../support.mjs";
|
|
@@ -56,7 +56,6 @@ async function show(client, workspace, name) {
|
|
|
56
56
|
? ` deployment: #${row.deployment_id}${row.git_sha ? ` (${row.git_sha.slice(0, 7)})` : ""}`
|
|
57
57
|
: " deployment: none yet — `vatio push`");
|
|
58
58
|
if (row.share_url) console.log(` try it: ${row.share_url}`);
|
|
59
|
-
if (row.knowledge_url) console.log(` knowledge diff: ${row.knowledge_url}`);
|
|
60
59
|
|
|
61
60
|
if (row.token) {
|
|
62
61
|
console.log(` publishable token: ${row.token}`);
|
|
@@ -231,7 +231,6 @@ async function status({ client, workspace, env }, base) {
|
|
|
231
231
|
}
|
|
232
232
|
if (changes.some((change) => change.conflict)) {
|
|
233
233
|
console.log(`\nRead each conflicting entry from live (\`vatio kb cat ${base} ENTRY --env live\`), write your change on top, and it clears.`);
|
|
234
|
-
if (payload.review_url) console.log(`Or resolve them side by side: ${payload.review_url}`);
|
|
235
234
|
} else {
|
|
236
235
|
console.log("\n`vatio publish` takes them live with the agent; `vatio kb publish` takes them alone.");
|
|
237
236
|
}
|
|
@@ -40,16 +40,12 @@ 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
|
-
|
|
44
|
-
|
|
45
|
-
const connected = given ? null : await connectedProject(config, workspace);
|
|
46
|
-
const found = connected ? {} : detect([process.cwd(), root]);
|
|
47
|
-
const url = normalize(given ?? connected?.url ?? found.url);
|
|
43
|
+
const found = given ? {} : detect([process.cwd(), root]);
|
|
44
|
+
const url = normalize(given ?? found.url);
|
|
48
45
|
if (!url) {
|
|
49
46
|
fail(
|
|
50
47
|
"Could not find your Supabase project URL in a .env or src/integrations/supabase/client.ts.\n" +
|
|
51
|
-
"Pass it: vatio auth --supabase https://<project-ref>.supabase.co
|
|
52
|
-
"or connect Supabase in the inbox, under Channels → Supabase."
|
|
48
|
+
"Pass it: vatio auth --supabase https://<project-ref>.supabase.co"
|
|
53
49
|
);
|
|
54
50
|
}
|
|
55
51
|
if (!PROJECT_URL.test(url)) {
|
|
@@ -60,11 +56,9 @@ export async function supabaseAuth(config, args) {
|
|
|
60
56
|
writeManifest(config.manifestPath(), url, signInUrl, force);
|
|
61
57
|
|
|
62
58
|
console.log(`${paint("green", "✓")} vatio.yml now verifies visitors with ${url}`);
|
|
63
|
-
if (
|
|
64
|
-
else if (found.from && !given) console.log(` (found in ${found.from})`);
|
|
59
|
+
if (found.from && !given) console.log(` (found in ${found.from})`);
|
|
65
60
|
|
|
66
|
-
if (
|
|
67
|
-
else if (!skipSecrets) await storeSecrets(config, workspace, url, found.key);
|
|
61
|
+
if (!skipSecrets) await storeSecrets(config, workspace, url, found.key);
|
|
68
62
|
|
|
69
63
|
console.log("");
|
|
70
64
|
console.log("What happens after `vatio push` and `vatio publish`:");
|
|
@@ -97,16 +91,6 @@ export async function supabaseAuth(config, args) {
|
|
|
97
91
|
console.log("Docs: https://vatio.ai/docs/integrations/supabase");
|
|
98
92
|
}
|
|
99
93
|
|
|
100
|
-
async function connectedProject(config, workspace) {
|
|
101
|
-
if (!config.resolveBaseUrl() || !config.resolveToken()) return null;
|
|
102
|
-
try {
|
|
103
|
-
return (await deployClient(config, workspace).supabase())?.project ?? null;
|
|
104
|
-
} catch {
|
|
105
|
-
// An older platform, or no network: the .env is still there to read.
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
94
|
// Where the app already says which project it uses: the nearest directory, from
|
|
111
95
|
// here and from the workspace root upwards, that names one.
|
|
112
96
|
function detect(starts) {
|
package/lib/device-auth.mjs
CHANGED
|
@@ -19,7 +19,7 @@ export class DeviceAuthClient {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// A `workspace` lets the page the developer signs in on wait for that push
|
|
22
|
-
// and land on its
|
|
22
|
+
// and land on its conversations in the inbox.
|
|
23
23
|
start({ workspace } = {}) {
|
|
24
24
|
const body = {};
|
|
25
25
|
if (workspace) body.workspace = workspace;
|
package/lib/help.mjs
CHANGED
|
@@ -197,10 +197,10 @@ the two you are in. Commands default as listed.
|
|
|
197
197
|
conversations with these numbers
|
|
198
198
|
|
|
199
199
|
Channels:
|
|
200
|
-
whatsapp Set up in the inbox; prints the link (
|
|
200
|
+
whatsapp Set up in the inbox; prints the link (Try the agent
|
|
201
201
|
until you publish, then Channels)
|
|
202
202
|
whatsapp test-phones [--json]
|
|
203
|
-
The phones verified
|
|
203
|
+
The phones verified in Try the agent, to send a
|
|
204
204
|
preview message to
|
|
205
205
|
whatsapp only NUMBER...|everyone
|
|
206
206
|
Who the agent answers on your own number; the
|