@helm-ai/cli 1.3.0 → 1.4.0

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/cli.js +19 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -25,7 +25,7 @@ function renderSplash(ctx) {
25
25
  }
26
26
 
27
27
  // src/version.ts
28
- var version = "1.3.0";
28
+ var version = "1.4.0";
29
29
 
30
30
  // src/commands/auth.ts
31
31
  import prompts from "prompts";
@@ -67,6 +67,16 @@ var HelmModuleDisabledError = class extends HelmError {
67
67
  }
68
68
  module;
69
69
  };
70
+ var HelmAccessDeniedError = class extends HelmError {
71
+ constructor(area, level, message) {
72
+ super(message);
73
+ this.area = area;
74
+ this.level = level;
75
+ this.name = "HelmAccessDeniedError";
76
+ }
77
+ area;
78
+ level;
79
+ };
70
80
  var HelmValidationError = class extends HelmError {
71
81
  constructor(message) {
72
82
  super(message);
@@ -81,6 +91,14 @@ var HelmNetworkError = class extends HelmError {
81
91
  };
82
92
  function parseApiError(status, body) {
83
93
  const errMsg = body?.error || body?.message || `Request failed with status ${status}`;
94
+ const accessMatch = errMsg.match(/^ACCESS_DENIED:(\w+):(\w+)(?: - (.*))?/s);
95
+ if (accessMatch) {
96
+ return new HelmAccessDeniedError(
97
+ accessMatch[1],
98
+ accessMatch[2],
99
+ accessMatch[3] || "You don't have access to that part of this workspace."
100
+ );
101
+ }
84
102
  if (status === 401 || status === 403) {
85
103
  return new HelmAuthError(errMsg);
86
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helm-ai/cli",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Command line interface for Helm",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",