berget 2.2.6 → 2.2.8

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 (145) hide show
  1. package/.github/workflows/publish.yml +2 -2
  2. package/.github/workflows/test.yml +10 -4
  3. package/.husky/pre-commit +1 -0
  4. package/.prettierignore +15 -0
  5. package/.prettierrc +7 -3
  6. package/CONTRIBUTING.md +38 -0
  7. package/README.md +2 -148
  8. package/dist/index.js +10 -11
  9. package/dist/package.json +30 -2
  10. package/dist/src/agents/app.js +28 -0
  11. package/dist/src/agents/backend.js +25 -0
  12. package/dist/src/agents/devops.js +34 -0
  13. package/dist/src/agents/frontend.js +25 -0
  14. package/dist/src/agents/fullstack.js +25 -0
  15. package/dist/src/agents/index.js +61 -0
  16. package/dist/src/agents/quality.js +70 -0
  17. package/dist/src/agents/security.js +26 -0
  18. package/dist/src/agents/types.js +2 -0
  19. package/dist/src/client.js +97 -117
  20. package/dist/src/commands/api-keys.js +75 -90
  21. package/dist/src/commands/auth.js +7 -16
  22. package/dist/src/commands/autocomplete.js +1 -1
  23. package/dist/src/commands/billing.js +6 -17
  24. package/dist/src/commands/chat.js +68 -101
  25. package/dist/src/commands/clusters.js +9 -18
  26. package/dist/src/commands/code/__tests__/auth-sync.test.js +351 -0
  27. package/dist/src/commands/code/__tests__/fake-api-key-service.js +13 -0
  28. package/dist/src/commands/code/__tests__/fake-auth-service.js +47 -0
  29. package/dist/src/commands/code/__tests__/fake-command-runner.js +21 -34
  30. package/dist/src/commands/code/__tests__/fake-file-store.js +20 -33
  31. package/dist/src/commands/code/__tests__/fake-prompter.js +83 -57
  32. package/dist/src/commands/code/__tests__/setup-flow.test.js +359 -92
  33. package/dist/src/commands/code/adapters/clack-prompter.js +15 -22
  34. package/dist/src/commands/code/adapters/fs-file-store.js +26 -40
  35. package/dist/src/commands/code/adapters/spawn-command-runner.js +27 -37
  36. package/dist/src/commands/code/auth-sync.js +270 -0
  37. package/dist/src/commands/code/errors.js +12 -9
  38. package/dist/src/commands/code/ports/auth-services.js +2 -0
  39. package/dist/src/commands/code/setup.js +387 -281
  40. package/dist/src/commands/code.js +205 -332
  41. package/dist/src/commands/index.js +5 -5
  42. package/dist/src/commands/models.js +6 -17
  43. package/dist/src/commands/users.js +5 -16
  44. package/dist/src/constants/command-structure.js +104 -104
  45. package/dist/src/services/api-key-service.js +132 -157
  46. package/dist/src/services/auth-service.js +89 -342
  47. package/dist/src/services/browser-auth.js +268 -0
  48. package/dist/src/services/chat-service.js +371 -401
  49. package/dist/src/services/cluster-service.js +47 -62
  50. package/dist/src/services/collaborator-service.js +10 -25
  51. package/dist/src/services/flux-service.js +14 -29
  52. package/dist/src/services/helm-service.js +10 -25
  53. package/dist/src/services/kubectl-service.js +16 -33
  54. package/dist/src/utils/config-checker.js +3 -3
  55. package/dist/src/utils/config-loader.js +95 -95
  56. package/dist/src/utils/default-api-key.js +124 -134
  57. package/dist/src/utils/env-manager.js +55 -66
  58. package/dist/src/utils/error-handler.js +20 -21
  59. package/dist/src/utils/logger.js +72 -65
  60. package/dist/src/utils/markdown-renderer.js +27 -27
  61. package/dist/src/utils/opencode-validator.js +63 -68
  62. package/dist/src/utils/token-manager.js +74 -45
  63. package/dist/tests/commands/chat.test.js +16 -25
  64. package/dist/tests/commands/code.test.js +95 -104
  65. package/dist/tests/utils/config-loader.test.js +48 -48
  66. package/dist/tests/utils/env-manager.test.js +43 -52
  67. package/dist/tests/utils/opencode-validator.test.js +22 -21
  68. package/dist/vitest.config.js +1 -1
  69. package/eslint.config.mjs +67 -0
  70. package/index.ts +35 -42
  71. package/package.json +30 -2
  72. package/src/agents/app.ts +27 -0
  73. package/src/agents/backend.ts +24 -0
  74. package/src/agents/devops.ts +33 -0
  75. package/src/agents/frontend.ts +24 -0
  76. package/src/agents/fullstack.ts +24 -0
  77. package/src/agents/index.ts +73 -0
  78. package/src/agents/quality.ts +69 -0
  79. package/src/agents/security.ts +26 -0
  80. package/src/agents/types.ts +17 -0
  81. package/src/client.ts +118 -152
  82. package/src/commands/api-keys.ts +241 -333
  83. package/src/commands/auth.ts +22 -27
  84. package/src/commands/autocomplete.ts +9 -9
  85. package/src/commands/billing.ts +20 -24
  86. package/src/commands/chat.ts +248 -338
  87. package/src/commands/clusters.ts +27 -26
  88. package/src/commands/code/__tests__/auth-sync.test.ts +482 -0
  89. package/src/commands/code/__tests__/fake-api-key-service.ts +13 -0
  90. package/src/commands/code/__tests__/fake-auth-service.ts +50 -0
  91. package/src/commands/code/__tests__/fake-command-runner.ts +45 -42
  92. package/src/commands/code/__tests__/fake-file-store.ts +32 -23
  93. package/src/commands/code/__tests__/fake-prompter.ts +116 -77
  94. package/src/commands/code/__tests__/setup-flow.test.ts +624 -268
  95. package/src/commands/code/adapters/clack-prompter.ts +53 -39
  96. package/src/commands/code/adapters/fs-file-store.ts +32 -27
  97. package/src/commands/code/adapters/spawn-command-runner.ts +38 -29
  98. package/src/commands/code/auth-sync.ts +329 -0
  99. package/src/commands/code/errors.ts +18 -18
  100. package/src/commands/code/ports/auth-services.ts +14 -0
  101. package/src/commands/code/ports/command-runner.ts +8 -4
  102. package/src/commands/code/ports/file-store.ts +5 -4
  103. package/src/commands/code/ports/prompter.ts +24 -18
  104. package/src/commands/code/setup.ts +570 -340
  105. package/src/commands/code.ts +338 -539
  106. package/src/commands/index.ts +20 -19
  107. package/src/commands/models.ts +28 -32
  108. package/src/commands/users.ts +15 -21
  109. package/src/constants/command-structure.ts +134 -157
  110. package/src/services/api-key-service.ts +105 -122
  111. package/src/services/auth-service.ts +99 -345
  112. package/src/services/browser-auth.ts +296 -0
  113. package/src/services/chat-service.ts +265 -299
  114. package/src/services/cluster-service.ts +42 -45
  115. package/src/services/collaborator-service.ts +14 -19
  116. package/src/services/flux-service.ts +23 -25
  117. package/src/services/helm-service.ts +19 -21
  118. package/src/services/kubectl-service.ts +17 -19
  119. package/src/types/api.d.ts +1905 -1907
  120. package/src/types/json.d.ts +2 -2
  121. package/src/utils/config-checker.ts +10 -10
  122. package/src/utils/config-loader.ts +162 -178
  123. package/src/utils/default-api-key.ts +114 -125
  124. package/src/utils/env-manager.ts +53 -57
  125. package/src/utils/error-handler.ts +61 -56
  126. package/src/utils/logger.ts +79 -73
  127. package/src/utils/markdown-renderer.ts +31 -31
  128. package/src/utils/opencode-validator.ts +85 -89
  129. package/src/utils/token-manager.ts +108 -87
  130. package/templates/agents/app.md +1 -0
  131. package/templates/agents/backend.md +1 -0
  132. package/templates/agents/devops.md +2 -0
  133. package/templates/agents/frontend.md +1 -0
  134. package/templates/agents/fullstack.md +1 -0
  135. package/templates/agents/quality.md +45 -40
  136. package/templates/agents/security.md +1 -0
  137. package/tests/commands/chat.test.ts +53 -62
  138. package/tests/commands/code.test.ts +265 -310
  139. package/tests/utils/config-loader.test.ts +189 -188
  140. package/tests/utils/env-manager.test.ts +110 -113
  141. package/tests/utils/opencode-validator.test.ts +52 -56
  142. package/tsconfig.json +4 -3
  143. package/vitest.config.ts +3 -3
  144. package/AGENTS.md +0 -374
  145. package/TODO.md +0 -19
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.ClusterService = void 0;
13
4
  const client_1 = require("../client");
