@vatio-ai/cli 0.120.0 → 0.121.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/claude-session.mjs
CHANGED
|
@@ -59,10 +59,12 @@ const SECRET_PATTERNS = [
|
|
|
59
59
|
// The people a session is about rather than the one who sends it: customers
|
|
60
60
|
// that came up in a query or a log. The team never needs who they were. A
|
|
61
61
|
// phone counts only in international form; a bare run of digits is as likely
|
|
62
|
-
// an id.
|
|
62
|
+
// an id. A Chilean RUT has its check digit after a dash, the same pattern the
|
|
63
|
+
// Admin API redacts chats with (AdminApi::ChatTranscriptRedactor).
|
|
63
64
|
const PERSONAL_PATTERNS = [
|
|
64
65
|
[/(?<![\w.%+/-])(?!git@|no-?reply@)[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}\b/g, "[EMAIL]"],
|
|
65
|
-
[/(?<![\w+])\+\d(?:[ .-]?\d){7,14}\b/g, "[PHONE]"]
|
|
66
|
+
[/(?<![\w+])\+\d(?:[ .-]?\d){7,14}\b/g, "[PHONE]"],
|
|
67
|
+
[/(?<![\p{L}\p{N}])\d{1,2}\.?\d{3}\.?\d{3}-[\dkK](?![\p{L}\p{N}])/gu, "[RUT]"]
|
|
66
68
|
];
|
|
67
69
|
|
|
68
70
|
export function claudeHome() {
|
package/lib/commands/deploy.mjs
CHANGED
|
@@ -75,9 +75,34 @@ export async function checkWorkspace(config, workspace, { environment = null } =
|
|
|
75
75
|
return deployClient(config, workspace).check({ files, environment });
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
// A block vatio.yml still declares and the platform no longer reads. Among the
|
|
79
|
+
// other warnings it read as one more, and a developer took `allowed_origins:`
|
|
80
|
+
// under `widget:` as applied: said apart, as what it is.
|
|
81
|
+
const IGNORED_BLOCK = /^vatio\.yml: `[^`]+` is ignored/;
|
|
82
|
+
|
|
83
|
+
// Returns the ignored-block lines it held back, for a caller that prints them
|
|
84
|
+
// last (`vatio push`); otherwise they follow the other warnings.
|
|
85
|
+
export function printDiagnostics(payload, { holdIgnored = false } = {}) {
|
|
79
86
|
for (const row of asArray(payload.errors)) console.error(`error: ${diagnosticLine(row)}`);
|
|
80
|
-
|
|
87
|
+
const ignored = [];
|
|
88
|
+
for (const row of asArray(payload.warnings)) {
|
|
89
|
+
const line = diagnosticLine(row);
|
|
90
|
+
if (IGNORED_BLOCK.test(line)) ignored.push(line);
|
|
91
|
+
else console.error(`warning: ${line}`);
|
|
92
|
+
}
|
|
93
|
+
if (!holdIgnored) printIgnored(ignored);
|
|
94
|
+
return ignored;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function printIgnored(lines) {
|
|
98
|
+
if (lines.length === 0) return;
|
|
99
|
+
const one = lines.length === 1;
|
|
100
|
+
console.error("");
|
|
101
|
+
console.error(
|
|
102
|
+
`Not applied: vatio.yml declares ${one ? "a block" : `${lines.length} blocks`} Vatio does not read, ` +
|
|
103
|
+
`and nothing in ${one ? "it" : "them"} takes effect:`
|
|
104
|
+
);
|
|
105
|
+
for (const line of lines) console.error(` ${line}`);
|
|
81
106
|
}
|
|
82
107
|
|
|
83
108
|
// A diagnostic is { message, path } -- `path` is the file it is about, or null
|
|
@@ -118,8 +143,11 @@ export async function push(config, args) {
|
|
|
118
143
|
}
|
|
119
144
|
|
|
120
145
|
const check = await checkWorkspace(config, workspace, { environment });
|
|
121
|
-
printDiagnostics(check);
|
|
122
|
-
if (!check.ok)
|
|
146
|
+
const ignored = printDiagnostics(check, { holdIgnored: true });
|
|
147
|
+
if (!check.ok) {
|
|
148
|
+
printIgnored(ignored);
|
|
149
|
+
fail(`push aborted: check failed (${asArray(check.errors).length} error(s))`);
|
|
150
|
+
}
|
|
123
151
|
|
|
124
152
|
const client = deployClient(config, workspace);
|
|
125
153
|
const baseUrl = config.resolveBaseUrl();
|
|
@@ -156,7 +184,10 @@ export async function push(config, args) {
|
|
|
156
184
|
for (const line of consequenceLines(payload)) console.log(line);
|
|
157
185
|
// Where to try it: the inbox's Try the agent panel for that environment.
|
|
158
186
|
if (payload.share_url) console.log(`Try it: ${payload.share_url}`);
|
|
159
|
-
for (const warning of asArray(payload.warnings))
|
|
187
|
+
for (const warning of asArray(payload.warnings)) {
|
|
188
|
+
if (!IGNORED_BLOCK.test(String(warning))) console.log(` warning: ${warning}`);
|
|
189
|
+
else if (!ignored.includes(String(warning))) ignored.push(String(warning));
|
|
190
|
+
}
|
|
160
191
|
if (payload.preview_url) console.log(`Preview: ${payload.preview_url}`);
|
|
161
192
|
|
|
162
193
|
const hint = payload.first_push_hint;
|
|
@@ -166,6 +197,7 @@ export async function push(config, args) {
|
|
|
166
197
|
console.log(` ${hint.url}`);
|
|
167
198
|
}
|
|
168
199
|
printNotices(payload);
|
|
200
|
+
printIgnored(ignored);
|
|
169
201
|
}
|
|
170
202
|
|
|
171
203
|
// The two or three lines that say who sees this push, read off the platform's
|
|
@@ -100,7 +100,7 @@ export async function shareSession(config, args) {
|
|
|
100
100
|
console.log(
|
|
101
101
|
` Left out: ${transcript.images > 0 ? `${transcript.images} image(s) and ` : ""}${label}'s own bookkeeping.` +
|
|
102
102
|
(transcript.redactions > 0 ? ` ${transcript.redactions} thing(s) that looked like a key, token or password are [REDACTED].` : "") +
|
|
103
|
-
(transcript.personal > 0 ? ` ${transcript.personal} email address(es)
|
|
103
|
+
(transcript.personal > 0 ? ` ${transcript.personal} email address(es), phone number(s) and RUT(s) are [EMAIL], [PHONE] and [RUT].` : "")
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
if (savePath) {
|
package/lib/suggest.mjs
CHANGED
|
@@ -100,6 +100,16 @@ const SUBCOMMAND_OF = {
|
|
|
100
100
|
write: ["kb"]
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
// Commands that were renamed. A token that is one of these is a habit (or an
|
|
104
|
+
// older doc) and the reader needs the new name, not an edit-distance guess:
|
|
105
|
+
// `tokens` is nowhere near `keys`, so it used to get the bare list.
|
|
106
|
+
const RENAMED = {
|
|
107
|
+
// `tokens create` made publishable keys; `keys create` names the kind.
|
|
108
|
+
tokens: (rest) => (rest[0] === "create" && !["publishable", "secret"].includes(rest[1])
|
|
109
|
+
? ["keys", "create", "publishable", ...rest.slice(1)]
|
|
110
|
+
: ["keys", ...rest])
|
|
111
|
+
};
|
|
112
|
+
|
|
103
113
|
// Exported so scripts/check-docs.mjs can check every command named above is
|
|
104
114
|
// one the CLI actually dispatches.
|
|
105
115
|
export const SUBCOMMAND_OWNERS = [...new Set(Object.values(SUBCOMMAND_OF).flat())];
|
|
@@ -215,6 +225,18 @@ export function unknownCommandMessage(command, args = []) {
|
|
|
215
225
|
].join("\n");
|
|
216
226
|
}
|
|
217
227
|
|
|
228
|
+
const rename = RENAMED[token.toLowerCase()];
|
|
229
|
+
if (rename) {
|
|
230
|
+
const [renamed, ...renamedArgs] = rename(rest);
|
|
231
|
+
return [
|
|
232
|
+
`\`vatio ${token}\` is now \`vatio ${renamed}\`.`,
|
|
233
|
+
"",
|
|
234
|
+
`Run: vatio ${[renamed, ...renamedArgs].join(" ")}`,
|
|
235
|
+
"",
|
|
236
|
+
"`vatio help` lists every command."
|
|
237
|
+
].join("\n");
|
|
238
|
+
}
|
|
239
|
+
|
|
218
240
|
const belongsTo = SUBCOMMAND_OF[token.toLowerCase()];
|
|
219
241
|
if (belongsTo) {
|
|
220
242
|
const options = belongsTo.map((owner) => `vatio ${owner} ${token}${trailing}`);
|