@agentis-hq/cli 0.3.0 → 0.3.2

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 +7 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -165,8 +165,12 @@ async function login() {
165
165
  `);
166
166
  openBrowser(authorizeUrl.toString());
167
167
  console.log("Waiting for authorization...");
168
+ let timeoutId;
168
169
  const timeout = new Promise((_, reject) => {
169
- setTimeout(() => reject(new Error("Login timed out. Run `agentis login` again.")), 10 * 60 * 1e3);
170
+ timeoutId = setTimeout(
171
+ () => reject(new Error("Login timed out. Run `agentis login` again.")),
172
+ 10 * 60 * 1e3
173
+ );
170
174
  });
171
175
  try {
172
176
  const result = await Promise.race([callback, timeout]);
@@ -201,6 +205,7 @@ async function login() {
201
205
  ${error instanceof Error ? error.message : "Login failed"}`);
202
206
  process.exitCode = 1;
203
207
  } finally {
208
+ if (timeoutId) clearTimeout(timeoutId);
204
209
  server.stop(true);
205
210
  }
206
211
  }
@@ -885,7 +890,7 @@ async function policySet(nameOrId, args2) {
885
890
  const hosted = token ? await findHostedAgent2(nameOrId, token) : null;
886
891
  if (hosted && token) {
887
892
  const policy = applyPolicyFlags(hosted.policy, args2);
888
- const res = await apiFetch(`/agents/${hosted.id}`, {
893
+ const res = await apiFetch(`/agents/${hosted.id}/policy`, {
889
894
  method: "PATCH",
890
895
  body: JSON.stringify({ policy })
891
896
  }, token);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentis-hq/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "agentis": "dist/index.js"