@heyamiko/amiko-cli 0.5.5 → 0.5.7
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 +7 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -75089,14 +75089,10 @@ function tryLoadConfig(filePath) {
|
|
|
75089
75089
|
const raw = readFileSync2(filePath, "utf-8");
|
|
75090
75090
|
const parsed = JSON.parse(raw);
|
|
75091
75091
|
const config = {};
|
|
75092
|
-
|
|
75093
|
-
|
|
75094
|
-
|
|
75095
|
-
|
|
75096
|
-
if (parsed.amikoUserId)
|
|
75097
|
-
config.userId = parsed.amikoUserId;
|
|
75098
|
-
if (parsed.amikoPlatformUrl)
|
|
75099
|
-
config.platformUrl = parsed.amikoPlatformUrl;
|
|
75092
|
+
config.twinToken = parsed.amikoTwinToken || parsed.AMIKO_TWIN_TOKEN || parsed.AMIKO_USER_TOKEN;
|
|
75093
|
+
config.twinId = parsed.amikoTwinId || parsed.AMIKO_TWIN_ID;
|
|
75094
|
+
config.userId = parsed.amikoUserId || parsed.AMIKO_USER_ID;
|
|
75095
|
+
config.platformUrl = parsed.amikoPlatformUrl || parsed.AMIKO_PLATFORM_URL;
|
|
75100
75096
|
if (parsed.billingBase)
|
|
75101
75097
|
config.billingBase = parsed.billingBase;
|
|
75102
75098
|
if (parsed.platformKey)
|
|
@@ -75249,7 +75245,7 @@ function registerCreditsCommand(program2) {
|
|
|
75249
75245
|
const spinner2 = ora("Fetching credit balance...").start();
|
|
75250
75246
|
try {
|
|
75251
75247
|
let balance = null;
|
|
75252
|
-
const billingToken = auth.platformKey || auth.privyToken;
|
|
75248
|
+
const billingToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75253
75249
|
const base2 = auth.billingBase || "https://billing.heyamiko.com";
|
|
75254
75250
|
if (billingToken) {
|
|
75255
75251
|
try {
|
|
@@ -75286,7 +75282,7 @@ function registerCreditsCommand(program2) {
|
|
|
75286
75282
|
const agentWallets = (auth.agentWallets || []).filter((w5) => w5.source === "agent");
|
|
75287
75283
|
if (agentWallets.length > 0 && auth.billingBase) {
|
|
75288
75284
|
const spinner3 = ora("Fetching wallet balances...").start();
|
|
75289
|
-
const billingAuth = auth.platformKey || auth.privyToken;
|
|
75285
|
+
const billingAuth = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75290
75286
|
try {
|
|
75291
75287
|
spinner3.stop();
|
|
75292
75288
|
console.log(label("Agent Wallets", ""));
|
|
@@ -75356,7 +75352,7 @@ function registerCreditsCommand(program2) {
|
|
|
75356
75352
|
console.error(error("Billing service not configured. Run: amiko connect"));
|
|
75357
75353
|
process.exit(1);
|
|
75358
75354
|
}
|
|
75359
|
-
const authToken = auth.platformKey || auth.privyToken;
|
|
75355
|
+
const authToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75360
75356
|
if (!authToken) {
|
|
75361
75357
|
spinner.stop();
|
|
75362
75358
|
console.error(error("No API key or auth token. Run: amiko connect"));
|