@getdial/cli 0.33.0 → 0.33.1

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.
@@ -3,6 +3,17 @@ function humanRender(r) {
3
3
  const lines = [];
4
4
  lines.push(`dial ${r.cli.version} (node ${r.cli.node})`);
5
5
  lines.push(`backend: ${r.backend.url} ${r.backend.reachable ? `reachable${r.backend.latencyMs != null ? ` (${r.backend.latencyMs}ms)` : ""}` : "UNREACHABLE"}`);
6
+ if (r.sandbox) {
7
+ // Sandbox: no local key — the gateway injects credentials. Don't say "not
8
+ // signed in" (misleading) or surface pending-otp/listen (all disabled here).
9
+ lines.push(`mode: sandbox (credentials injected by the gateway)`);
10
+ lines.push(`auth: ${r.auth.keyValid ? "credential connected via the gateway" : "no valid Dial credential connected in the vault"}`);
11
+ lines.push("");
12
+ lines.push(r.nextStep === "ready"
13
+ ? "next: ready"
14
+ : "next: connect the Dial credential in your gateway/vault (this agent has none)");
15
+ return lines.join("\n");
16
+ }
6
17
  if (r.auth.signedIn) {
7
18
  lines.push(`auth: signed in as ${r.auth.email} (account ${r.auth.accountId}, key sk_live_***${r.auth.apiKeyFingerprint})${r.auth.keyValid === false ? " [key rejected by backend]" : ""}`);
8
19
  }
package/dist/lib/api.js CHANGED
@@ -1,6 +1,16 @@
1
- import { request, fetch as undiciFetch, FormData as UndiciFormData } from "undici";
1
+ import { request, fetch as undiciFetch, FormData as UndiciFormData, setGlobalDispatcher, EnvHttpProxyAgent } from "undici";
2
2
  import { logger } from "./log.js";
3
3
  import { VERSION } from "./version.js";
4
+ // Route this package's undici requests through HTTP(S)_PROXY when one is set.
5
+ // The `undici` npm package keeps its OWN global dispatcher, which — unlike
6
+ // Node's built-in fetch (wired by NODE_USE_ENV_PROXY) — ignores the proxy env
7
+ // vars. In a proxied environment (e.g. the NanoClaw agent sandbox, where the
8
+ // OneCLI gateway sits on HTTPS_PROXY and injects the Authorization header for
9
+ // api.getdial.ai) our `request()`/`fetch()` calls would otherwise bypass the
10
+ // gateway entirely and go out UNAUTHENTICATED → 401. Opt in explicitly.
11
+ if (process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy) {
12
+ setGlobalDispatcher(new EnvHttpProxyAgent());
13
+ }
4
14
  // The bundled undici only multipart-encodes its own FormData class (realm
5
15
  // check) — Node's global FormData would be coerced to a text/plain string.
6
16
  export { UndiciFormData as ApiFormData };
@@ -4,11 +4,36 @@ import { supervisorStatus, lastEventAtFromLog, supervisorAvailability } from "..
4
4
  import { paths } from "../paths.js";
5
5
  import { VERSION } from "../version.js";
6
6
  import { installSkill, isSupportedAgent, SUPPORTED_AGENTS } from "../skill-install.js";
7
+ import { isSandbox } from "../sandbox.js";
7
8
  import { DialError } from "./errors.js";
8
9
  const OTP_EXPIRY_MS = 10 * 60 * 1000;
9
10
  const PENDING_FRESH_MS = 10 * 60 * 1000;
10
11
  export async function accountStatus() {
11
12
  const ping = await pingBackend();
13
+ if (isSandbox()) {
14
+ // No local auth file in a sandbox — the gateway injects the credential.
15
+ // Probe keyless (the proxy adds the Authorization header) to report whether
16
+ // the credential is actually connected in the vault. Never suggest
17
+ // signup/onboard/listen here — those are disabled in a sandbox.
18
+ const probe = await apiGet("/api/v1/account");
19
+ const connected = probe.ok;
20
+ return {
21
+ cli: { version: VERSION, node: process.versions.node },
22
+ backend: { url: baseUrl(), reachable: ping.reachable, latencyMs: ping.latencyMs },
23
+ auth: {
24
+ signedIn: connected,
25
+ email: null,
26
+ accountId: null,
27
+ apiKeyPresent: connected,
28
+ apiKeyFingerprint: null,
29
+ keyValid: connected,
30
+ },
31
+ pendingOtp: { verificationId: null, ageSeconds: null, expired: null },
32
+ listen: { installed: false, running: false, lastEventAt: null },
33
+ sandbox: true,
34
+ nextStep: connected ? "ready" : "connect_credential",
35
+ };
36
+ }
12
37
  const auth = readAuth();
13
38
  const pending = readPendingSignup();
14
39
  let keyValid = null;
@@ -61,6 +86,7 @@ export async function accountStatus() {
61
86
  expired: pendingExpired,
62
87
  },
63
88
  listen: listenState,
89
+ sandbox: false,
64
90
  nextStep,
65
91
  };
66
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getdial/cli",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "Dial CLI — install, sign up, and run the local listen service.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/skills.tar.gz CHANGED
Binary file