@qablehq/atto 0.0.5 → 0.0.6

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.
@@ -33024,6 +33024,7 @@ function CreateProjectDialog({ open, onOpenChange, onCreated }) {
33024
33024
  }
33025
33025
  );
33026
33026
  }
33027
+ const REFRESH_MS = 5e3;
33027
33028
  const STATUS_LABEL$1 = {
33028
33029
  active: "Active",
33029
33030
  inactive: "Inactive",
@@ -33036,16 +33037,33 @@ function TesboPanel() {
33036
33037
  const [formError, setFormError] = reactExports.useState(null);
33037
33038
  const [projectId, setProjectId] = reactExports.useState("");
33038
33039
  const [agents, setAgents] = reactExports.useState(null);
33040
+ const statusRef = reactExports.useRef(null);
33041
+ const refreshGeneration = reactExports.useRef(0);
33039
33042
  reactExports.useEffect(() => {
33040
33043
  let cancelled = false;
33041
- void window.taa.tesbo.status().then((next) => {
33042
- if (cancelled) return;
33044
+ const apply = (next, stamp) => {
33045
+ if (cancelled || stamp !== refreshGeneration.current) return;
33046
+ const offline = !next.connected && next.error === "Could not reach Tesbo.";
33047
+ if (offline && statusRef.current?.connected) return;
33048
+ statusRef.current = next;
33043
33049
  setStatus(next);
33044
- setProjectId(next.projects[0]?.id ?? "");
33050
+ setProjectId(
33051
+ (current) => next.projects.some((project) => project.id === current) ? current : next.projects[0]?.id ?? ""
33052
+ );
33053
+ if (!next.connected) setAgents(null);
33045
33054
  if (next.error) setFormError(next.error);
33046
- });
33055
+ };
33056
+ const refresh = () => {
33057
+ const stamp = refreshGeneration.current;
33058
+ void window.taa.tesbo.status().then((next) => apply(next, stamp));
33059
+ };
33060
+ refresh();
33061
+ const timer = window.setInterval(refresh, REFRESH_MS);
33062
+ window.addEventListener("focus", refresh);
33047
33063
  return () => {
33048
33064
  cancelled = true;
33065
+ window.clearInterval(timer);
33066
+ window.removeEventListener("focus", refresh);
33049
33067
  };
33050
33068
  }, []);
33051
33069
  reactExports.useEffect(() => {
@@ -33069,7 +33087,9 @@ function TesboPanel() {
33069
33087
  setBusy(true);
33070
33088
  setFormError(null);
33071
33089
  try {
33090
+ refreshGeneration.current += 1;
33072
33091
  const next = await window.taa.tesbo.login({ code });
33092
+ statusRef.current = next;
33073
33093
  setStatus(next);
33074
33094
  setCode("");
33075
33095
  setProjectId(next.projects[0]?.id ?? "");
@@ -33084,7 +33104,9 @@ function TesboPanel() {
33084
33104
  setBusy(true);
33085
33105
  setFormError(null);
33086
33106
  try {
33107
+ refreshGeneration.current += 1;
33087
33108
  const next = await window.taa.tesbo.logout();
33109
+ statusRef.current = next;
33088
33110
  setStatus(next);
33089
33111
  setAgents(null);
33090
33112
  setProjectId("");
@@ -33126,7 +33148,7 @@ function TesboPanel() {
33126
33148
  ]
33127
33149
  }
33128
33150
  ) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 grid gap-3", children: [
33129
- status.projects.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "No project is turned on for this code. It will appear here the next time Atto opens after it is turned on." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "grid max-w-md gap-1 text-xs text-muted-foreground", children: [
33151
+ status.projects.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground", children: "No project is turned on for this code. It appears here when the project is turned on." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "grid max-w-md gap-1 text-xs text-muted-foreground", children: [
33130
33152
  "Project",
33131
33153
  /* @__PURE__ */ jsxRuntimeExports.jsx(
33132
33154
  "select",
@@ -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-Dbnqlx4f.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-BMItL8CR.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="./assets/index-CKtSvvUQ.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.5",
3
+ "version": "0.0.6",
4
4
  "description": "Atto — AI-assisted desktop test automation",
5
5
  "homepage": "https://github.com/QAbleHQ/Atto",
6
6
  "author": {