@slock-ai/computer 0.0.30 → 0.0.34

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -29724,7 +29724,7 @@ var ComputerAttachClient = class {
29724
29724
  };
29725
29725
  }
29726
29726
  if (res.status === 401) return { status: "error", code: "session_invalid" };
29727
- if (res.status === 403) return { status: "not_authorized" };
29727
+ if (res.status === 403) return code === "requires_admin" ? { status: "requires_admin" } : { status: "not_authorized" };
29728
29728
  if (res.status === 404) {
29729
29729
  if (code === "not_authorized" || code === "server_not_found") return { status: "server_not_found" };
29730
29730
  if (!code || code === "computer_attach_disabled") return { status: "disabled" };
@@ -29768,7 +29768,7 @@ var ComputerAttachClient = class {
29768
29768
  if (res.status === 409 && code === "legacy_machine_key_migrated") {
29769
29769
  return { status: "legacy_machine_key_migrated" };
29770
29770
  }
29771
- if (res.status === 403) return { status: "not_authorized" };
29771
+ if (res.status === 403) return code === "requires_admin" ? { status: "requires_admin" } : { status: "not_authorized" };
29772
29772
  if (res.status === 404) return { status: "disabled" };
29773
29773
  if (!code) return { status: "unexpected_response", httpStatus: res.status };
29774
29774
  return { status: "error", code };
@@ -29813,7 +29813,7 @@ var ComputerAttachClient = class {
29813
29813
  if (res.status === 409 && code === "legacy_machine_key_migrated") {
29814
29814
  return { status: "legacy_machine_key_migrated" };
29815
29815
  }
29816
- if (res.status === 403) return { status: "not_authorized" };
29816
+ if (res.status === 403) return code === "requires_admin" ? { status: "requires_admin" } : { status: "not_authorized" };
29817
29817
  if (res.status === 404) return { status: "disabled" };
29818
29818
  if (!code) return { status: "unexpected_response", httpStatus: res.status };
29819
29819
  return { status: "error", code };
@@ -30381,6 +30381,12 @@ async function attach(input, options = {}) {
30381
30381
  "Not authorized to attach to that server. Check the server slug and that you're a member."
30382
30382
  );
30383
30383
  }
30384
+ if (attached.status === "requires_admin") {
30385
+ throw new ComputerServiceError(
30386
+ "ATTACH_REQUIRES_ADMIN",
30387
+ "Attaching a Computer requires the admin or owner role on this server. You are a member, but only admins/owners can attach \u2014 ask a server admin to attach this Computer or to grant you the admin role."
30388
+ );
30389
+ }
30384
30390
  if (attached.status === "server_not_found") {
30385
30391
  throw new ComputerServiceError(
30386
30392
  "ATTACH_SERVER_NOT_FOUND",
@@ -30827,6 +30833,13 @@ async function completeAdoptionExchange(input, options) {
30827
30833
  "Not authorized to adopt this machine on this server. Check that you are a current member."
30828
30834
  );
30829
30835
  }
30836
+ if (result.status === "requires_admin") {
30837
+ await appendAdoptionFailureLog(slockHome, log, startedAt, "requires_admin");
30838
+ throw new ComputerServiceError(
30839
+ "ADOPT_REQUIRES_ADMIN",
30840
+ "Adopting a legacy machine into a Computer requires the admin or owner role on this server. You are a member, but holding the legacy machine key is not enough \u2014 ask a server admin to adopt it or to grant you the admin role."
30841
+ );
30842
+ }
30830
30843
  if (result.status === "unexpected_response") {
30831
30844
  await appendAdoptionFailureLog(
30832
30845
  slockHome,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slock-ai/computer",
3
- "version": "0.0.30",
3
+ "version": "0.0.34",
4
4
  "description": "Slock Computer — standalone human/local-machine control-plane CLI (login + attach). Distinct from the agent-facing @slock-ai/cli.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "commander": "^12.1.0",
29
29
  "proper-lockfile": "^4.1.2",
30
30
  "undici": "^7.24.7",
31
- "@slock-ai/daemon": "0.57.1"
31
+ "@slock-ai/daemon": "0.57.4"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^25.5.0",