@divergeai/cli 0.1.4 → 0.1.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.
Files changed (2) hide show
  1. package/dist/diverge.mjs +9 -3
  2. package/package.json +1 -1
package/dist/diverge.mjs CHANGED
@@ -7387,7 +7387,7 @@ import path10 from "node:path";
7387
7387
  import { parseArgs } from "node:util";
7388
7388
 
7389
7389
  // src/version.ts
7390
- var VERSION = true ? "0.1.4" : "dev";
7390
+ var VERSION = true ? "0.1.6" : "dev";
7391
7391
  var USER_AGENT = `diverge/${VERSION}`;
7392
7392
 
7393
7393
  // src/http.ts
@@ -7441,7 +7441,13 @@ function openerCommand(url, env = process.env, platform = process.platform) {
7441
7441
  if (custom) return { command: custom, args: [url] };
7442
7442
  if (platform === "darwin") return { command: "open", args: [url] };
7443
7443
  if (platform === "win32") {
7444
- return { command: "cmd", args: ["/c", "start", '""', `"${url.replace(/&/g, "^&")}"`], windowsVerbatimArguments: true };
7444
+ const root = env.SYSTEMROOT || env.windir || "C:\\Windows";
7445
+ const script = `Start-Process -FilePath '${url.replace(/'/g, "''")}'`;
7446
+ return {
7447
+ command: `${root}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,
7448
+ args: ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")],
7449
+ windowsVerbatimArguments: true
7450
+ };
7445
7451
  }
7446
7452
  return { command: "xdg-open", args: [url] };
7447
7453
  }
@@ -8488,7 +8494,7 @@ async function runLogin(args, io) {
8488
8494
  const remaining = Math.max(0, Math.round(bound.token.expires_at - Date.now() / 1e3));
8489
8495
  io.stdout(`Logged in to ${apiUrl}; token cached (${remaining}s to expiry, auto-refreshes).`);
8490
8496
  writeConfig({ ...readConfig(io.env), account: info.email, scopes, organization: bound.organizationId }, io.env);
8491
- const granted = new Set(claims.scopes ?? []);
8497
+ const granted = new Set(tokenClaims(bound.token.access_token).scopes ?? []);
8492
8498
  const missing = scopes.split(" ").filter((scope) => scope && !granted.has(scope));
8493
8499
  if (missing.length) io.stderr(`Not granted at this organization (your roles lack them): ${missing.join(" ")}`);
8494
8500
  return 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divergeai/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Divergent platform CLI: sign in, wire coding agents to the inference gateway, call platform tools",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",