@vm0/cli 9.83.2 → 9.83.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.83.2",
3
+ "version": "9.83.3",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",
package/zero.js CHANGED
@@ -9,7 +9,6 @@ import {
9
9
  createZeroAgent,
10
10
  createZeroComputerConnector,
11
11
  createZeroConnectorSession,
12
- decodeCliTokenPayload,
13
12
  decodeZeroTokenPayload,
14
13
  deleteZeroAgent,
15
14
  deleteZeroComputerConnector,
@@ -82,7 +81,7 @@ import {
82
81
  updateZeroUserPreferences,
83
82
  upsertZeroOrgModelProvider,
84
83
  withErrorHandler
85
- } from "./chunk-37AJL4NM.js";
84
+ } from "./chunk-IFUYTPFH.js";
86
85
 
87
86
  // src/zero.ts
88
87
  import { Command as Command55 } from "commander";
@@ -129,16 +128,10 @@ var setCommand = new Command2().name("set").description("Rename your organizatio
129
128
  );
130
129
  }
131
130
  const org = await updateZeroOrg({ slug, force: true });
132
- const token = await getToken();
133
- if (decodeCliTokenPayload(token)) {
134
- const result = await switchZeroOrg(org.slug);
135
- await saveConfig({
136
- token: result.access_token,
137
- activeOrg: result.org_slug
138
- });
139
- } else {
140
- await saveConfig({ activeOrg: org.slug });
141
- }
131
+ const result = await switchZeroOrg(org.slug);
132
+ await saveConfig({
133
+ token: result.access_token
134
+ });
142
135
  console.log(chalk2.green(`\u2713 Organization updated to ${org.slug}`));
143
136
  console.log();
144
137
  console.log("Your agents will now be namespaced as:");
@@ -182,16 +175,10 @@ var useCommand = new Command4().name("use").description("Switch to a different o
182
175
  if (!target) {
183
176
  throw new Error(`Organization '${slug}' not found or not accessible.`);
184
177
  }
185
- const token = await getToken();
186
- if (decodeCliTokenPayload(token)) {
187
- const result = await switchZeroOrg(slug);
188
- await saveConfig({
189
- token: result.access_token,
190
- activeOrg: result.org_slug
191
- });
192
- } else {
193
- await saveConfig({ activeOrg: slug });
194
- }
178
+ const result = await switchZeroOrg(slug);
179
+ await saveConfig({
180
+ token: result.access_token
181
+ });
195
182
  console.log(chalk4.green(`\u2713 Switched to organization: ${slug}`));
196
183
  })
197
184
  );
@@ -244,7 +231,7 @@ var leaveCommand = new Command8().name("leave").description("Leave the current o
244
231
  await leaveZeroOrg();
245
232
  const { orgs } = await listZeroOrgs();
246
233
  if (orgs.length === 0) {
247
- await saveConfig({ activeOrg: void 0, token: void 0 });
234
+ await saveConfig({ token: void 0 });
248
235
  console.log(chalk8.green("\u2713 Left organization."));
249
236
  console.log(
250
237
  chalk8.yellow("No remaining organizations. Run: vm0 auth login")
@@ -252,16 +239,10 @@ var leaveCommand = new Command8().name("leave").description("Leave the current o
252
239
  return;
253
240
  }
254
241
  const nextOrg = orgs[0].slug;
255
- const token = await getToken();
256
- if (decodeCliTokenPayload(token)) {
257
- const result = await switchZeroOrg(nextOrg);
258
- await saveConfig({
259
- token: result.access_token,
260
- activeOrg: result.org_slug
261
- });
262
- } else {
263
- await saveConfig({ activeOrg: nextOrg });
264
- }
242
+ const result = await switchZeroOrg(nextOrg);
243
+ await saveConfig({
244
+ token: result.access_token
245
+ });
265
246
  console.log(chalk8.green(`\u2713 Left organization. Switched to: ${nextOrg}`));
266
247
  })
267
248
  );
@@ -2997,7 +2978,7 @@ function registerZeroCommands(prog, commands) {
2997
2978
  }
2998
2979
  }
2999
2980
  var program = new Command55();
3000
- program.name("zero").description("Zero CLI - Manage your zero platform").version("9.83.2");
2981
+ program.name("zero").description("Zero CLI - Manage your zero platform").version("9.83.3");
3001
2982
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
3002
2983
  configureGlobalProxyFromEnv();
3003
2984
  registerZeroCommands(program);