@@ -17,74 +8,68 @@ const command_structure_1 = require("../constants/command-structure");
17
8
  * Command group: clusters
18
9
  */
19
10
  class ClusterService {
20
- constructor() {
21
- this.client = (0, client_1.createAuthenticatedClient)();
22
- }
11
+ // Command group name for this service
12
+ static COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.CLUSTERS;
13
+ // Subcommands for this service
14
+ static COMMANDS = command_structure_1.SUBCOMMANDS.CLUSTERS;
15
+ static instance;
16
+ client = (0, client_1.createAuthenticatedClient)();
17
+ constructor() { }
23
18
  static getInstance() {
24
19
  if (!ClusterService.instance) {
25
20
  ClusterService.instance = new ClusterService();
26
21
  }
27
22
  return ClusterService.instance;
28
23
  }
24
+ /**
25
+ * Get detailed information about a cluster
26
+ * Command: berget clusters describe
27
+ */
28
+ async describe(clusterId) {
29
+ try {
30
+ // This is a placeholder since the API doesn't have a specific endpoint
31
+ // In a real implementation, this would call a specific endpoint
32
+ const clusters = await this.list();
33
+ return clusters.find((cluster) => cluster.id === clusterId) || null;
34
+ }
35
+ catch (error) {
36
+ console.error('Failed to describe cluster:', error);
37
+ throw error;
38
+ }
39
+ }
29
40
  /**
30
41
  * Get resource usage for a cluster
31
42
  * Command: berget clusters get-usage
32
43
  */
33
- getUsage(clusterId) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- try {
36
- const { data, error } = yield this.client.GET('/v1/clusters/{clusterId}/usage', {
37
- params: { path: { clusterId } },
38
- });
39
- if (error)
40
- throw new Error(JSON.stringify(error));
41
- return data;
42
- }
43
- catch (error) {
44
- console.error('Failed to get cluster usage:', error);
45
- throw error;
46
- }
47
- });
44
+ async getUsage(clusterId) {
45
+ try {
46
+ const { data, error } = await this.client.GET('/v1/clusters/{clusterId}/usage', {
47
+ params: { path: { clusterId } },
48
+ });
49
+ if (error)
50
+ throw new Error(JSON.stringify(error));
51
+ return data;
52
+ }
53
+ catch (error) {
54
+ console.error('Failed to get cluster usage:', error);
55
+ throw error;
56
+ }
48
57
  }
