@vatio-ai/cli 0.100.2 → 0.100.3
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/config.mjs +6 -3
- package/lib/help.mjs +2 -2
- package/lib/support.mjs +15 -3
- package/package.json +1 -1
package/lib/config.mjs
CHANGED
|
@@ -57,10 +57,13 @@ export class Config {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
save(data) {
|
|
60
|
-
mkdirSync(dirname(this.configPath), { recursive: true });
|
|
61
|
-
writeFileSync(this.configPath, `${JSON.stringify(data, null, 2)}\n`);
|
|
60
|
+
mkdirSync(dirname(this.configPath), { recursive: true, mode: 0o700 });
|
|
62
61
|
// A token lives here. 0600 matches what the Ruby CLI writes, so switching
|
|
63
|
-
// between the two clients never loosens the file.
|
|
62
|
+
// between the two clients never loosens the file. Created 0600 rather
|
|
63
|
+
// than chmod-ed after, which left a moment where the umask's 0644 let
|
|
64
|
+
// other users on the machine read it; the chmod still tightens a file an
|
|
65
|
+
// older release wrote.
|
|
66
|
+
writeFileSync(this.configPath, `${JSON.stringify(data, null, 2)}\n`, { mode: 0o600 });
|
|
64
67
|
chmodSync(this.configPath, 0o600);
|
|
65
68
|
return data;
|
|
66
69
|
}
|
package/lib/help.mjs
CHANGED
|
@@ -148,8 +148,8 @@ the two you are in. Commands default as listed.
|
|
|
148
148
|
Team (the owner's; the same roles as the inbox's Team page):
|
|
149
149
|
team [list] [--json] The owner and everyone invited, and who has not signed in yet
|
|
150
150
|
team invite EMAIL --role viewer|supervisor|developer [--code CODE]
|
|
151
|
-
Invite them and email them.
|
|
152
|
-
account
|
|
151
|
+
Invite them and email them. Needs a second factor on your
|
|
152
|
+
account: --code is your authenticator app's code. Removing
|
|
153
153
|
someone or changing a role stays in the inbox
|
|
154
154
|
|
|
155
155
|
Credentials:
|
package/lib/support.mjs
CHANGED
|
@@ -117,12 +117,24 @@ export function sleep(ms) {
|
|
|
117
117
|
|
|
118
118
|
// Works without a terminal too: a coding agent running on the developer's own
|
|
119
119
|
// machine still opens their browser.
|
|
120
|
+
//
|
|
121
|
+
// Only an http(s) URL, and never through cmd.exe on Windows: `cmd /c start`
|
|
122
|
+
// parses its line again, so a URL from the server with `&` in it ran
|
|
123
|
+
// whatever followed. rundll32 hands the URL to the default browser as is.
|
|
120
124
|
export function openBrowser(url) {
|
|
121
125
|
if (!url) return;
|
|
126
|
+
let parsed;
|
|
127
|
+
try {
|
|
128
|
+
parsed = new URL(String(url));
|
|
129
|
+
} catch {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") return;
|
|
133
|
+
const href = parsed.href;
|
|
122
134
|
const command =
|
|
123
|
-
process.platform === "darwin" ? ["open", [
|
|
124
|
-
: process.platform === "win32" ? ["
|
|
125
|
-
: ["xdg-open", [
|
|
135
|
+
process.platform === "darwin" ? ["open", [href]]
|
|
136
|
+
: process.platform === "win32" ? ["rundll32", ["url.dll,FileProtocolHandler", href]]
|
|
137
|
+
: ["xdg-open", [href]];
|
|
126
138
|
try {
|
|
127
139
|
execFileSync(command[0], command[1], { stdio: "ignore" });
|
|
128
140
|
} catch {
|