clawfast 1.0.0 → 1.0.1
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/dist/clawfast.cjs +26 -8
- package/package.json +1 -1
package/dist/clawfast.cjs
CHANGED
|
@@ -68976,7 +68976,11 @@ async function ensureProxyReady(id, log2) {
|
|
|
68976
68976
|
};
|
|
68977
68977
|
if (await ping(healthUrl(def))) {
|
|
68978
68978
|
markEnabled();
|
|
68979
|
-
return {
|
|
68979
|
+
return {
|
|
68980
|
+
ok: true,
|
|
68981
|
+
message: `${def.label} j\xE1 est\xE1 no ar`,
|
|
68982
|
+
baseUrl: baseUrl(def)
|
|
68983
|
+
};
|
|
68980
68984
|
}
|
|
68981
68985
|
if (!hasCommand("git") || !hasCommand("npm")) {
|
|
68982
68986
|
return {
|
|
@@ -68991,7 +68995,10 @@ async function ensureProxyReady(id, log2) {
|
|
|
68991
68995
|
(0, import_node_fs4.mkdirSync)(root, { recursive: true });
|
|
68992
68996
|
const cloned = run("git", ["clone", def.repoUrl, dir], root);
|
|
68993
68997
|
if (!cloned.ok || !(0, import_node_fs4.existsSync)(dir)) {
|
|
68994
|
-
return {
|
|
68998
|
+
return {
|
|
68999
|
+
ok: false,
|
|
69000
|
+
message: `${def.label}: falha ao clonar o proxy (git).`
|
|
69001
|
+
};
|
|
68995
69002
|
}
|
|
68996
69003
|
freshSetup = true;
|
|
68997
69004
|
}
|
|
@@ -69005,13 +69012,15 @@ async function ensureProxyReady(id, log2) {
|
|
|
69005
69012
|
freshSetup = true;
|
|
69006
69013
|
}
|
|
69007
69014
|
if (freshSetup) {
|
|
69008
|
-
log2(
|
|
69015
|
+
log2(
|
|
69016
|
+
`${def.label}: abrindo o login no navegador \u2014 fa\xE7a login na sua conta\u2026`
|
|
69017
|
+
);
|
|
69009
69018
|
if (!run("npm", ["run", "login"], dir).ok) {
|
|
69010
69019
|
log2(`${def.label}: login n\xE3o confirmou; vou tentar subir mesmo assim.`);
|
|
69011
69020
|
}
|
|
69012
69021
|
}
|
|
69013
69022
|
log2(`${def.label}: iniciando o proxy\u2026`);
|
|
69014
|
-
const child = (0, import_node_child_process2.spawn)("npm", ["start"], {
|
|
69023
|
+
const child = (0, import_node_child_process2.spawn)(asShellCommand("npm", ["start"]), {
|
|
69015
69024
|
cwd: dir,
|
|
69016
69025
|
shell: true,
|
|
69017
69026
|
stdio: ["ignore", "ignore", "ignore"],
|
|
@@ -69038,7 +69047,7 @@ async function ensureProxyReady(id, log2) {
|
|
|
69038
69047
|
message: `${def.label}: o proxy n\xE3o respondeu em 90s. Tente de novo, ou rode 'npm run login' em ${dir}.`
|
|
69039
69048
|
};
|
|
69040
69049
|
}
|
|
69041
|
-
var import_node_os3, import_node_path3, import_node_fs4, import_node_child_process2, DEFS, PROXY_MODEL_KEYS, proxyIdForModelKey, proxiesRoot, dirFor, healthUrl, baseUrl, wait, started, exitHooksInstalled, run, hasCommand;
|
|
69050
|
+
var import_node_os3, import_node_path3, import_node_fs4, import_node_child_process2, DEFS, PROXY_MODEL_KEYS, proxyIdForModelKey, proxiesRoot, dirFor, healthUrl, baseUrl, wait, started, exitHooksInstalled, quoteArg, asShellCommand, run, hasCommand;
|
|
69042
69051
|
var init_proxy_manager2 = __esm({
|
|
69043
69052
|
"src/proxy-manager.ts"() {
|
|
69044
69053
|
"use strict";
|
|
@@ -69087,8 +69096,10 @@ var init_proxy_manager2 = __esm({
|
|
|
69087
69096
|
wait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
69088
69097
|
started = /* @__PURE__ */ new Set();
|
|
69089
69098
|
exitHooksInstalled = false;
|
|
69099
|
+
quoteArg = (s) => /[\s"&|<>^()]/.test(s) ? `"${s.replace(/"/g, '\\"')}"` : s;
|
|
69100
|
+
asShellCommand = (cmd, args) => [cmd, ...args.map(quoteArg)].join(" ");
|
|
69090
69101
|
run = (cmd, args, cwd) => {
|
|
69091
|
-
const res = (0, import_node_child_process2.spawnSync)(cmd, args, {
|
|
69102
|
+
const res = (0, import_node_child_process2.spawnSync)(asShellCommand(cmd, args), {
|
|
69092
69103
|
cwd,
|
|
69093
69104
|
shell: true,
|
|
69094
69105
|
stdio: "inherit",
|
|
@@ -69098,7 +69109,10 @@ var init_proxy_manager2 = __esm({
|
|
|
69098
69109
|
};
|
|
69099
69110
|
hasCommand = (cmd) => {
|
|
69100
69111
|
const probe = process.platform === "win32" ? "where" : "which";
|
|
69101
|
-
return (0, import_node_child_process2.spawnSync)(probe, [cmd], {
|
|
69112
|
+
return (0, import_node_child_process2.spawnSync)(asShellCommand(probe, [cmd]), {
|
|
69113
|
+
stdio: "ignore",
|
|
69114
|
+
shell: true
|
|
69115
|
+
}).status === 0;
|
|
69102
69116
|
};
|
|
69103
69117
|
}
|
|
69104
69118
|
});
|
|
@@ -69439,7 +69453,11 @@ async function createAgent() {
|
|
|
69439
69453
|
(line) => render.info(line)
|
|
69440
69454
|
);
|
|
69441
69455
|
if (!result.ok) {
|
|
69442
|
-
return {
|
|
69456
|
+
return {
|
|
69457
|
+
ok: false,
|
|
69458
|
+
message: result.message,
|
|
69459
|
+
selection: getModelSelection()
|
|
69460
|
+
};
|
|
69443
69461
|
}
|
|
69444
69462
|
render.info(result.message);
|
|
69445
69463
|
}
|