49
58
  /**
50
59
  * List all clusters
51
60
  * Command: berget clusters list
52
61
  */
53
- list() {
54
- return __awaiter(this, void 0, void 0, function* () {
55
- try {
56
- const { data, error } = yield this.client.GET('/v1/clusters');
57
- if (error)
58
- throw new Error(JSON.stringify(error));
59
- return (data === null || data === void 0 ? void 0 : data.data) || [];
60
- }
61
- catch (error) {
62
- console.error('Failed to list clusters:', error);
63
- throw error;
64
- }
65
- });
66
- }
67
- /**
68
- * Get detailed information about a cluster
69
- * Command: berget clusters describe
70
- */
71
- describe(clusterId) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- try {
74
- // This is a placeholder since the API doesn't have a specific endpoint
75
- // In a real implementation, this would call a specific endpoint
76
- const clusters = yield this.list();
77
- return clusters.find((cluster) => cluster.id === clusterId) || null;
78
- }
79
- catch (error) {
80
- console.error('Failed to describe cluster:', error);
81
- throw error;
82
- }
83
- });
62
+ async list() {
63
+ try {
64
+ const { data, error } = await this.client.GET('/v1/clusters');
65
+ if (error)
66
+ throw new Error(JSON.stringify(error));
67
+ return data?.data || [];
68
+ }
69
+ catch (error) {
70
+ console.error('Failed to list clusters:', error);
71
+ throw error;
72
+ }
84
73
  }
85
74
  }
86
75
  exports.ClusterService = ClusterService;
87
- // Command group name for this service
88
- ClusterService.COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.CLUSTERS;
89
- // Subcommands for this service
90
- ClusterService.COMMANDS = command_structure_1.SUBCOMMANDS.CLUSTERS;
@@ -1,25 +1,18 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.CollaboratorService = void 0;
13
- const client_1 = require("../client");
14
4
  const command_structure_1 = require("../constants/command-structure");
