@qablehq/atto 0.0.26 → 0.0.28
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
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Opens the built Atto desktop window. Installed as the `atto` command.
|
|
3
|
-
// If a silent update was queued on the previous quit,
|
|
4
|
-
|
|
3
|
+
// If a silent update was queued on the previous quit, kick it off in the
|
|
4
|
+
// background — never block the window on npm install.
|
|
5
|
+
const { spawn } = require("node:child_process");
|
|
5
6
|
const fs = require("node:fs");
|
|
6
7
|
const os = require("node:os");
|
|
7
8
|
const path = require("node:path");
|
|
8
9
|
|
|
9
10
|
const PENDING_FILE = path.join(os.homedir(), ".atto", "pending-npm-update.json");
|
|
10
11
|
|
|
11
|
-
function
|
|
12
|
+
function kickPendingSilentUpdate() {
|
|
12
13
|
let pending;
|
|
13
14
|
try {
|
|
14
15
|
pending = JSON.parse(fs.readFileSync(PENDING_FILE, "utf8"));
|
|
@@ -28,22 +29,26 @@ function applyPendingSilentUpdate() {
|
|
|
28
29
|
const args = ["install", "-g", `${pending.name}@${pending.version}`, "--silent", "--no-fund", "--no-audit"];
|
|
29
30
|
if (pending.prefix) args.push("--prefix", pending.prefix);
|
|
30
31
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
// Fire-and-forget: this session keeps the current build; next `atto` gets the update.
|
|
33
|
+
// Do not wait — spawnSync here used to delay open by minutes on slow networks.
|
|
34
|
+
try {
|
|
35
|
+
const child = spawn(npm, args, {
|
|
36
|
+
detached: true,
|
|
37
|
+
stdio: "ignore",
|
|
38
|
+
windowsHide: true,
|
|
39
|
+
});
|
|
40
|
+
child.unref();
|
|
38
41
|
try {
|
|
39
42
|
fs.unlinkSync(PENDING_FILE);
|
|
40
43
|
} catch {
|
|
41
44
|
/* ignore */
|
|
42
45
|
}
|
|
46
|
+
} catch {
|
|
47
|
+
/* keep pending file for next open */
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
kickPendingSilentUpdate();
|
|
47
52
|
|
|
48
53
|
let electronPath;
|
|
49
54
|
try {
|
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,6 +12708,15 @@ function setupAutoUpdater() {
|
|
|
12699
12708
|
});
|
|
12700
12709
|
}
|
|
12701
12710
|
registerMediaProtocolScheme();
|
|
12711
|
+
function warmChromiumInBackground() {
|
|
12712
|
+
const check = chromiumExecutable();
|
|
12713
|
+
if (check.available) return;
|
|
12714
|
+
console.log("[atto] Chromium missing — downloading in background");
|
|
12715
|
+
void installChromium().then((result) => {
|
|
12716
|
+
if (result.ok) console.log("[atto] Chromium ready");
|
|
12717
|
+
else console.warn("[atto] Chromium download failed:", result.error);
|
|
12718
|
+
});
|
|
12719
|
+
}
|
|
12702
12720
|
function createMainWindow() {
|
|
12703
12721
|
const mainWindow = new electron.BrowserWindow({
|
|
12704
12722
|
width: 1320,
|
|
@@ -12732,6 +12750,8 @@ function createMainWindow() {
|
|
|
12732
12750
|
}
|
|
12733
12751
|
electron.app.whenReady().then(() => {
|
|
12734
12752
|
registerMediaProtocol();
|
|
12753
|
+
createMainWindow();
|
|
12754
|
+
warmChromiumInBackground();
|
|
12735
12755
|
const engine = process.env.TAA_ENGINE === "mock" ? new MockFixturePlayer() : new RealEngine();
|
|
12736
12756
|
registerIpcHandlers(engine);
|
|
12737
12757
|
electron.app.on("before-quit", () => {
|
|
@@ -12743,7 +12763,6 @@ electron.app.whenReady().then(() => {
|
|
|
12743
12763
|
registerProjectFilesHandlers();
|
|
12744
12764
|
registerAppStateHandlers();
|
|
12745
12765
|
registerTesboHandlers(engine);
|
|
12746
|
-
createMainWindow();
|
|
12747
12766
|
setupAutoUpdater();
|
|
12748
12767
|
electron.app.on("activate", () => {
|
|
12749
12768
|
if (electron.BrowserWindow.getAllWindows().length === 0) createMainWindow();
|
|
@@ -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,25 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const path = require("node:path");
|
|
7
|
-
|
|
8
|
-
if (process.env.npm_config_global !== "true") {
|
|
9
|
-
process.exit(0);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const requireFromPackage = createRequire(path.join(__dirname, "..", "package.json"));
|
|
13
|
-
let cliPath;
|
|
14
|
-
try {
|
|
15
|
-
cliPath = requireFromPackage.resolve("playwright/cli");
|
|
16
|
-
} catch {
|
|
17
|
-
console.warn("[atto] Playwright is not installed. The app will download Chromium on the first test.");
|
|
18
|
-
process.exit(0);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const result = spawnSync(process.execPath, [cliPath, "install", "chromium"], { stdio: "inherit" });
|
|
22
|
-
if (result.status !== 0) {
|
|
23
|
-
console.warn("[atto] Chromium download did not finish. The app will try again on the first test.");
|
|
24
|
-
}
|
|
2
|
+
// Intentionally a no-op on npm install.
|
|
3
|
+
// Chromium is large; downloading it during `npm install -g` makes first setup feel stuck.
|
|
4
|
+
// The desktop app fetches Chromium in the background after the window opens (and again
|
|
5
|
+
// before the first browser session if needed).
|
|
25
6
|
process.exit(0);
|