@hynaweb/kavlr 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/bin/cli.js +17 -12
  2. package/package.json +3 -3
package/bin/cli.js CHANGED
@@ -35,7 +35,8 @@ function printLogo() {
35
35
  ██╔═██╗ ██╔══██║╚██╗ ██╔╝██║ ██╔══██╗
36
36
  ██║ ██╗██║ ██║ ╚████╔╝ ███████╗██║ ██║
37
37
  ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝
38
- `) + chalk.gray(` The AI Agent Action Gate v1.0.0\n`));
38
+ `) + chalk.gray(` The AI Agent Action Gate v1.0.3
39
+ `));
39
40
  }
40
41
 
41
42
  async function cmdSetup() {
@@ -56,7 +57,6 @@ async function cmdSetup() {
56
57
 
57
58
  async function cmdStatus() {
58
59
  const key = loadKey();
59
- if (!key) return console.log(chalk.red('No API key found. Run: kavlr setup'));
60
60
  console.log(chalk.gray('Fetching system status...'));
61
61
  try {
62
62
  const res = await fetch(`${SUPABASE_URL}/rest/v1/settings?id=eq.1&select=kill_switch_active`, {
@@ -65,12 +65,14 @@ async function cmdStatus() {
65
65
  const data = await res.json();
66
66
  const isKilled = data[0] ? data[0].kill_switch_active : false;
67
67
 
68
- console.log(chalk.bold('\nSYSTEM STATUS'));
68
+ console.log(chalk.bold('
69
+ SYSTEM STATUS'));
69
70
  console.log('──────────────────────────────');
70
71
  console.log(`API Key: ${chalk.green('CONFIGURED')}`);
71
72
  console.log(`Kill Switch: ${isKilled ? chalk.red.bold('HALTED (LOCKDOWN)') : chalk.green.bold('SECURE (ACTIVE)')}`);
72
73
  console.log(`Gate: ${chalk.cyan('ONLINE')}`);
73
- console.log('──────────────────────────────\n');
74
+ console.log('──────────────────────────────
75
+ ');
74
76
  } catch (e) {
75
77
  console.log(chalk.red(`Error: ${e.message}`));
76
78
  }
@@ -78,28 +80,28 @@ async function cmdStatus() {
78
80
 
79
81
  async function cmdLogs() {
80
82
  const key = loadKey();
81
- if (!key) return;
82
83
  console.log(chalk.gray('Fetching recent telemetry...'));
83
84
  try {
84
85
  const userRes = await fetch(`${SUPABASE_URL}/rest/v1/api_keys?key=eq.${key}&select=user_id`, {
85
86
  headers: { 'apikey': SUPABASE_ANON, 'Authorization': `Bearer ${SUPABASE_ANON}` }
86
87
  });
87
88
  const users = await userRes.json();
88
- if (!users.length) return console.log(chalk.red('Invalid API key.'));
89
89
 
90
90
  const logsRes = await fetch(`${SUPABASE_URL}/rest/v1/agent_logs?user_id=eq.${users[0].user_id}&order=created_at.desc&limit=5`, {
91
91
  headers: { 'apikey': SUPABASE_ANON, 'Authorization': `Bearer ${SUPABASE_ANON}` }
92
92
  });
93
93
  const logs = await logsRes.json();
94
94
 
95
- console.log(chalk.bold('\nRECENT TELEMETRY'));
95
+ console.log(chalk.bold('
96
+ RECENT TELEMETRY'));
96
97
  console.log('────────────────────────────────────────────────────────');
97
98
  logs.forEach(log => {
98
99
  const color = log.status === 'BLOCKED' ? chalk.red : chalk.green;
99
100
  console.log(`${color(`[${log.status}]`)} ${log.payload}`);
100
101
  console.log(chalk.gray(` ID: ${log.agent_id} | Time: ${log.created_at.substring(11, 19)}`));
101
102
  });
102
- console.log('────────────────────────────────────────────────────────\n');
103
+ console.log('────────────────────────────────────────────────────────
104
+ ');
103
105
  } catch (e) {
104
106
  console.log(chalk.red(`Error: ${e.message}`));
105
107
  }
@@ -114,7 +116,6 @@ function cmdDashboard() {
114
116
 
115
117
  async function runGate(args) {
116
118
  const key = loadKey();
117
- if (!key) return console.log(chalk.red('No API key found. Run: kavlr setup'));
118
119
 
119
120
  const binary = args[0];
120
121
  const cmdArgs = args.slice(1);
@@ -147,7 +148,6 @@ async function runGate(args) {
147
148
  console.log(chalk.red(` Reason: ${aiData.reason}`));
148
149
  process.exit(403);
149
150
  }
150
- } else if (!verdict.allowed) {
151
151
  console.log(chalk.red.bold(`🛑 [BLOCKED] ${verdict.reason}`));
152
152
  process.exit(403);
153
153
  } else {
@@ -170,14 +170,19 @@ async function runGate(args) {
170
170
  program
171
171
  .name('kavlr')
172
172
  .description('The AI Agent Action Gate')
173
- .version('1.0.0')
173
+ .version('1.0.3')
174
174
  .allowExcessArguments(true)
175
175
  .allowUnknownOption(true)
176
176
  .argument('[args...]', 'Command and arguments')
177
177
  .action(async (args) => {
178
178
  if (args.length === 0) {
179
179
  printLogo();
180
- console.log(`Usage:\n kavlr setup\n kavlr status\n kavlr logs\n kavlr dashboard\n kavlr <command> [args...]`);
180
+ console.log(`Usage:
181
+ kavlr setup
182
+ kavlr status
183
+ kavlr logs
184
+ kavlr dashboard
185
+ kavlr <command> [args...]`);
181
186
  return;
182
187
  }
183
188
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hynaweb/kavlr",
3
- "version": "1.0.1",
4
- "description": "The AI Agent Action Gate. Grade the action, not the text.",
3
+ "version": "1.0.3",
4
+ "description": "The AI Agent Action Gate.",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
7
7
  "kavlr": "bin/cli.js"
@@ -10,4 +10,4 @@
10
10
  "chalk": "^4.1.2",
11
11
  "commander": "^11.1.0"
12
12
  }
13
- }
13
+ }