15
5
  /**
16
6
  * Service for managing collaborators
17
7
  * Command group: users
18
8
  */
19
9
  class CollaboratorService {
20
- constructor() {
21
- this.client = (0, client_1.createAuthenticatedClient)();
22
- }
10
+ // Command group name for this service
11
+ static COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.USERS;
12
+ // Subcommands for this service
13
+ static COMMANDS = command_structure_1.SUBCOMMANDS.USERS;
14
+ static instance;
15
+ constructor() { }
23
16
  static getInstance() {
24
17
  if (!CollaboratorService.instance) {
25
18
  CollaboratorService.instance = new CollaboratorService();
@@ -31,24 +24,16 @@ class CollaboratorService {
31
24
  * Command: berget users invite
32
25
  * This endpoint is not available in the API
33
26
  */
34
- invite(clusterId, githubUsername) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- throw new Error('This functionality is not available in the API');
37
- });
27
+ async invite(_clusterId, _githubUsername) {
28
+ throw new Error('This functionality is not available in the API');
38
29
  }
39
30
  /**
40
31
  * List all collaborators
41
32
  * Command: berget users list
42
33
  * This endpoint is not available in the API
43
34
  */
44
- list(clusterId) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- throw new Error('This functionality is not available in the API');
47
- });
35
+ async list(_clusterId) {
36
+ throw new Error('This functionality is not available in the API');
48
37
  }
49
38
  }
50
39
  exports.CollaboratorService = CollaboratorService;
51
- // Command group name for this service
52
- CollaboratorService.COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.USERS;
53
- // Subcommands for this service
54
- CollaboratorService.COMMANDS = command_structure_1.SUBCOMMANDS.USERS;
@@ -1,25 +1,18 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.FluxService = void 0;
13
- const client_1 = require("../client");
14
4
  const command_structure_1 = require("../constants/command-structure");
15
5
  /**
16
6
  * Service for managing Flux CD
17
7
  * Command group: flux
18
8
  */
19
9
  class FluxService {
20
- constructor() {
21
- this.client = (0, client_1.createAuthenticatedClient)();
22
- }
10
+ // Command group name for this service
11
+ static COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.FLUX;
12
+ // Subcommands for this service
13
+ static COMMANDS = command_structure_1.SUBCOMMANDS.FLUX;
14
+ static instance;
15
+ constructor() { }
23
16
  static getInstance() {
24
17
  if (!FluxService.instance) {
25
18
  FluxService.instance = new FluxService();
@@ -27,28 +20,20 @@ class FluxService {
27
20
  return FluxService.instance;
28
21
  }
29
22
  /**
30
- * Install Flux CD
31
- * Command: berget flux install
23
+ * Bootstrap Flux CD
24
+ * Command: berget flux bootstrap
32
25
  * This endpoint is not available in the API
33
26
  */
34
- install(options) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- throw new Error('This functionality is not available in the API');
37
- });
27
+ async bootstrap(_options) {
28
+ throw new Error('This functionality is not available in the API');
38
29
  }
39
30
  /**
40
- * Bootstrap Flux CD
41
- * Command: berget flux bootstrap
31
+ * Install Flux CD
32
+ * Command: berget flux install
42
33
  * This endpoint is not available in the API
43
34
  */
44
- bootstrap(options) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- throw new Error('This functionality is not available in the API');
47
- });
35
+ async install(_options) {
36
+ throw new Error('This functionality is not available in the API');
48
37
  }
49
38
  }
50
39
  exports.FluxService = FluxService;
51
- // Command group name for this service
52
- FluxService.COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.FLUX;
53
- // Subcommands for this service
54
- FluxService.COMMANDS = command_structure_1.SUBCOMMANDS.FLUX;
@@ -1,25 +1,18 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.HelmService = void 0;
13
- const client_1 = require("../client");
14
4
  const command_structure_1 = require("../constants/command-structure");
15
5
  /**
16
6
  * Service for managing Helm charts
17
7
  * Command group: helm
18
8
  */
