@vavio/cli 0.1.2 → 0.1.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/dist/vavio.mjs +12 -5
- package/package.json +1 -1
package/dist/vavio.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/cli
|
|
|
10
10
|
|
|
11
11
|
// src/constants.ts
|
|
12
12
|
var CLI_NAME = "@vavio/cli";
|
|
13
|
-
var CLI_VERSION = "0.1.
|
|
13
|
+
var CLI_VERSION = "0.1.3";
|
|
14
14
|
var CONTRACT_VERSION = 1;
|
|
15
15
|
var CONTRACT_HEADER = "Vavio-Contract";
|
|
16
16
|
var CONTRACT_MIN_HEADER = "Vavio-Contract-Min";
|
|
@@ -728,6 +728,10 @@ function table(rows) {
|
|
|
728
728
|
return rows.map((row) => row.map((cell, i) => i === row.length - 1 ? cell : cell.padEnd(widths[i])).join(" ")).join("\n");
|
|
729
729
|
}
|
|
730
730
|
var str = (value) => value === null || value === void 0 ? "-" : String(value);
|
|
731
|
+
function workspaceDisplayName(workspace) {
|
|
732
|
+
const raw = typeof workspace?.name === "string" ? workspace.name.replace(/\s+/g, " ").trim() : "";
|
|
733
|
+
return raw && !/^workspace [0-9a-f]{8}$/i.test(raw) ? raw.slice(0, 80) : null;
|
|
734
|
+
}
|
|
731
735
|
function priceText(price) {
|
|
732
736
|
if (!price) return null;
|
|
733
737
|
const amount = typeof price.amount === "number" ? price.amount.toFixed(2) : str(price.amount);
|
|
@@ -743,7 +747,8 @@ function accountText(v) {
|
|
|
743
747
|
const instances = v.instances ?? [];
|
|
744
748
|
const offerings = v.offerings ?? [];
|
|
745
749
|
const ent = v.entitlements?.hermes ?? {};
|
|
746
|
-
const
|
|
750
|
+
const wsName = workspaceDisplayName(ws);
|
|
751
|
+
const lines = [`Workspace ${wsName ? `${wsName} (${str(ws.id)})` : str(ws.id)}`, `Role ${str(v.role)}`];
|
|
747
752
|
if (instances.length) {
|
|
748
753
|
lines.push(`Hermes ${instances.length === 1 ? "1 instance" : `${instances.length} instances`} (included ${str(ent.used)} of ${str(ent.granted)})`);
|
|
749
754
|
lines.push(indent(table([["ID", "ACCESS", "STATE", "ADDRESS"], ...instances.map((i) => [str(i.id), str(i.access), str(i.lifecycle_state), str(i.address)])])));
|
|
@@ -761,7 +766,10 @@ var FORMAT = {
|
|
|
761
766
|
account: accountText,
|
|
762
767
|
whoami(v) {
|
|
763
768
|
const ws = v.workspace ?? {};
|
|
764
|
-
|
|
769
|
+
const name = workspaceDisplayName(ws);
|
|
770
|
+
const role = typeof v.role === "string" && v.role ? v.role : null;
|
|
771
|
+
if (name) return `Signed in as the ${role ?? "member"} of workspace ${name} (${str(ws.id)}).`;
|
|
772
|
+
return `Signed in to Vavio${role ? ` as the workspace ${role}` : ""}.`;
|
|
765
773
|
},
|
|
766
774
|
instances(v) {
|
|
767
775
|
const rows = (v.instances ?? []).map((i) => [str(i.id), str(i.access), str(i.lifecycle_state), str(i.address)]);
|
|
@@ -968,8 +976,7 @@ async function cmdLogin(ctx) {
|
|
|
968
976
|
if (ctx.out.json) ctx.out.value(value);
|
|
969
977
|
else {
|
|
970
978
|
const where = store.kind === "file" ? "a private file" : store.kind === "keychain" ? "the macOS keychain" : "the Secret Service keyring";
|
|
971
|
-
const
|
|
972
|
-
const name = raw && !/^workspace [0-9a-f]{8}$/i.test(raw) ? raw.slice(0, 80) : null;
|
|
979
|
+
const name = workspaceDisplayName(workspace);
|
|
973
980
|
ctx.out.out(`Signed in to Vavio${name ? ` (workspace ${name})` : ""}. Saved in ${where}.`);
|
|
974
981
|
}
|
|
975
982
|
return EXIT.ok;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vavio/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "vavio: operate your Vavio account and Hermes instances from a terminal or your own AI assistant, over Vavio's MCP server.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://vavio.ai",
|