@ace-sdk/cli 3.8.0 → 3.9.1
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/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +52 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/utils/usage-display.d.ts +73 -0
- package/dist/utils/usage-display.d.ts.map +1 -0
- package/dist/utils/usage-display.js +275 -0
- package/dist/utils/usage-display.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH;;GAEG;AACH,wBAAsB,aAAa,kBAuGlC"}
|
package/dist/commands/status.js
CHANGED
|
@@ -6,6 +6,8 @@ import { createContext } from '../types/config.js';
|
|
|
6
6
|
import { ACEServerClient } from '../services/server-client.js';
|
|
7
7
|
import { Logger } from '../services/logger.js';
|
|
8
8
|
import chalk from 'chalk';
|
|
9
|
+
import { isSubscriptionError, QuotaExceededError, PaymentRequiredError, AccountBlockedError } from '@ace-sdk/core';
|
|
10
|
+
import { displayUsageStatus, formatUsageJson } from '../utils/usage-display.js';
|
|
9
11
|
/**
|
|
10
12
|
* Show playbook statistics
|
|
11
13
|
*/
|
|
@@ -18,11 +20,22 @@ export async function statusCommand() {
|
|
|
18
20
|
const client = new ACEServerClient(context, logger);
|
|
19
21
|
const status = await client.getAnalytics();
|
|
20
22
|
spinner?.succeed('Status retrieved');
|
|
23
|
+
// Get subscription usage from response headers (v2.8.0+)
|
|
24
|
+
const usage = client.getLastUsage();
|
|
21
25
|
if (logger.isJson()) {
|
|
22
|
-
|
|
26
|
+
// Include both playbook stats and subscription usage in JSON output
|
|
27
|
+
const output = {
|
|
28
|
+
playbook: status,
|
|
29
|
+
subscription: usage ? formatUsageJson(usage) : null
|
|
30
|
+
};
|
|
31
|
+
logger.output(output);
|
|
23
32
|
}
|
|
24
33
|
else {
|
|
25
|
-
|
|
34
|
+
// Show subscription usage first (if available)
|
|
35
|
+
if (usage) {
|
|
36
|
+
displayUsageStatus(usage);
|
|
37
|
+
}
|
|
38
|
+
logger.info(chalk.bold('📊 Playbook Status\n'));
|
|
26
39
|
// Handle both total_patterns (new) and total_bullets (legacy)
|
|
27
40
|
const totalCount = status.total_patterns ?? status.total_bullets ?? 0;
|
|
28
41
|
logger.info(` ${chalk.cyan('Total Patterns:')} ${totalCount}`);
|
|
@@ -51,6 +64,43 @@ export async function statusCommand() {
|
|
|
51
64
|
}
|
|
52
65
|
catch (error) {
|
|
53
66
|
spinner?.fail('Failed to fetch status');
|
|
67
|
+
// Handle subscription-related errors with helpful messages (v2.8.0+)
|
|
68
|
+
if (isSubscriptionError(error)) {
|
|
69
|
+
if (logger.isJson()) {
|
|
70
|
+
logger.error(JSON.stringify({
|
|
71
|
+
error: error.name,
|
|
72
|
+
message: error.message,
|
|
73
|
+
upgrade_url: 'upgradeUrl' in error ? error.upgradeUrl : 'https://ace-ai.app/pricing'
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
if (error instanceof QuotaExceededError) {
|
|
78
|
+
logger.error(chalk.yellow(`\n⚠️ Quota exceeded: ${error.message}`));
|
|
79
|
+
logger.error(chalk.dim(` ${error.resource}: ${error.current.toLocaleString()} / ${error.limit.toLocaleString()} (${error.percentage}%)`));
|
|
80
|
+
logger.error(chalk.cyan(` Upgrade: ${error.upgradeUrl}\n`));
|
|
81
|
+
}
|
|
82
|
+
else if (error instanceof PaymentRequiredError) {
|
|
83
|
+
logger.error(chalk.yellow(`\n⚠️ Account is in read-only mode`));
|
|
84
|
+
logger.error(chalk.dim(` ${error.message}`));
|
|
85
|
+
if (error.isUrgent) {
|
|
86
|
+
logger.error(chalk.red(` ⚠️ URGENT: Account will be blocked in ${error.daysUntilBlock} days!`));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
logger.error(chalk.dim(` Days until block: ${error.daysUntilBlock}`));
|
|
90
|
+
}
|
|
91
|
+
logger.error(chalk.cyan(` Update payment: ${error.upgradeUrl}\n`));
|
|
92
|
+
}
|
|
93
|
+
else if (error instanceof AccountBlockedError) {
|
|
94
|
+
logger.error(chalk.red(`\n🚫 Account is blocked`));
|
|
95
|
+
logger.error(chalk.dim(` ${error.message}`));
|
|
96
|
+
logger.error(chalk.cyan(` Resolve at: ${error.upgradeUrl}\n`));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
logger.error(chalk.red(`\n❌ ${error.message}\n`));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
54
104
|
if (logger.isJson()) {
|
|
55
105
|
logger.error(JSON.stringify({ error: error instanceof Error ? error.message : String(error) }));
|
|
56
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,uBA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5
|
+
*
|
|
6
|
+
* @package @ace-sdk/cli
|
|
7
|
+
* @since v2.8.0
|
|
8
|
+
*/
|
|
9
|
+
import type { UsageInfo, SubscriptionStatus } from '@ace-sdk/core';
|
|
10
|
+
/**
|
|
11
|
+
* Format a usage metric as a progress bar
|
|
12
|
+
*
|
|
13
|
+
* @param used - Current usage
|
|
14
|
+
* @param limit - Maximum limit
|
|
15
|
+
* @param width - Bar width in characters (default: 20)
|
|
16
|
+
* @returns Formatted progress bar string
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* formatUsageBar(80, 100);
|
|
21
|
+
* // Returns: "████████████████░░░░ 80 / 100 (80%)"
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatUsageBar(used: number, limit: number, width?: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* Format a number with thousands separators
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatNumber(num: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* Format plan name for display
|
|
31
|
+
*
|
|
32
|
+
* @param type - Subscription type (individual/team)
|
|
33
|
+
* @param tier - Plan tier (free/basic/pro)
|
|
34
|
+
* @returns Formatted plan name
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* formatPlanName('individual', 'pro');
|
|
39
|
+
* // Returns: "Individual PRO"
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatPlanName(type: string, tier: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Get colored plan badge
|
|
45
|
+
*/
|
|
46
|
+
export declare function getPlanBadge(type: string, tier: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Format subscription status for display
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatStatus(status: SubscriptionStatus): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get status icon
|
|
53
|
+
*/
|
|
54
|
+
export declare function getStatusIcon(status: SubscriptionStatus): string;
|
|
55
|
+
/**
|
|
56
|
+
* Format feature availability
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatFeatures(features: UsageInfo['features']): string;
|
|
59
|
+
/**
|
|
60
|
+
* Display complete usage status
|
|
61
|
+
*
|
|
62
|
+
* @param usage - Usage information
|
|
63
|
+
*/
|
|
64
|
+
export declare function displayUsageStatus(usage: UsageInfo): void;
|
|
65
|
+
/**
|
|
66
|
+
* Display warnings based on usage status
|
|
67
|
+
*/
|
|
68
|
+
export declare function displayWarnings(usage: UsageInfo): void;
|
|
69
|
+
/**
|
|
70
|
+
* Format usage info for JSON output
|
|
71
|
+
*/
|
|
72
|
+
export declare function formatUsageJson(usage: UsageInfo): object;
|
|
73
|
+
//# sourceMappingURL=usage-display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-display.d.ts","sourceRoot":"","sources":["../../src/utils/usage-display.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAe,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMhF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CA0B9E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAW/D;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAa/D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAahE;AAMD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,MAAM,CAqBtE;AAMD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAqCzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAiDtD;AAcD;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAmBxD"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Usage Display Utilities for ACE CLI
|
|
3
|
+
*
|
|
4
|
+
* Functions for formatting and displaying subscription usage information.
|
|
5
|
+
*
|
|
6
|
+
* @package @ace-sdk/cli
|
|
7
|
+
* @since v2.8.0
|
|
8
|
+
*/
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Progress Bar Formatting
|
|
12
|
+
// =============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Format a usage metric as a progress bar
|
|
15
|
+
*
|
|
16
|
+
* @param used - Current usage
|
|
17
|
+
* @param limit - Maximum limit
|
|
18
|
+
* @param width - Bar width in characters (default: 20)
|
|
19
|
+
* @returns Formatted progress bar string
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* formatUsageBar(80, 100);
|
|
24
|
+
* // Returns: "████████████████░░░░ 80 / 100 (80%)"
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function formatUsageBar(used, limit, width = 20) {
|
|
28
|
+
// Handle unlimited (limit = -1 or 0)
|
|
29
|
+
if (limit <= 0) {
|
|
30
|
+
return `${chalk.dim('unlimited')} ${formatNumber(used)} used`;
|
|
31
|
+
}
|
|
32
|
+
const percentage = Math.min(100, Math.round((used / limit) * 100));
|
|
33
|
+
const filled = Math.round((percentage / 100) * width);
|
|
34
|
+
const empty = width - filled;
|
|
35
|
+
// Color based on usage level
|
|
36
|
+
let barColor = chalk.green;
|
|
37
|
+
let warningIcon = '';
|
|
38
|
+
if (percentage >= 90) {
|
|
39
|
+
barColor = chalk.red;
|
|
40
|
+
warningIcon = ' 🔴';
|
|
41
|
+
}
|
|
42
|
+
else if (percentage >= 80) {
|
|
43
|
+
barColor = chalk.yellow;
|
|
44
|
+
warningIcon = ' ⚠️';
|
|
45
|
+
}
|
|
46
|
+
const bar = barColor('█'.repeat(filled)) + chalk.dim('░'.repeat(empty));
|
|
47
|
+
const numbers = `${formatNumber(used)} / ${formatNumber(limit)} (${percentage}%)`;
|
|
48
|
+
return `${bar} ${numbers}${warningIcon}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Format a number with thousands separators
|
|
52
|
+
*/
|
|
53
|
+
export function formatNumber(num) {
|
|
54
|
+
return num.toLocaleString('en-US');
|
|
55
|
+
}
|
|
56
|
+
// =============================================================================
|
|
57
|
+
// Plan Name Formatting
|
|
58
|
+
// =============================================================================
|
|
59
|
+
/**
|
|
60
|
+
* Format plan name for display
|
|
61
|
+
*
|
|
62
|
+
* @param type - Subscription type (individual/team)
|
|
63
|
+
* @param tier - Plan tier (free/basic/pro)
|
|
64
|
+
* @returns Formatted plan name
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* formatPlanName('individual', 'pro');
|
|
69
|
+
* // Returns: "Individual PRO"
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export function formatPlanName(type, tier) {
|
|
73
|
+
const typeDisplay = type.charAt(0).toUpperCase() + type.slice(1);
|
|
74
|
+
const tierDisplay = tier.toUpperCase();
|
|
75
|
+
return `${typeDisplay} ${tierDisplay}`;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get colored plan badge
|
|
79
|
+
*/
|
|
80
|
+
export function getPlanBadge(type, tier) {
|
|
81
|
+
const name = formatPlanName(type, tier);
|
|
82
|
+
switch (tier) {
|
|
83
|
+
case 'pro':
|
|
84
|
+
return chalk.bgMagenta.white.bold(` ${name} `);
|
|
85
|
+
case 'basic':
|
|
86
|
+
return chalk.bgBlue.white.bold(` ${name} `);
|
|
87
|
+
default:
|
|
88
|
+
return chalk.bgGray.white(` ${name} `);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// Status Formatting
|
|
93
|
+
// =============================================================================
|
|
94
|
+
/**
|
|
95
|
+
* Format subscription status for display
|
|
96
|
+
*/
|
|
97
|
+
export function formatStatus(status) {
|
|
98
|
+
switch (status) {
|
|
99
|
+
case 'active':
|
|
100
|
+
return chalk.green('Active');
|
|
101
|
+
case 'trialing':
|
|
102
|
+
return chalk.cyan('Trial');
|
|
103
|
+
case 'read_only':
|
|
104
|
+
return chalk.yellow('Read-Only');
|
|
105
|
+
case 'blocked':
|
|
106
|
+
return chalk.red('Blocked');
|
|
107
|
+
default:
|
|
108
|
+
return status;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get status icon
|
|
113
|
+
*/
|
|
114
|
+
export function getStatusIcon(status) {
|
|
115
|
+
switch (status) {
|
|
116
|
+
case 'active':
|
|
117
|
+
return '✅';
|
|
118
|
+
case 'trialing':
|
|
119
|
+
return '🧪';
|
|
120
|
+
case 'read_only':
|
|
121
|
+
return '⚠️';
|
|
122
|
+
case 'blocked':
|
|
123
|
+
return '🚫';
|
|
124
|
+
default:
|
|
125
|
+
return '❓';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// =============================================================================
|
|
129
|
+
// Features Formatting
|
|
130
|
+
// =============================================================================
|
|
131
|
+
/**
|
|
132
|
+
* Format feature availability
|
|
133
|
+
*/
|
|
134
|
+
export function formatFeatures(features) {
|
|
135
|
+
const items = [];
|
|
136
|
+
if (features.teams) {
|
|
137
|
+
items.push(chalk.green('✅ Teams'));
|
|
138
|
+
}
|
|
139
|
+
if (features.sharing) {
|
|
140
|
+
items.push(chalk.green('✅ Sharing'));
|
|
141
|
+
}
|
|
142
|
+
if (features.apiAccess) {
|
|
143
|
+
items.push(chalk.green('✅ API Access'));
|
|
144
|
+
}
|
|
145
|
+
if (features.prioritySupport) {
|
|
146
|
+
items.push(chalk.green('✅ Priority Support'));
|
|
147
|
+
}
|
|
148
|
+
if (items.length === 0) {
|
|
149
|
+
return chalk.dim('No premium features');
|
|
150
|
+
}
|
|
151
|
+
return items.join(' ');
|
|
152
|
+
}
|
|
153
|
+
// =============================================================================
|
|
154
|
+
// Full Status Display
|
|
155
|
+
// =============================================================================
|
|
156
|
+
/**
|
|
157
|
+
* Display complete usage status
|
|
158
|
+
*
|
|
159
|
+
* @param usage - Usage information
|
|
160
|
+
*/
|
|
161
|
+
export function displayUsageStatus(usage) {
|
|
162
|
+
const statusIcon = getStatusIcon(usage.status);
|
|
163
|
+
const planBadge = getPlanBadge(usage.subscriptionType, usage.planTier);
|
|
164
|
+
console.log();
|
|
165
|
+
console.log(chalk.bold(`Subscription: ${planBadge} ${statusIcon} ${formatStatus(usage.status)}`));
|
|
166
|
+
console.log();
|
|
167
|
+
// Usage metrics
|
|
168
|
+
console.log(chalk.bold('Usage:'));
|
|
169
|
+
console.log(` ${chalk.cyan('Patterns:'.padEnd(18))}${formatUsageBar(usage.patterns.used, usage.patterns.limit)}`);
|
|
170
|
+
console.log(` ${chalk.cyan('Total Patterns:'.padEnd(18))}${formatUsageBar(usage.patternsTotal.used, usage.patternsTotal.limit)}`);
|
|
171
|
+
console.log(` ${chalk.cyan('Projects:'.padEnd(18))}${formatUsageBar(usage.projects.used, usage.projects.limit)}`);
|
|
172
|
+
console.log(` ${chalk.cyan('Domains:'.padEnd(18))}${formatUsageBar(usage.domains.used, usage.domains.limit)}`);
|
|
173
|
+
console.log(` ${chalk.cyan('Templates:'.padEnd(18))}${formatUsageBar(usage.templates.used, usage.templates.limit)}`);
|
|
174
|
+
console.log(` ${chalk.cyan('API Calls:'.padEnd(18))}${formatUsageBar(usage.apiCalls.used, usage.apiCalls.limit)}`);
|
|
175
|
+
console.log(` ${chalk.cyan('Traces Today:'.padEnd(18))}${formatUsageBar(usage.tracesToday.used, usage.tracesToday.limit)}`);
|
|
176
|
+
console.log();
|
|
177
|
+
// Reset info
|
|
178
|
+
console.log(chalk.dim(' ℹ️ API Calls reset on billing cycle. Traces reset daily at midnight UTC.'));
|
|
179
|
+
console.log();
|
|
180
|
+
// Features
|
|
181
|
+
console.log(chalk.bold('Features:'), formatFeatures(usage.features));
|
|
182
|
+
console.log();
|
|
183
|
+
// Team info (if applicable)
|
|
184
|
+
if (usage.team) {
|
|
185
|
+
console.log(chalk.bold('Team:'));
|
|
186
|
+
console.log(` ${chalk.cyan('Organization:')} ${usage.team.orgName}`);
|
|
187
|
+
console.log(` ${chalk.cyan('Seats:'.padEnd(18))}${formatUsageBar(usage.team.seatsUsed, usage.team.seatsLimit)}`);
|
|
188
|
+
console.log();
|
|
189
|
+
}
|
|
190
|
+
// Warnings
|
|
191
|
+
displayWarnings(usage);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Display warnings based on usage status
|
|
195
|
+
*/
|
|
196
|
+
export function displayWarnings(usage) {
|
|
197
|
+
// Read-only mode warning
|
|
198
|
+
if (usage.status === 'read_only') {
|
|
199
|
+
console.log(chalk.yellow.bold('⚠️ Account is in READ-ONLY mode due to payment failure.'));
|
|
200
|
+
console.log(chalk.yellow(' Update payment: https://ace-ai.app/settings/billing'));
|
|
201
|
+
console.log();
|
|
202
|
+
}
|
|
203
|
+
// Blocked account warning
|
|
204
|
+
if (usage.status === 'blocked') {
|
|
205
|
+
console.log(chalk.red.bold('🚫 Account is BLOCKED.'));
|
|
206
|
+
console.log(chalk.red(' Resolve at: https://ace-ai.app/settings/billing'));
|
|
207
|
+
console.log();
|
|
208
|
+
}
|
|
209
|
+
// Trial ending warning (if trialing and would show usage)
|
|
210
|
+
if (usage.status === 'trialing') {
|
|
211
|
+
console.log(chalk.cyan('🧪 You are on a trial period.'));
|
|
212
|
+
console.log(chalk.cyan(' Upgrade: https://ace-ai.app/pricing'));
|
|
213
|
+
console.log();
|
|
214
|
+
}
|
|
215
|
+
// Near-limit warnings
|
|
216
|
+
const nearLimitResources = [];
|
|
217
|
+
if (isNearLimit(usage.patterns)) {
|
|
218
|
+
nearLimitResources.push('Patterns (per-project)');
|
|
219
|
+
}
|
|
220
|
+
if (isNearLimit(usage.patternsTotal)) {
|
|
221
|
+
nearLimitResources.push('Patterns (total)');
|
|
222
|
+
}
|
|
223
|
+
if (isNearLimit(usage.projects)) {
|
|
224
|
+
nearLimitResources.push('Projects');
|
|
225
|
+
}
|
|
226
|
+
if (isNearLimit(usage.apiCalls)) {
|
|
227
|
+
nearLimitResources.push('API Calls');
|
|
228
|
+
}
|
|
229
|
+
if (isNearLimit(usage.tracesToday)) {
|
|
230
|
+
nearLimitResources.push('Daily Traces');
|
|
231
|
+
}
|
|
232
|
+
if (nearLimitResources.length > 0) {
|
|
233
|
+
console.log(chalk.yellow.bold('⚠️ Approaching limits:'));
|
|
234
|
+
nearLimitResources.forEach(resource => {
|
|
235
|
+
console.log(chalk.yellow(` • ${resource}`));
|
|
236
|
+
});
|
|
237
|
+
console.log(chalk.yellow(' Upgrade: https://ace-ai.app/pricing'));
|
|
238
|
+
console.log();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Check if a metric is near its limit (>80%)
|
|
243
|
+
*/
|
|
244
|
+
function isNearLimit(metric, threshold = 80) {
|
|
245
|
+
if (metric.limit <= 0)
|
|
246
|
+
return false;
|
|
247
|
+
return (metric.used / metric.limit) * 100 >= threshold;
|
|
248
|
+
}
|
|
249
|
+
// =============================================================================
|
|
250
|
+
// JSON Output
|
|
251
|
+
// =============================================================================
|
|
252
|
+
/**
|
|
253
|
+
* Format usage info for JSON output
|
|
254
|
+
*/
|
|
255
|
+
export function formatUsageJson(usage) {
|
|
256
|
+
return {
|
|
257
|
+
plan: usage.plan,
|
|
258
|
+
subscription_type: usage.subscriptionType,
|
|
259
|
+
plan_tier: usage.planTier,
|
|
260
|
+
status: usage.status,
|
|
261
|
+
usage: {
|
|
262
|
+
patterns: usage.patterns,
|
|
263
|
+
patterns_total: usage.patternsTotal,
|
|
264
|
+
projects: usage.projects,
|
|
265
|
+
domains: usage.domains,
|
|
266
|
+
templates: usage.templates,
|
|
267
|
+
api_calls: usage.apiCalls,
|
|
268
|
+
traces_today: usage.tracesToday
|
|
269
|
+
},
|
|
270
|
+
features: usage.features,
|
|
271
|
+
team: usage.team || null,
|
|
272
|
+
upgrade_url: 'https://ace-ai.app/pricing'
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=usage-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-display.js","sourceRoot":"","sources":["../../src/utils/usage-display.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,KAAa,EAAE,KAAK,GAAG,EAAE;IACpE,qCAAqC;IACrC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACf,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC;IAChE,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,KAAK,GAAG,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I,EAAE,KAAK,CAAC,IAAI;QAChB,iBAAiB,EAAE,KAAK,CAAC,gBAAgB;QACzC,SAAS,EAAE,KAAK,CAAC,QAAQ;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,KAAK,EAAE;YACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,cAAc,EAAE,KAAK,CAAC,aAAa;YACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,SAAS,EAAE,KAAK,CAAC,QAAQ;YACzB,YAAY,EAAE,KAAK,CAAC,WAAW;SAChC;QACD,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI;QACxB,WAAW,EAAE,4BAA4B;KAC1C,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ace-sdk/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"description": "ACE CLI - Command-line tool for intelligent pattern learning and playbook management",
|
|
5
5
|
"main": "dist/cli.js",
|
|
6
6
|
"types": "dist/cli.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"directory": "packages/cli"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ace-sdk/core": "^2.
|
|
42
|
+
"@ace-sdk/core": "^2.8.0",
|
|
43
43
|
"chalk": "^5.6.2",
|
|
44
44
|
"commander": "^14.0.2",
|
|
45
45
|
"ora": "^9.0.0",
|