19
9
  class HelmService {
20
- constructor() {
21
- this.client = (0, client_1.createAuthenticatedClient)();
22
- }
10
+ // Command group name for this service
11
+ static COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.HELM;
12
+ // Subcommands for this service
13
+ static COMMANDS = command_structure_1.SUBCOMMANDS.HELM;
14
+ static instance;
15
+ constructor() { }
23
16
  static getInstance() {
24
17
  if (!HelmService.instance) {
25
18
  HelmService.instance = new HelmService();
@@ -31,24 +24,16 @@ class HelmService {
31
24
  * Command: berget helm add-repo
32
25
  * This endpoint is not available in the API
33
26
  */
34
- addRepo(options) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- throw new Error('This functionality is not available in the API');
37
- });
27
+ async addRepo(_options) {
28
+ throw new Error('This functionality is not available in the API');
38
29
  }
39
30
  /**
40
31
  * Install a Helm chart
41
32
  * Command: berget helm install
42
33
  * This endpoint is not available in the API
43
34
  */
44
- install(options) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- throw new Error('This functionality is not available in the API');
47
- });
35
+ async install(_options) {
36
+ throw new Error('This functionality is not available in the API');
48
37
  }
49
38
  }
50
39
  exports.HelmService = HelmService;
51
- // Command group name for this service
52
- HelmService.COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.HELM;
53
- // Subcommands for this service
54
- HelmService.COMMANDS = command_structure_1.SUBCOMMANDS.HELM;
@@ -1,25 +1,18 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.KubectlService = void 0;
13
- const client_1 = require("../client");
14
4
  const command_structure_1 = require("../constants/command-structure");
15
5
  /**
16
6
  * Service for managing Kubernetes resources
17
7
  * Command group: kubectl
18
8
  */
19
9
  class KubectlService {
20
- constructor() {
21
- this.client = (0, client_1.createAuthenticatedClient)();
22
- }
10
+ // Command group name for this service
11
+ static COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.KUBECTL;
12
+ // Subcommands for this service
13
+ static COMMANDS = command_structure_1.SUBCOMMANDS.KUBECTL;
14
+ static instance;
15
+ constructor() { }
23
16
  static getInstance() {
24
17
  if (!KubectlService.instance) {
25
18
  KubectlService.instance = new KubectlService();
@@ -27,38 +20,28 @@ class KubectlService {
27
20
  return KubectlService.instance;
28
21
  }
29
22
  /**
30
- * Create a Kubernetes namespace
31
- * Command: berget kubectl create-namespace
23
+ * Apply a Kubernetes configuration
24
+ * Command: berget kubectl apply
32
25
  * This endpoint is not available in the API
33
26
  */
34
- createNamespace(name) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- throw new Error('This functionality is not available in the API');
37
- });
27
+ async apply(_filename) {
28
+ throw new Error('This functionality is not available in the API');
38
29
  }
39
30
  /**
40
- * Apply a Kubernetes configuration
41
- * Command: berget kubectl apply
31
+ * Create a Kubernetes namespace
32
+ * Command: berget kubectl create-namespace
42
33
  * This endpoint is not available in the API
43
34
  */
44
- apply(filename) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- throw new Error('This functionality is not available in the API');
47
- });
35
+ async createNamespace(_name) {
36
+ throw new Error('This functionality is not available in the API');
48
37
  }
49
38
  /**
50
39
  * Get Kubernetes resources
51
40
  * Command: berget kubectl get
52
41
  * This endpoint is not available in the API
53
42
  */
54
- get(resource, namespace) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- throw new Error('This functionality is not available in the API');
57
- });
43
+ async get(_resource, _namespace) {
44
+ throw new Error('This functionality is not available in the API');
58
45
  }
59
46
  }
60
47
  exports.KubectlService = KubectlService;
61
- // Command group name for this service
62
- KubectlService.COMMAND_GROUP = command_structure_1.COMMAND_GROUPS.KUBECTL;
63
- // Subcommands for this service
64
- KubectlService.COMMANDS = command_structure_1.SUBCOMMANDS.KUBECTL;
@@ -24,8 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.checkBergetConfig = void 0;
27
- const fs = __importStar(require("fs"));
28
- const path = __importStar(require("path"));
27
+ const fs = __importStar(require("node:fs"));
28
+ const path = __importStar(require("node:path"));
29
29
  /**
30
30
  * Check for .bergetconfig file and handle cluster switching
31
31
  */
@@ -42,7 +42,7 @@ function checkBergetConfig() {
42
42
  console.log('');
43
43
  }
44
44
  }
45
- catch (error) {
45
+ catch {
46
46
  // Silently ignore errors reading config
47
47
  }
48
48
  }