@ayurak/aribot-cli 1.0.9 → 1.0.10

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 (3) hide show
  1. package/dist/cli.js +21 -22
  2. package/package.json +1 -1
  3. package/src/cli.ts +21 -24
package/dist/cli.js CHANGED
@@ -37,7 +37,7 @@ const program = new commander_1.Command();
37
37
  program
38
38
  .name('aribot')
39
39
  .description('Aribot - Economic, Regulatory & Security APIs for Modern Applications')
40
- .version('1.0.5');
40
+ .version('1.0.10');
41
41
  // Helper to get auth headers
42
42
  function getHeaders() {
43
43
  const apiKey = config.get('apiKey');
@@ -977,36 +977,35 @@ program
977
977
  const data = await apiRequest(`/v2/threat-modeling/diagrams/${fullId}/generate-ai-insights/`, {
978
978
  method: 'POST',
979
979
  body: JSON.stringify({
980
- include_recommendations: true,
981
- include_cost_analysis: true
980
+ include_recommendations: true
982
981
  })
983
982
  });
984
983
  spinner.succeed('AI insights generated!');
985
984
  console.log(chalk_1.default.bold('\nAI Architecture Insights:\n'));
986
- const insights = data.insights || data;
987
- console.log(` Architecture Type: ${chalk_1.default.cyan(insights.architecture_type || 'N/A')}`);
988
- console.log(` Complexity Score: ${chalk_1.default.yellow(insights.complexity_score || 'N/A')}`);
989
- console.log(` Security Maturity: ${insights.security_maturity || 'medium'}`);
990
- console.log(` AI Confidence: ${chalk_1.default.green((insights.confidence || 0.88) * 100 + '%')}`);
991
- const strengths = insights.strengths || [];
992
- if (strengths.length > 0) {
993
- console.log(chalk_1.default.bold('\nStrengths:\n'));
994
- strengths.slice(0, 3).forEach((s) => {
995
- console.log(` ${chalk_1.default.green('')} ${s.title || s.description || s}`);
985
+ console.log(` Diagram: ${chalk_1.default.cyan(data.diagram_name || 'N/A')}`);
986
+ console.log(` Components: ${chalk_1.default.white(data.component_count || 0)}`);
987
+ console.log(` AI Provider: ${chalk_1.default.green(data.provider || 'ai_agent')}`);
988
+ console.log(` Generated: ${chalk_1.default.gray(data.generated_at || 'now')}`);
989
+ const threats = data.threats || [];
990
+ if (threats.length > 0) {
991
+ console.log(chalk_1.default.bold('\nPredicted Threats:\n'));
992
+ threats.slice(0, 5).forEach((t) => {
993
+ const severity = t.severity || 'medium';
994
+ const severityColor = severity === 'critical' || severity === 'high' ? chalk_1.default.red : chalk_1.default.yellow;
995
+ console.log(` ${severityColor('!')} ${t.name || t.threat_id}: ${t.description || ''}`);
996
+ if (t.probability) {
997
+ console.log(` ${chalk_1.default.gray(`Probability: ${(t.probability * 100).toFixed(0)}%`)}`);
998
+ }
996
999
  });
997
1000
  }
998
- const weaknesses = insights.weaknesses || [];
999
- if (weaknesses.length > 0) {
1000
- console.log(chalk_1.default.bold('\nWeaknesses:\n'));
1001
- weaknesses.slice(0, 3).forEach((w) => {
1002
- console.log(` ${chalk_1.default.red('✗')} ${w.title || w.description || w}`);
1003
- });
1001
+ else {
1002
+ console.log(chalk_1.default.green('\n No critical threats identified.'));
1004
1003
  }
1005
- const recommendations = insights.recommendations || [];
1004
+ const recommendations = data.recommendations || [];
1006
1005
  if (recommendations.length > 0) {
1007
1006
  console.log(chalk_1.default.bold('\nAI Recommendations:\n'));
1008
- recommendations.slice(0, 3).forEach((r) => {
1009
- console.log(` ${chalk_1.default.cyan('→')} ${r.title || r.description || r}`);
1007
+ recommendations.slice(0, 5).forEach((r) => {
1008
+ console.log(` ${chalk_1.default.cyan('→')} ${typeof r === 'string' ? r : (r.title || r.description || r)}`);
1010
1009
  });
1011
1010
  }
1012
1011
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayurak/aribot-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Aribot - Economic, Regulatory & Security APIs for Modern Applications. Advanced multi-framework threat modeling (STRIDE, PASTA, NIST, Aristiun), 100+ compliance standards, Cloud Security, FinOps, and Red Team automation.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/cli.ts CHANGED
@@ -36,7 +36,7 @@ const program = new Command();
36
36
  program
37
37
  .name('aribot')
38
38
  .description('Aribot - Economic, Regulatory & Security APIs for Modern Applications')
39
- .version('1.0.5');
39
+ .version('1.0.10');
40
40
 
41
41
  // Helper to get auth headers
42
42
  function getHeaders(): Record<string, string> {
@@ -1095,8 +1095,7 @@ program
1095
1095
  const data = await apiRequest(`/v2/threat-modeling/diagrams/${fullId}/generate-ai-insights/`, {
1096
1096
  method: 'POST',
1097
1097
  body: JSON.stringify({
1098
- include_recommendations: true,
1099
- include_cost_analysis: true
1098
+ include_recommendations: true
1100
1099
  })
1101
1100
  });
1102
1101
 
@@ -1104,33 +1103,31 @@ program
1104
1103
 
1105
1104
  console.log(chalk.bold('\nAI Architecture Insights:\n'));
1106
1105
 
1107
- const insights = data.insights || data;
1108
- console.log(` Architecture Type: ${chalk.cyan(insights.architecture_type || 'N/A')}`);
1109
- console.log(` Complexity Score: ${chalk.yellow(insights.complexity_score || 'N/A')}`);
1110
- console.log(` Security Maturity: ${insights.security_maturity || 'medium'}`);
1111
- console.log(` AI Confidence: ${chalk.green((insights.confidence || 0.88) * 100 + '%')}`);
1112
-
1113
- const strengths = insights.strengths || [];
1114
- if (strengths.length > 0) {
1115
- console.log(chalk.bold('\nStrengths:\n'));
1116
- strengths.slice(0, 3).forEach((s: any) => {
1117
- console.log(` ${chalk.green('✓')} ${s.title || s.description || s}`);
1118
- });
1119
- }
1106
+ console.log(` Diagram: ${chalk.cyan(data.diagram_name || 'N/A')}`);
1107
+ console.log(` Components: ${chalk.white(data.component_count || 0)}`);
1108
+ console.log(` AI Provider: ${chalk.green(data.provider || 'ai_agent')}`);
1109
+ console.log(` Generated: ${chalk.gray(data.generated_at || 'now')}`);
1120
1110
 
1121
- const weaknesses = insights.weaknesses || [];
1122
- if (weaknesses.length > 0) {
1123
- console.log(chalk.bold('\nWeaknesses:\n'));
1124
- weaknesses.slice(0, 3).forEach((w: any) => {
1125
- console.log(` ${chalk.red('✗')} ${w.title || w.description || w}`);
1111
+ const threats = data.threats || [];
1112
+ if (threats.length > 0) {
1113
+ console.log(chalk.bold('\nPredicted Threats:\n'));
1114
+ threats.slice(0, 5).forEach((t: any) => {
1115
+ const severity = t.severity || 'medium';
1116
+ const severityColor = severity === 'critical' || severity === 'high' ? chalk.red : chalk.yellow;
1117
+ console.log(` ${severityColor('!')} ${t.name || t.threat_id}: ${t.description || ''}`);
1118
+ if (t.probability) {
1119
+ console.log(` ${chalk.gray(`Probability: ${(t.probability * 100).toFixed(0)}%`)}`);
1120
+ }
1126
1121
  });
1122
+ } else {
1123
+ console.log(chalk.green('\n No critical threats identified.'));
1127
1124
  }
1128
1125
 
1129
- const recommendations = insights.recommendations || [];
1126
+ const recommendations = data.recommendations || [];
1130
1127
  if (recommendations.length > 0) {
1131
1128
  console.log(chalk.bold('\nAI Recommendations:\n'));
1132
- recommendations.slice(0, 3).forEach((r: any) => {
1133
- console.log(` ${chalk.cyan('→')} ${r.title || r.description || r}`);
1129
+ recommendations.slice(0, 5).forEach((r: any) => {
1130
+ console.log(` ${chalk.cyan('→')} ${typeof r === 'string' ? r : (r.title || r.description || r)}`);
1134
1131
  });
1135
1132
  }
1136
1133
  } catch (error) {