@openma/cli 0.1.0-beta.2 → 0.1.0-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -175,6 +175,9 @@ async function authLogin(baseUrl, requestedTenant) {
175
175
  res.writeHead(200, { "Content-Type": "text/html" }).end(approvalPage("Signed in", "You can close this tab and return to your terminal."));
176
176
  clearTimeout(timeout);
177
177
  server.close();
178
+ if (typeof server.closeAllConnections === "function") {
179
+ server.closeAllConnections();
180
+ }
178
181
  resolve({ token, tenant, user, key_id });
179
182
  } catch (err) {
180
183
  res.writeHead(500).end();
@@ -203,12 +206,17 @@ async function authLogin(baseUrl, requestedTenant) {
203
206
  created_at: (/* @__PURE__ */ new Date()).toISOString()
204
207
  });
205
208
  console.log(`\u2713 Signed in as ${me.user?.email ?? me.user?.id}`);
206
- console.log(` Tenant : ${me.tenant.name || me.tenant.id} (${me.tenant.id})`);
209
+ console.log(` Tenant : ${displayTenantName(me.tenant)} (${me.tenant.id})`);
207
210
  console.log(` Stored : ${credentialsPath()}`);
208
211
  if (me.tenants.length > 1) {
209
212
  console.log(` ${me.tenants.length} tenants available \u2014 switch with: oma auth tenant use <id>`);
210
213
  }
211
214
  }
215
+ function displayTenantName(t) {
216
+ const trimmed = (t.name ?? "").trim();
217
+ if (!trimmed || trimmed === "'s workspace" || trimmed.startsWith("'s ")) return t.id;
218
+ return trimmed;
219
+ }
212
220
  function openBrowser(url) {
213
221
  try {
214
222
  const p = process.platform;
@@ -265,7 +273,7 @@ var commands = [
265
273
  console.log(`Base URL : ${config.baseUrl}`);
266
274
  console.log(`Source : ${config.source === "env" ? "OMA_API_KEY env var" : "stored credentials"}`);
267
275
  console.log(`User : ${me.user?.email ?? me.user?.id ?? "(unknown \u2014 legacy key without user_id)"}`);
268
- console.log(`Tenant : ${me.tenant.name || me.tenant.id} (${me.tenant.id})`);
276
+ console.log(`Tenant : ${displayTenantName(me.tenant)} (${me.tenant.id})`);
269
277
  if (me.tenants.length > 1) {
270
278
  console.log(`Available: ${me.tenants.map((t) => t.id).join(", ")}`);
271
279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openma/cli",
3
- "version": "0.1.0-beta.2",
3
+ "version": "0.1.0-beta.3",
4
4
  "description": "CLI for the openma managed agents platform",
5
5
  "type": "module",
6
6
  "bin": {