@autonoma-ai/planner 0.1.15 → 0.1.17

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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Autonoma so onboarding can continue.
6
6
 
7
7
  ## Usage
8
8
 
9
- Run it in your project root:
9
+ Requires **Node.js >= 22.13**. Run it in your project root:
10
10
 
11
11
  ```bash
12
12
  npx @autonoma-ai/planner@latest
package/dist/index.js CHANGED
@@ -168,7 +168,10 @@ function track(event, properties = {}) {
168
168
  // Only build a person profile when we have a real identity from the app,
169
169
  // so the CLI joins the existing funnel person instead of creating a new one.
170
170
  $process_person_profile: identity != null,
171
- cli_version: CLI_VERSION
171
+ cli_version: CLI_VERSION,
172
+ // Runtime version - lets us confirm/monitor Node-version-specific
173
+ // failures (e.g. the @clack `util.styleText` crash on Node < 22.13).
174
+ node_version: process.versions.node
172
175
  }
173
176
  });
174
177
  const promise = fetch(`${resolveHost()}/capture/`, {
@@ -281,9 +284,21 @@ function chainMessages(err) {
281
284
  }
282
285
  return parts.join(" \u2190 ").toLowerCase();
283
286
  }
287
+ function apiStatusOf(err) {
288
+ let cur = err;
289
+ for (let depth = 0; cur != null && depth < 10; depth++) {
290
+ if (APICallError.isInstance(cur)) return cur.statusCode;
291
+ if (RetryError.isInstance(cur)) {
292
+ cur = cur.lastError;
293
+ continue;
294
+ }
295
+ cur = cur instanceof Error ? cur.cause : void 0;
296
+ }
297
+ return void 0;
298
+ }
284
299
  function describeKnownError(err) {
285
300
  const msg = chainMessages(err);
286
- const status = APICallError.isInstance(err) ? err.statusCode : void 0;
301
+ const status = apiStatusOf(err);
287
302
  const looksLikeAuth = msg.includes("missing authentication header") || msg.includes("no auth credentials") || msg.includes("not authenticated") || msg.includes("unauthorized") || msg.includes("user not found") || status === 401 || status === 403;
288
303
  if (looksLikeAuth) {
289
304
  return {
@@ -309,6 +324,12 @@ function describeKnownError(err) {
309
324
  hint: "Wait a minute and re-run. If it persists, reach out to support."
310
325
  };
311
326
  }
327
+ if (status === 404 || status === 502 || status === 503 || msg.includes("llm_proxy_unconfigured")) {
328
+ return {
329
+ title: "The Autonoma planner service is temporarily unavailable.",
330
+ hint: "This is on our side, not your setup - retry in a minute, and contact support if it keeps happening. If you set a custom AUTONOMA_API_URL, confirm it points at a host running the planner."
331
+ };
332
+ }
312
333
  return void 0;
313
334
  }
314
335
  function supportReference(extra = {}) {
@@ -6860,6 +6881,34 @@ var init_test_generator = __esm({
6860
6881
 
6861
6882
  // src/index.ts
6862
6883
  init_esm_shims();
6884
+
6885
+ // src/core/ensure-node.ts
6886
+ init_esm_shims();
6887
+
6888
+ // src/core/node-version.ts
6889
+ init_esm_shims();
6890
+ var MIN_NODE = { major: 22, minor: 13 };
6891
+ function isSupportedNodeVersion(raw) {
6892
+ const parts = raw.split(".");
6893
+ const major = Number.parseInt(parts[0] ?? "", 10);
6894
+ const minor = Number.parseInt(parts[1] ?? "", 10);
6895
+ if (!Number.isFinite(major) || !Number.isFinite(minor)) return false;
6896
+ return major > MIN_NODE.major || major === MIN_NODE.major && minor >= MIN_NODE.minor;
6897
+ }
6898
+ function ensureSupportedNode() {
6899
+ const raw = process.versions.node;
6900
+ if (isSupportedNodeVersion(raw)) return;
6901
+ console.error(
6902
+ `\x1B[31mAutonoma Planner requires Node.js >= ${MIN_NODE.major}.${MIN_NODE.minor} - you're running v${raw}.\x1B[0m`
6903
+ );
6904
+ console.error("Please upgrade Node.js and re-run. See https://nodejs.org/en/download");
6905
+ process.exit(1);
6906
+ }
6907
+
6908
+ // src/core/ensure-node.ts
6909
+ ensureSupportedNode();
6910
+
6911
+ // src/index.ts
6863
6912
  import { readFile as readFile22, writeFile as writeFile13 } from "fs/promises";
6864
6913
  import { join as join30 } from "path";
6865
6914
  import * as p9 from "@clack/prompts";