@mtreeai/msapling-cli 2.3.6-beta.21 → 2.3.6-beta.22
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/index.js +39 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -171,15 +171,20 @@ var init_src = __esm({
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
async me() {
|
|
174
|
-
const
|
|
174
|
+
const [overviewData, billingData] = await Promise.all([
|
|
175
|
+
this.request("/api/projects/overview"),
|
|
176
|
+
this.request("/api/billing/settings").catch(() => null)
|
|
177
|
+
]);
|
|
178
|
+
const data = overviewData;
|
|
179
|
+
const fuel = billingData?.fuel ?? {};
|
|
175
180
|
return {
|
|
176
181
|
user: {
|
|
177
182
|
id: data.user_id,
|
|
178
183
|
email: data.email,
|
|
179
|
-
tier: data.tier,
|
|
184
|
+
tier: billingData?.tier ?? data.tier,
|
|
180
185
|
is_pro: data.is_pro,
|
|
181
|
-
fuel_credits: data.fuel_credits,
|
|
182
|
-
fuel_credits_purchased: data.fuel_credits_purchased || 0,
|
|
186
|
+
fuel_credits: typeof fuel.total === "number" ? fuel.total : data.fuel_credits,
|
|
187
|
+
fuel_credits_purchased: typeof fuel.purchased === "number" ? fuel.purchased : data.fuel_credits_purchased || 0,
|
|
183
188
|
monthly_spending_limit: data.monthly_spending_limit || null,
|
|
184
189
|
cost_byok: data.cost_byok || 0,
|
|
185
190
|
tokens_byok: data.tokens_byok || 0,
|
|
@@ -203,14 +208,19 @@ var init_src = __esm({
|
|
|
203
208
|
};
|
|
204
209
|
}
|
|
205
210
|
async getLiveUsage() {
|
|
206
|
-
const
|
|
211
|
+
const [billingData, overviewData] = await Promise.all([
|
|
212
|
+
this.request("/api/billing/settings").catch(() => null),
|
|
213
|
+
this.request("/api/projects/overview").catch(() => ({}))
|
|
214
|
+
]);
|
|
215
|
+
const fuel = billingData?.fuel ?? {};
|
|
216
|
+
const data = overviewData;
|
|
207
217
|
return {
|
|
208
218
|
id: data.user_id,
|
|
209
219
|
email: data.email,
|
|
210
|
-
tier: data.tier,
|
|
220
|
+
tier: billingData?.tier ?? data.tier,
|
|
211
221
|
is_pro: data.is_pro,
|
|
212
|
-
fuel_credits: data.fuel_credits,
|
|
213
|
-
fuel_credits_purchased: data.fuel_credits_purchased || 0,
|
|
222
|
+
fuel_credits: typeof fuel.total === "number" ? fuel.total : data.fuel_credits,
|
|
223
|
+
fuel_credits_purchased: typeof fuel.purchased === "number" ? fuel.purchased : data.fuel_credits_purchased || 0,
|
|
214
224
|
monthly_spending_limit: data.monthly_spending_limit || null,
|
|
215
225
|
cost_byok: data.cost_byok || 0,
|
|
216
226
|
tokens_byok: data.tokens_byok || 0,
|
|
@@ -9462,7 +9472,7 @@ var init_benchmark = __esm({
|
|
|
9462
9472
|
let models = modelArg ?? [];
|
|
9463
9473
|
if (!models.length) {
|
|
9464
9474
|
try {
|
|
9465
|
-
const resp = await context.client.
|
|
9475
|
+
const resp = await context.client.request("/api/benchmark/models");
|
|
9466
9476
|
const list = Array.isArray(resp) ? resp : resp?.models ?? [];
|
|
9467
9477
|
models = list.slice(0, 4).map((m) => m.id ?? m.model_id ?? "").filter(Boolean);
|
|
9468
9478
|
} catch {
|
|
@@ -9688,14 +9698,14 @@ var init_status = __esm({
|
|
|
9688
9698
|
context.addMessage("error", `Health check failed: ${e.message}`);
|
|
9689
9699
|
}
|
|
9690
9700
|
try {
|
|
9691
|
-
const countData = await context.client["request"]("/api/stream/active-count");
|
|
9701
|
+
const countData = await context.client["request"]("/api/chat/stream/active-count");
|
|
9692
9702
|
const count = countData?.count ?? countData?.active_count ?? 0;
|
|
9693
9703
|
context.addMessage("system", `[INFO] Active Streams: ${count}`);
|
|
9694
9704
|
} catch (e) {
|
|
9695
9705
|
context.addMessage("system", ` Active Streams: unavailable (${e.message})`);
|
|
9696
9706
|
}
|
|
9697
9707
|
try {
|
|
9698
|
-
const providerData = await context.client["request"]("/api/
|
|
9708
|
+
const providerData = await context.client["request"]("/api/provider/circuit-summary");
|
|
9699
9709
|
const providers = providerData?.providers ?? (Array.isArray(providerData) ? providerData : []);
|
|
9700
9710
|
if (providers.length > 0) {
|
|
9701
9711
|
context.addMessage("system", " Provider Circuits:");
|
|
@@ -9866,7 +9876,7 @@ var init_version = __esm({
|
|
|
9866
9876
|
description: "Show version information for CLI and core packages",
|
|
9867
9877
|
category: "debug",
|
|
9868
9878
|
handler: async (_args, context) => {
|
|
9869
|
-
const cliVersion = true ? "2.3.6-beta.
|
|
9879
|
+
const cliVersion = true ? "2.3.6-beta.22" : "(dev)";
|
|
9870
9880
|
const coreVersion = true ? "2.3.2" : "(dev)";
|
|
9871
9881
|
const runtime = process.version;
|
|
9872
9882
|
context.addMessage("system", "MSapling Version Info");
|
|
@@ -9875,7 +9885,7 @@ var init_version = __esm({
|
|
|
9875
9885
|
context.addMessage("system", row2("Core (@msapling/core)", coreVersion));
|
|
9876
9886
|
context.addMessage("system", row2("Runtime (Node/Bun)", runtime));
|
|
9877
9887
|
try {
|
|
9878
|
-
const ts = "2026-05-
|
|
9888
|
+
const ts = "2026-05-28T19:10:28.448Z";
|
|
9879
9889
|
if (ts && ts !== "__BUILD_TIMESTAMP__") {
|
|
9880
9890
|
context.addMessage("system", row2("Build Timestamp", ts));
|
|
9881
9891
|
}
|
|
@@ -10874,9 +10884,22 @@ async function apiFetch(path2, opts = {}) {
|
|
|
10874
10884
|
return fetch(`${getBaseURL()}${path2}`, { ...opts, headers, body });
|
|
10875
10885
|
}
|
|
10876
10886
|
async function fetchBalance() {
|
|
10877
|
-
const res = await apiFetch("/api/billing/
|
|
10887
|
+
const res = await apiFetch("/api/billing/settings");
|
|
10878
10888
|
if (!res.ok) throw new Error(`Balance fetch failed: ${res.status}`);
|
|
10879
|
-
|
|
10889
|
+
const data = await res.json();
|
|
10890
|
+
return {
|
|
10891
|
+
tier: data.tier ?? "free",
|
|
10892
|
+
is_pro: data.tier && !["free", "guest"].includes(String(data.tier).toLowerCase()),
|
|
10893
|
+
is_founder: false,
|
|
10894
|
+
fuel_credits: Number(data?.fuel?.total ?? 0),
|
|
10895
|
+
fuel_credits_purchased: Number(data?.fuel?.purchased ?? 0),
|
|
10896
|
+
auto_topup: {
|
|
10897
|
+
enabled: !!data?.auto_topup?.enabled,
|
|
10898
|
+
threshold_usd: Number(data?.auto_topup?.threshold_usd ?? 0),
|
|
10899
|
+
amount_usd: Number(data?.auto_topup?.amount_usd ?? 0),
|
|
10900
|
+
max_per_month_usd: Number(data?.auto_topup?.max_per_month_usd ?? 0)
|
|
10901
|
+
}
|
|
10902
|
+
};
|
|
10880
10903
|
}
|
|
10881
10904
|
async function fetchFounderStatus() {
|
|
10882
10905
|
const res = await apiFetch("/api/billing/founder-status");
|
|
@@ -14265,7 +14288,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
14265
14288
|
var Header = () => /* @__PURE__ */ jsxs(Box, { borderStyle: "single", borderColor: "cyan", paddingX: 1, marginBottom: 1, children: [
|
|
14266
14289
|
/* @__PURE__ */ jsxs(Text, { bold: true, color: "cyan", children: [
|
|
14267
14290
|
"\u25CF MSapling CLI v",
|
|
14268
|
-
"2.3.6-beta.
|
|
14291
|
+
"2.3.6-beta.22"
|
|
14269
14292
|
] }),
|
|
14270
14293
|
/* @__PURE__ */ jsx(Box, { marginLeft: 2, children: /* @__PURE__ */ jsx(Text, { color: "gray", children: "Platinum Tier Architecture" }) })
|
|
14271
14294
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtreeai/msapling-cli",
|
|
3
|
-
"version": "2.3.6-beta.
|
|
3
|
+
"version": "2.3.6-beta.22",
|
|
4
4
|
"description": "MSapling CLI — React/Ink terminal client for the MSapling backend (chat, projects, MDrive, agent tools). Proprietary; redistribution prohibited.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "MSapling Team",
|