@oculum/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 (2) hide show
  1. package/dist/index.js +32 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -43313,6 +43313,16 @@ function getApiBaseUrl() {
43313
43313
  function setAuthCredentials(apiKey, email, tier) {
43314
43314
  updateConfig({ apiKey, email, tier });
43315
43315
  }
43316
+ function syncAuthFromVerification(verifyResponse) {
43317
+ if (!verifyResponse.valid) return;
43318
+ const config = getConfig();
43319
+ if (!config.apiKey) return;
43320
+ const email = verifyResponse.email || config.email;
43321
+ const tier = verifyResponse.tier || config.tier || "free";
43322
+ if (tier !== config.tier || email !== config.email) {
43323
+ setAuthCredentials(config.apiKey, email, tier);
43324
+ }
43325
+ }
43316
43326
 
43317
43327
  // src/utils/api.ts
43318
43328
  var APIError = class extends Error {
@@ -44192,6 +44202,13 @@ async function runScanOnce(targetPath, options) {
44192
44202
  const config = getConfig();
44193
44203
  const noColor = options.color === false;
44194
44204
  const cancellationToken = (0, import_scanner.createCancellationToken)();
44205
+ if ((options.depth === "validated" || options.depth === "deep") && isAuthenticated()) {
44206
+ try {
44207
+ const verified = await verifyApiKey(config.apiKey);
44208
+ syncAuthFromVerification(verified);
44209
+ } catch {
44210
+ }
44211
+ }
44195
44212
  if ((options.depth === "validated" || options.depth === "deep") && !isAuthenticated()) {
44196
44213
  if (!options.quiet) {
44197
44214
  console.log("");
@@ -44551,7 +44568,10 @@ async function status() {
44551
44568
  spinner.succeed(" Authenticated");
44552
44569
  console.log("");
44553
44570
  const email = result.email || config.email || "unknown";
44554
- const tier = result.tier || config.tier || "free";
44571
+ const tier = result.tier || "free";
44572
+ if (tier !== config.tier || email !== config.email) {
44573
+ setAuthCredentials(config.apiKey, email, tier);
44574
+ }
44555
44575
  const tierBadge = tier === "pro" ? source_default.bgBlue.white(" PRO ") : tier === "enterprise" ? source_default.bgMagenta.white(" ENTERPRISE ") : source_default.bgGray.white(" FREE ");
44556
44576
  console.log(source_default.dim(" Email: ") + source_default.white(email));
44557
44577
  console.log(source_default.dim(" Plan: ") + tierBadge);
@@ -48138,6 +48158,9 @@ async function runAuthFlow() {
48138
48158
  const verified = await verifyApiKey(config.apiKey);
48139
48159
  if (verified.valid && verified.tier) {
48140
48160
  currentTier = verified.tier;
48161
+ if (currentTier !== config.tier || verified.email && verified.email !== config.email) {
48162
+ setAuthCredentials(config.apiKey, verified.email || config.email, currentTier);
48163
+ }
48141
48164
  }
48142
48165
  } catch {
48143
48166
  }
@@ -48167,9 +48190,14 @@ async function runAuthFlow() {
48167
48190
  s.stop("Stored credentials are invalid or expired.");
48168
48191
  continue;
48169
48192
  }
48193
+ const email = verified.email || getConfig().email || "unknown";
48194
+ const tier = verified.tier || "free";
48195
+ if (tier !== getConfig().tier || email !== getConfig().email) {
48196
+ setAuthCredentials(getConfig().apiKey, email, tier);
48197
+ }
48170
48198
  s.stop("Authenticated");
48171
- M2.info(`Email: ${verified.email || getConfig().email || "unknown"}`);
48172
- M2.info(`Tier: ${verified.tier || getConfig().tier || "unknown"}`);
48199
+ M2.info(`Email: ${email}`);
48200
+ M2.info(`Tier: ${tier}`);
48173
48201
  } catch (err) {
48174
48202
  s.stop("Verification failed");
48175
48203
  M2.error(String(err));
@@ -48982,7 +49010,7 @@ function shouldRunUI() {
48982
49010
  return isOcAlias || isUICommand;
48983
49011
  }
48984
49012
  var program2 = new Command();
48985
- program2.name("oculum").description("AI-native security scanner for detecting vulnerabilities in LLM-generated code").version("1.0.8").addHelpText("after", `
49013
+ program2.name("oculum").description("AI-native security scanner for detecting vulnerabilities in LLM-generated code").version("1.0.9").addHelpText("after", `
48986
49014
  Quick Start:
48987
49015
  $ oculum scan . Scan current directory (free)
48988
49016
  $ oculum ui Interactive mode with guided setup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oculum/cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "AI-native security scanner CLI for detecting vulnerabilities in AI-generated code, BYOK patterns, and modern web applications",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
  "url": "https://github.com/flexipie/oculum/issues"
20
20
  },
21
21
  "scripts": {
22
- "build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\" --define:process.env.OCULUM_API_URL='undefined' --define:VERSION='\"1.0.8\"'",
22
+ "build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --banner:js=\"#!/usr/bin/env node\" --define:process.env.OCULUM_API_URL='undefined' --define:VERSION='\"1.0.9\"'",
23
23
  "dev": "npm run build -- --watch",
24
24
  "test": "echo \"No tests configured yet\"",
25
25
  "lint": "eslint src/"