@qablehq/atto 0.0.27 → 0.0.29
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/bin/atto.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Opens the built Atto desktop window. Installed as the `atto` command.
|
|
3
3
|
// If a silent update was queued on the previous quit, kick it off in the
|
|
4
4
|
// background — never block the window on npm install.
|
|
5
|
-
const { spawn } = require("node:child_process");
|
|
5
|
+
const { spawn, spawnSync } = require("node:child_process");
|
|
6
6
|
const fs = require("node:fs");
|
|
7
7
|
const os = require("node:os");
|
|
8
8
|
const path = require("node:path");
|
|
@@ -48,17 +48,63 @@ function kickPendingSilentUpdate() {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
/** True when Electron's extracted binary looks complete (not a half-finished download). */
|
|
52
|
+
function electronLooksReady(electronPkgDir) {
|
|
53
|
+
const pathFile = path.join(electronPkgDir, "path.txt");
|
|
54
|
+
if (!fs.existsSync(pathFile)) return false;
|
|
55
|
+
const rel = fs.readFileSync(pathFile, "utf8").trim();
|
|
56
|
+
if (!rel) return false;
|
|
57
|
+
const binary = path.join(electronPkgDir, "dist", rel);
|
|
58
|
+
try {
|
|
59
|
+
const st = fs.statSync(binary);
|
|
60
|
+
// A real Electron binary is tens of MB; a stub/partial extract is tiny.
|
|
61
|
+
return st.isFile() && st.size > 1_000_000;
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function ensureElectronBinary(electronPkgDir) {
|
|
68
|
+
if (electronLooksReady(electronPkgDir)) return true;
|
|
69
|
+
console.log("Downloading Electron binary...");
|
|
70
|
+
const installJs = path.join(electronPkgDir, "install.js");
|
|
71
|
+
if (!fs.existsSync(installJs)) return false;
|
|
72
|
+
const result = spawnSync(process.execPath, [installJs], { stdio: "inherit" });
|
|
73
|
+
return result.status === 0 && electronLooksReady(electronPkgDir);
|
|
74
|
+
}
|
|
75
|
+
|
|
51
76
|
kickPendingSilentUpdate();
|
|
52
77
|
|
|
78
|
+
const appDir = path.resolve(__dirname, "..");
|
|
79
|
+
const rendererHtml = path.join(appDir, "out", "renderer", "index.html");
|
|
80
|
+
if (!fs.existsSync(rendererHtml)) {
|
|
81
|
+
console.error(
|
|
82
|
+
"Atto UI files are missing (out/renderer/index.html). Reinstall with:\n npm install -g @qablehq/atto@latest --prefix \"$HOME/.local\""
|
|
83
|
+
);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
|
|
53
87
|
let electronPath;
|
|
54
88
|
try {
|
|
55
|
-
|
|
56
|
-
|
|
89
|
+
// Prefer resolving from this package so global/prefix installs find the right copy.
|
|
90
|
+
const electronPkgDir = path.dirname(require.resolve("electron/package.json", { paths: [appDir] }));
|
|
91
|
+
if (!ensureElectronBinary(electronPkgDir)) {
|
|
92
|
+
console.error(
|
|
93
|
+
"Electron failed to install. Fix with:\n cd \"" +
|
|
94
|
+
path.join(appDir, "node_modules", "electron") +
|
|
95
|
+
'" && node install.js'
|
|
96
|
+
);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
// Fresh require after install.js may have written path.txt / dist.
|
|
100
|
+
delete require.cache[require.resolve("electron", { paths: [appDir] })];
|
|
101
|
+
electronPath = require(require.resolve("electron", { paths: [appDir] }));
|
|
102
|
+
} catch (error) {
|
|
57
103
|
console.error("Atto could not find Electron. Install again with: npm install -g @qablehq/atto");
|
|
104
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
58
105
|
process.exit(1);
|
|
59
106
|
}
|
|
60
107
|
|
|
61
|
-
const appDir = path.resolve(__dirname, "..");
|
|
62
108
|
const child = spawn(electronPath, [appDir], {
|
|
63
109
|
stdio: "inherit",
|
|
64
110
|
env: { ...process.env, ATTO_NPM_PACKAGE: "1" },
|
package/out/main/index.js
CHANGED
|
@@ -198,13 +198,21 @@ async function loadAccount(link) {
|
|
|
198
198
|
}
|
|
199
199
|
if (!response.ok) throw new Error(await errorMessage(response));
|
|
200
200
|
const projects = asProjects(await response.json());
|
|
201
|
+
let unlockedProjectIds = link.unlockedProjectIds;
|
|
202
|
+
if (link.code.startsWith("atto_proj_") && projects.length > 0) {
|
|
203
|
+
const merged = [.../* @__PURE__ */ new Set([...unlockedProjectIds, ...projects.map((project) => project.id)])];
|
|
204
|
+
if (merged.length !== unlockedProjectIds.length) {
|
|
205
|
+
unlockedProjectIds = merged;
|
|
206
|
+
writeLink({ ...link, unlockedProjectIds });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
201
209
|
return {
|
|
202
210
|
connected: true,
|
|
203
211
|
baseUrl: link.baseUrl,
|
|
204
212
|
user: signedInUser(projects),
|
|
205
213
|
workspaces: [],
|
|
206
214
|
projects,
|
|
207
|
-
unlockedProjectIds
|
|
215
|
+
unlockedProjectIds,
|
|
208
216
|
error: null
|
|
209
217
|
};
|
|
210
218
|
}
|
|
@@ -226,7 +234,7 @@ async function tesboStatus() {
|
|
|
226
234
|
}
|
|
227
235
|
async function tesboLogin(cmd) {
|
|
228
236
|
const code = cmd.code.trim();
|
|
229
|
-
if (!code) throw new Error("Paste the
|
|
237
|
+
if (!code) throw new Error("Paste the project code from Tesbo (Agents → Atto).");
|
|
230
238
|
const previous = readLink();
|
|
231
239
|
const link = {
|
|
232
240
|
baseUrl: DEFAULT_BASE_URL,
|
|
@@ -247,21 +255,22 @@ async function tesboLogin(cmd) {
|
|
|
247
255
|
response = await connectOnce();
|
|
248
256
|
}
|
|
249
257
|
if (!response.ok) throw new Error(await errorMessage(response));
|
|
250
|
-
writeLink(link);
|
|
251
258
|
const projects = asProjects(await response.json());
|
|
259
|
+
const unlockedProjectIds = [.../* @__PURE__ */ new Set([...link.unlockedProjectIds, ...projects.map((project) => project.id)])];
|
|
260
|
+
writeLink({ ...link, unlockedProjectIds });
|
|
252
261
|
return {
|
|
253
262
|
connected: true,
|
|
254
263
|
baseUrl: link.baseUrl,
|
|
255
264
|
user: signedInUser(projects),
|
|
256
265
|
workspaces: [],
|
|
257
266
|
projects,
|
|
258
|
-
unlockedProjectIds
|
|
267
|
+
unlockedProjectIds,
|
|
259
268
|
error: null
|
|
260
269
|
};
|
|
261
270
|
}
|
|
262
271
|
async function tesboUnlockProject(cmd) {
|
|
263
272
|
const link = readLink();
|
|
264
|
-
if (!link) throw new Error("Connect with your
|
|
273
|
+
if (!link) throw new Error("Connect with your project code first.");
|
|
265
274
|
const projectId = String(cmd.projectId || "").trim();
|
|
266
275
|
const projectCode = String(cmd.projectCode || "").trim();
|
|
267
276
|
if (!projectId) throw new Error("Pick a project to unlock.");
|
|
@@ -12699,15 +12708,6 @@ function setupAutoUpdater() {
|
|
|
12699
12708
|
});
|
|
12700
12709
|
}
|
|
12701
12710
|
registerMediaProtocolScheme();
|
|
12702
|
-
function warmChromiumInBackground() {
|
|
12703
|
-
const check = chromiumExecutable();
|
|
12704
|
-
if (check.available) return;
|
|
12705
|
-
console.log("[atto] Chromium missing — downloading in background");
|
|
12706
|
-
void installChromium().then((result) => {
|
|
12707
|
-
if (result.ok) console.log("[atto] Chromium ready");
|
|
12708
|
-
else console.warn("[atto] Chromium download failed:", result.error);
|
|
12709
|
-
});
|
|
12710
|
-
}
|
|
12711
12711
|
function createMainWindow() {
|
|
12712
12712
|
const mainWindow = new electron.BrowserWindow({
|
|
12713
12713
|
width: 1320,
|
|
@@ -12742,7 +12742,6 @@ function createMainWindow() {
|
|
|
12742
12742
|
electron.app.whenReady().then(() => {
|
|
12743
12743
|
registerMediaProtocol();
|
|
12744
12744
|
createMainWindow();
|
|
12745
|
-
warmChromiumInBackground();
|
|
12746
12745
|
const engine = process.env.TAA_ENGINE === "mock" ? new MockFixturePlayer() : new RealEngine();
|
|
12747
12746
|
registerIpcHandlers(engine);
|
|
12748
12747
|
electron.app.on("before-quit", () => {
|
|
@@ -33155,8 +33155,8 @@ function TesboPanel() {
|
|
|
33155
33155
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mb-6 rounded-lg border border-border bg-card p-4", children: [
|
|
33156
33156
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-3", children: [
|
|
33157
33157
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33158
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold", children: status?.connected ? "Tesbo connection" : "Connect with
|
|
33159
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: status?.connected ? "
|
|
33158
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold", children: status?.connected ? "Tesbo connection" : "Connect with project code" }),
|
|
33159
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: status?.connected ? "Connected to the project for this code. Disconnect, then paste another project's code to switch." : "Paste the project code from Agents → Atto on the website. Atto shows that project only." }),
|
|
33160
33160
|
status?.connected && status.user?.name && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-foreground", children: status.user.name })
|
|
33161
33161
|
] }),
|
|
33162
33162
|
status?.connected && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", variant: "outline", onClick: () => void disconnect(), disabled: busy, children: "Disconnect" })
|
|
@@ -33171,14 +33171,14 @@ function TesboPanel() {
|
|
|
33171
33171
|
},
|
|
33172
33172
|
children: [
|
|
33173
33173
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "grid gap-1 text-xs text-muted-foreground", children: [
|
|
33174
|
-
"
|
|
33174
|
+
"Project code",
|
|
33175
33175
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
33176
33176
|
"input",
|
|
33177
33177
|
{
|
|
33178
33178
|
value: code,
|
|
33179
33179
|
onChange: (event) => setCode(event.target.value),
|
|
33180
33180
|
className: "h-10 rounded-md border border-border bg-background px-3 text-sm text-foreground",
|
|
33181
|
-
placeholder: "
|
|
33181
|
+
placeholder: "atto_proj_…",
|
|
33182
33182
|
autoComplete: "off",
|
|
33183
33183
|
spellCheck: false,
|
|
33184
33184
|
autoFocus: true
|
|
@@ -33225,17 +33225,25 @@ function ProjectList() {
|
|
|
33225
33225
|
const setActiveProject = useAppStore((s2) => s2.setActiveProject);
|
|
33226
33226
|
const setView = useAppStore((s2) => s2.setView);
|
|
33227
33227
|
const ensureProject = useAppStore((s2) => s2.ensureProject);
|
|
33228
|
+
const deleteProject2 = useAppStore((s2) => s2.deleteProject);
|
|
33228
33229
|
const setFolderPath = useAppStore((s2) => s2.setProjectFolderPath);
|
|
33229
33230
|
const setBrowserMode = useAppStore((s2) => s2.setProjectBrowserMode);
|
|
33230
33231
|
const setMemories = useAppStore((s2) => s2.setProjectMemories);
|
|
33231
33232
|
const [dialogOpen, setDialogOpen] = reactExports.useState(false);
|
|
33232
33233
|
const [tesboConnected, setTesboConnected] = reactExports.useState(false);
|
|
33234
|
+
const [connectedRemoteIds, setConnectedRemoteIds] = reactExports.useState([]);
|
|
33233
33235
|
const [unlockedRemoteIds, setUnlockedRemoteIds] = reactExports.useState([]);
|
|
33234
33236
|
const [unlockFor, setUnlockFor] = reactExports.useState(null);
|
|
33235
33237
|
const [projectCode, setProjectCode] = reactExports.useState("");
|
|
33236
33238
|
const [unlockBusy, setUnlockBusy] = reactExports.useState(false);
|
|
33237
33239
|
const [unlockError, setUnlockError] = reactExports.useState(null);
|
|
33238
|
-
const projects = projectOrder.map((id) => projectsById[id])
|
|
33240
|
+
const projects = projectOrder.map((id) => projectsById[id]).filter((project) => {
|
|
33241
|
+
if (!project) return false;
|
|
33242
|
+
const remoteId = remoteIdFromLocal(project.id);
|
|
33243
|
+
if (!remoteId) return true;
|
|
33244
|
+
if (!tesboConnected) return false;
|
|
33245
|
+
return connectedRemoteIds.includes(remoteId);
|
|
33246
|
+
});
|
|
33239
33247
|
const isUnlocked = (localId) => {
|
|
33240
33248
|
const remoteId = remoteIdFromLocal(localId);
|
|
33241
33249
|
if (!remoteId) return true;
|
|
@@ -33321,12 +33329,19 @@ function ProjectList() {
|
|
|
33321
33329
|
if (cancelled) return;
|
|
33322
33330
|
setTesboConnected(Boolean(status.connected));
|
|
33323
33331
|
setUnlockedRemoteIds(status.unlockedProjectIds || []);
|
|
33332
|
+
const remoteIds = status.connected ? status.projects.map((project) => project.id) : [];
|
|
33333
|
+
setConnectedRemoteIds(remoteIds);
|
|
33324
33334
|
if (!status.connected) return;
|
|
33325
33335
|
for (const project of status.projects) {
|
|
33326
33336
|
ensureProject(tesboProjectId$1(project.id), {
|
|
33327
33337
|
name: project.name || project.userName || "Tesbo project"
|
|
33328
33338
|
});
|
|
33329
33339
|
}
|
|
33340
|
+
const keep = new Set(remoteIds.map(tesboProjectId$1));
|
|
33341
|
+
const order2 = useAppStore.getState().projectOrder;
|
|
33342
|
+
for (const id of order2) {
|
|
33343
|
+
if (id.startsWith("tesbo-") && !keep.has(id)) deleteProject2(id);
|
|
33344
|
+
}
|
|
33330
33345
|
const remote = await window.taa.tesbo.remoteConfig();
|
|
33331
33346
|
if (cancelled || !remote?.projectId) return;
|
|
33332
33347
|
syncRemote(remote);
|
|
@@ -33339,12 +33354,12 @@ function ProjectList() {
|
|
|
33339
33354
|
cancelled = true;
|
|
33340
33355
|
window.clearInterval(timer);
|
|
33341
33356
|
};
|
|
33342
|
-
}, [ensureProject, setFolderPath, setBrowserMode, setMemories]);
|
|
33357
|
+
}, [ensureProject, deleteProject2, setFolderPath, setBrowserMode, setMemories]);
|
|
33343
33358
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full w-full flex-1 flex-col overflow-hidden bg-background", children: [
|
|
33344
33359
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "flex items-center justify-between border-b border-border px-6 py-4", children: [
|
|
33345
33360
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
33346
33361
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-lg font-semibold", children: tesboConnected ? "Projects" : "Connect Atto" }),
|
|
33347
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: tesboConnected ? "
|
|
33362
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: tesboConnected ? "Showing the project for your connected code. Disconnect to connect a different project." : "Paste your project code from Agents → Atto to open that project." })
|
|
33348
33363
|
] }),
|
|
33349
33364
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { size: "sm", variant: "outline", className: "gap-2", onClick: () => setDialogOpen(true), children: [
|
|
33350
33365
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "size-4" }),
|
|
@@ -33354,8 +33369,8 @@ function ProjectList() {
|
|
|
33354
33369
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto px-6 py-5", children: [
|
|
33355
33370
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TesboPanel, {}),
|
|
33356
33371
|
!tesboConnected && projects.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 rounded-lg border border-dashed border-border px-4 py-8 text-center", children: [
|
|
33357
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium", children: "Connect to see your
|
|
33358
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "
|
|
33372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium", children: "Connect to see your project" }),
|
|
33373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Paste the project code from the website. Only that project appears here until you disconnect." })
|
|
33359
33374
|
] }) : tesboConnected && projects.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center gap-3 py-16 text-center", children: [
|
|
33360
33375
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FolderKanban, { className: "size-8 text-muted-foreground" }),
|
|
33361
33376
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -33414,7 +33429,7 @@ function ProjectList() {
|
|
|
33414
33429
|
"Open ",
|
|
33415
33430
|
unlockFor.name
|
|
33416
33431
|
] }),
|
|
33417
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Paste this project's code from Agents → Atto
|
|
33432
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Paste this project's code from Agents → Atto. Prefer Disconnect and reconnect with the project code instead." }),
|
|
33418
33433
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "mt-4 grid gap-1 text-xs text-muted-foreground", children: [
|
|
33419
33434
|
"Project code",
|
|
33420
33435
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
package/out/renderer/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/>
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
10
10
|
<title>Tesbo Automate</title>
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-DmWkgJYG.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./assets/index-DyJdhPcb.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
// Global install: download Electron (if incomplete) + Playwright Chromium together,
|
|
3
|
+
// same as the original setup flow — finish install with binaries ready.
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const { createRequire } = require("node:module");
|
|
6
|
+
const fs = require("node:fs");
|
|
7
|
+
const path = require("node:path");
|
|
8
|
+
|
|
9
|
+
if (process.env.npm_config_global !== "true") {
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const pkgRoot = path.join(__dirname, "..");
|
|
14
|
+
const requireFromPackage = createRequire(path.join(pkgRoot, "package.json"));
|
|
15
|
+
|
|
16
|
+
function electronLooksReady(electronPkgDir) {
|
|
17
|
+
const pathFile = path.join(electronPkgDir, "path.txt");
|
|
18
|
+
if (!fs.existsSync(pathFile)) return false;
|
|
19
|
+
const rel = fs.readFileSync(pathFile, "utf8").trim();
|
|
20
|
+
if (!rel) return false;
|
|
21
|
+
const binary = path.join(electronPkgDir, "dist", rel);
|
|
22
|
+
try {
|
|
23
|
+
const st = fs.statSync(binary);
|
|
24
|
+
return st.isFile() && st.size > 1_000_000;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ensureElectron() {
|
|
31
|
+
let electronPkgDir;
|
|
32
|
+
try {
|
|
33
|
+
electronPkgDir = path.dirname(requireFromPackage.resolve("electron/package.json"));
|
|
34
|
+
} catch {
|
|
35
|
+
console.warn("[atto] Electron package missing. Re-run: npm install -g @qablehq/atto");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (electronLooksReady(electronPkgDir)) {
|
|
39
|
+
console.log("[atto] Electron ready.");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
console.log("[atto] Downloading Electron binary...");
|
|
43
|
+
const installJs = path.join(electronPkgDir, "install.js");
|
|
44
|
+
if (!fs.existsSync(installJs)) {
|
|
45
|
+
console.warn("[atto] Electron install.js missing.");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const result = spawnSync(process.execPath, [installJs], { stdio: "inherit" });
|
|
49
|
+
if (result.status !== 0 || !electronLooksReady(electronPkgDir)) {
|
|
50
|
+
console.warn("[atto] Electron download did not finish. Opening Atto will retry once.");
|
|
51
|
+
} else {
|
|
52
|
+
console.log("[atto] Electron ready.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function ensureChromium() {
|
|
57
|
+
let cliPath;
|
|
58
|
+
try {
|
|
59
|
+
cliPath = requireFromPackage.resolve("playwright/cli");
|
|
60
|
+
} catch {
|
|
61
|
+
console.warn("[atto] Playwright is not installed. The app will download Chromium on the first test.");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
console.log("[atto] Downloading Chromium...");
|
|
65
|
+
const result = spawnSync(process.execPath, [cliPath, "install", "chromium"], { stdio: "inherit" });
|
|
66
|
+
if (result.status !== 0) {
|
|
67
|
+
console.warn("[atto] Chromium download did not finish. The app will try again on the first test.");
|
|
68
|
+
} else {
|
|
69
|
+
console.log("[atto] Chromium ready.");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ensureElectron();
|
|
74
|
+
ensureChromium();
|
|
6
75
|
process.exit(0);
|