thuban 0.3.2 → 0.3.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.
@@ -1,92 +1,100 @@
1
- /**
2
- * Index
3
- *
4
- * @purpose Exports: Core, SentinelCore, createSentinel, getSentinel, Components
5
- * @module sentinel
6
- * @layer application
7
- * @imports-from sentinel/sentinel-core.js, sentinel/file-watcher.js, sentinel/code-scanner.js, sentinel/drift-detector.js, sentinel/health-checker.js, sentinel/alert-manager.js, sentinel/dependency-graph.js, sentinel/widget-generator.js
8
- * @side-effects None detected
9
- */
10
-
11
- /**
12
- * Sentinel - Codebase Monitoring System
13
- *
14
- * Main entry point for the Sentinel module.
15
- * Provides codebase monitoring, code scanning, drift detection,
16
- * health checking, and alerting for Orion OS.
17
- *
18
- * Future: Will be spun out as Thuban SaaS
19
- */
20
-
21
- const { SentinelCore, createSentinel } = require('./sentinel-core.js');
22
- const FileWatcher = require('./file-watcher.js');
23
- const CodeScanner = require('./code-scanner.js');
24
- const DriftDetector = require('./drift-detector.js');
25
- const HealthChecker = require('./health-checker.js');
26
- const AlertManager = require('./alert-manager.js');
27
- const DependencyGraph = require('./dependency-graph.js');
28
- const WidgetGenerator = require('./widget-generator.js');
29
- const SentinelKnowledge = require('./sentinel-knowledge.js');
30
-
31
- // Singleton instance for the Orion codebase
32
- let sentinelInstance = null;
33
-
34
- /**
35
- * Get or create the Sentinel instance
36
- */
37
- function getSentinel(options = {}) {
38
- if (!sentinelInstance) {
39
- sentinelInstance = createSentinel(options);
40
- }
41
- return sentinelInstance;
42
- }
43
-
44
- /**
45
- * Quick scan - scan specific files without full initialization
46
- */
47
- async function quickScan(filePaths, options = {}) {
48
- const scanner = new CodeScanner(options);
49
- return scanner.scanFiles(filePaths);
50
- }
51
-
52
- /**
53
- * Quick health check - check system health without full initialization
54
- */
55
- async function quickHealthCheck(options = {}) {
56
- const checker = new HealthChecker(options);
57
- return checker.checkAll();
58
- }
59
-
60
- /**
61
- * Quick drift check - check for drift on specific files
62
- */
63
- async function quickDriftCheck(filePaths, options = {}) {
64
- const detector = new DriftDetector(options);
65
- const results = [];
66
- for (const file of filePaths) {
67
- results.push(await detector.analyzeFile(file));
68
- }
69
- return results;
70
- }
71
-
72
- module.exports = {
73
- // Core
74
- SentinelCore,
75
- createSentinel,
76
- getSentinel,
77
-
78
- // Components
79
- FileWatcher,
80
- CodeScanner,
81
- DriftDetector,
82
- HealthChecker,
83
- AlertManager,
84
- DependencyGraph,
85
- WidgetGenerator,
86
- SentinelKnowledge,
87
-
88
- // Quick utilities
89
- quickScan,
90
- quickHealthCheck,
91
- quickDriftCheck
92
- };
1
+ /**
2
+ * Index
3
+ *
4
+ * @purpose Exports: Core, SentinelCore, createSentinel, getSentinel, Components
5
+ * @module sentinel
6
+ * @layer application
7
+ * @imports-from sentinel/sentinel-core.js, sentinel/file-watcher.js, sentinel/code-scanner.js, sentinel/drift-detector.js, sentinel/health-checker.js, sentinel/alert-manager.js, sentinel/dependency-graph.js, sentinel/widget-generator.js
8
+ * @side-effects None detected
9
+ */
10
+
11
+ /**
12
+ * Sentinel - Codebase Monitoring System
13
+ *
14
+ * Main entry point for the Sentinel module.
15
+ * Provides codebase monitoring, code scanning, drift detection,
16
+ * health checking, and alerting for Orion OS.
17
+ *
18
+ * Future: Will be spun out as Thuban SaaS
19
+ */
20
+
21
+ const { SentinelCore, createSentinel } = require('./sentinel-core.js');
22
+ const FileWatcher = require('./file-watcher.js');
23
+ const CodeScanner = require('./code-scanner.js');
24
+ const DriftDetector = require('./drift-detector.js');
25
+ const HealthChecker = require('./health-checker.js');
26
+ const AlertManager = require('./alert-manager.js');
27
+ const DependencyGraph = require('./dependency-graph.js');
28
+ const WidgetGenerator = require('./widget-generator.js');
29
+ const SentinelKnowledge = require('./sentinel-knowledge.js');
30
+ const SecretScanner = require('./secret-scanner.js');
31
+
32
+ // Singleton instance for the Orion codebase
33
+ let sentinelInstance = null;
34
+
35
+ /**
36
+ * Get or create the Sentinel instance
37
+ */
38
+ function getSentinel(options = {}) {
39
+ if (!sentinelInstance) {
40
+ sentinelInstance = createSentinel(options);
41
+ }
42
+ return sentinelInstance;
43
+ }
44
+
45
+ /**
46
+ * Quick scan - scan specific files without full initialization
47
+ */
48
+ async function quickScan(filePaths, options = {}) {
49
+ const scanner = new CodeScanner(options);
50
+ return scanner.scanFiles(filePaths);
51
+ }
52
+
53
+ /**
54
+ * Quick health check - check system health without full initialization
55
+ */
56
+ async function quickHealthCheck(options = {}) {
57
+ const checker = new HealthChecker(options);
58
+ return checker.checkAll();
59
+ }
60
+
61
+ /**
62
+ * Quick drift check - check for drift on specific files
63
+ */
64
+ async function quickDriftCheck(filePaths, options = {}) {
65
+ const detector = new DriftDetector(options);
66
+ const results = [];
67
+ for (const file of filePaths) {
68
+ results.push(await detector.analyzeFile(file));
69
+ }
70
+ return results;
71
+ }
72
+
73
+ async function quickSecretScan(filePaths, options = {}) {
74
+ const scanner = new SecretScanner(options);
75
+ return scanner.scanFiles(filePaths);
76
+ }
77
+
78
+ module.exports = {
79
+ // Core
80
+ SentinelCore,
81
+ createSentinel,
82
+ getSentinel,
83
+
84
+ // Components
85
+ FileWatcher,
86
+ CodeScanner,
87
+ DriftDetector,
88
+ HealthChecker,
89
+ AlertManager,
90
+ DependencyGraph,
91
+ WidgetGenerator,
92
+ SentinelKnowledge,
93
+ SecretScanner,
94
+
95
+ // Quick utilities
96
+ quickScan,
97
+ quickHealthCheck,
98
+ quickDriftCheck,
99
+ quickSecretScan
100
+ };
@@ -22,12 +22,12 @@ const TIERS = {
22
22
  free: {
23
23
  name: 'Free',
24
24
  maxFiles: 100,
25
- scansPerMonth: 3,
25
+ scansPerMonth: 5,
26
26
  showFullDetails: false,
27
27
  showDashboard: false,
28
28
  showAutoFix: false,
29
29
  showCIAction: false,
30
- teaserIssues: 1, // Show 1 real example, hide the rest
30
+ teaserIssues: 3, // Show 3 real examples, hide the rest
31
31
  maxHallucinationDetail: 3, // Show top 3, hide rest
32
32
  },
33
33
  pro: {
@@ -176,10 +176,23 @@ class LicenseManager {
176
176
  dashboard: config.showDashboard,
177
177
  autoFix: config.showAutoFix,
178
178
  ciAction: config.showCIAction,
179
+ scheduledScans: tier !== 'free',
179
180
  },
180
181
  };
181
182
  }
182
183
 
184
+ canUseProFeature(featureName = 'This feature') {
185
+ const tier = this.getTier();
186
+ if (tier === 'free') {
187
+ return {
188
+ allowed: false,
189
+ message: `${featureName} is available on Thuban Pro and above.`,
190
+ };
191
+ }
192
+
193
+ return { allowed: true, tier };
194
+ }
195
+
183
196
  // ─── Private ─────────────────────────────────────────────
184
197
 
185
198
  _ensureDir() {