@qablehq/atto 0.0.27 → 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/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: link.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 list access code from Tesbo (Agents → Atto).");
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: link.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 list access code first.");
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.");
@@ -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 list code" }),
33159
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: status?.connected ? "List code linked. Click a project below and paste its project code to open it." : "Paste the list access code from Agents → Atto. That shows all projects; each project still needs its own project code to open." }),
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
- "List access code",
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: "atto_…",
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 ? "Projects appear after the list code. Click a project and paste its project code to open it." : "Paste your list access code from Agents → Atto to see projects." })
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 projects" }),
33358
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "After the list code, shared projects show up here. Opening still needs each project code." })
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 on the website. List code only shows projects; project code opens them." }),
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(
@@ -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-D6IRitH-.js"></script>
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,6 @@
1
1
  {
2
2
  "name": "@qablehq/atto",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Atto — AI-assisted desktop test automation",
5
5
  "homepage": "https://github.com/QAbleHQ/Atto",
6
6
  "author": {