@ayurak/aribot-cli 1.0.5 → 1.0.7

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.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Aribot - Economic, Regulatory & Security APIs for Modern Applications
3
+ *
4
+ * Analyze your tech stack. Optimize architecture. Model costs. Identify threats dynamically.
5
+ * APIs that help you build better systems with practical, actionable recommendations.
6
+ *
7
+ * Features:
8
+ * - Advanced Threat Modeling (STRIDE, PASTA, NIST, Aristiun Framework)
9
+ * - Cloud Security (CSPM/CNAPP)
10
+ * - 100+ Compliance Standards
11
+ * - Economic Intelligence & FinOps
12
+ * - Red Team Automation
13
+ * - Secure AI Usage Management
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ export { AribotClient, AribotConfig, Diagram, Threat, ComplianceAssessment, SecurityFinding, PaginatedResponse, AribotError, AuthenticationError, RateLimitError, APIError, analyzeDiagram, runComplianceCheck, RequestSigner, SecureCredentialManager, } from './sdk';
18
+ import { AribotClient } from './sdk';
19
+ export default AribotClient;
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * Aribot - Economic, Regulatory & Security APIs for Modern Applications
4
+ *
5
+ * Analyze your tech stack. Optimize architecture. Model costs. Identify threats dynamically.
6
+ * APIs that help you build better systems with practical, actionable recommendations.
7
+ *
8
+ * Features:
9
+ * - Advanced Threat Modeling (STRIDE, PASTA, NIST, Aristiun Framework)
10
+ * - Cloud Security (CSPM/CNAPP)
11
+ * - 100+ Compliance Standards
12
+ * - Economic Intelligence & FinOps
13
+ * - Red Team Automation
14
+ * - Secure AI Usage Management
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.SecureCredentialManager = exports.RequestSigner = exports.runComplianceCheck = exports.analyzeDiagram = exports.APIError = exports.RateLimitError = exports.AuthenticationError = exports.AribotError = exports.AribotClient = void 0;
20
+ var sdk_1 = require("./sdk");
21
+ // Main client
22
+ Object.defineProperty(exports, "AribotClient", { enumerable: true, get: function () { return sdk_1.AribotClient; } });
23
+ // Errors
24
+ Object.defineProperty(exports, "AribotError", { enumerable: true, get: function () { return sdk_1.AribotError; } });
25
+ Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return sdk_1.AuthenticationError; } });
26
+ Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return sdk_1.RateLimitError; } });
27
+ Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return sdk_1.APIError; } });
28
+ // Convenience functions
29
+ Object.defineProperty(exports, "analyzeDiagram", { enumerable: true, get: function () { return sdk_1.analyzeDiagram; } });
30
+ Object.defineProperty(exports, "runComplianceCheck", { enumerable: true, get: function () { return sdk_1.runComplianceCheck; } });
31
+ // Security utilities
32
+ Object.defineProperty(exports, "RequestSigner", { enumerable: true, get: function () { return sdk_1.RequestSigner; } });
33
+ Object.defineProperty(exports, "SecureCredentialManager", { enumerable: true, get: function () { return sdk_1.SecureCredentialManager; } });
34
+ const sdk_2 = require("./sdk");
35
+ exports.default = sdk_2.AribotClient;
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,349 @@
1
+ /**
2
+ * Aribot Node.js SDK - Economic, Regulatory & Security APIs for Modern Applications
3
+ *
4
+ * Analyze your tech stack. Optimize architecture. Model costs. Identify threats dynamically.
5
+ * APIs that help you build better systems with practical, actionable recommendations.
6
+ *
7
+ * Platform Capabilities:
8
+ * - Advanced Threat Modeling: Multi-framework (STRIDE, PASTA, NIST, Aristiun Framework)
9
+ * - Cloud Security: Real-time CSPM, CNAPP, misconfiguration detection
10
+ * - Living Architecture: Dynamic architecture diagrams with real-time updates
11
+ * - Economic Intelligence: Security ROI, TCO analysis, risk quantification in real dollars
12
+ * - FinOps: Cloud cost optimization, security spend tracking
13
+ * - Compliance: 100+ regulatory standards (SOC2, ISO27001, NIST, PCI-DSS, GDPR, HIPAA, etc.)
14
+ * - Red Team: Automated attack simulations, penetration testing orchestration
15
+ *
16
+ * Usage:
17
+ * import { AribotClient } from '@ayurak/aribot-cli';
18
+ *
19
+ * const client = new AribotClient({ apiKey: 'ak_...' });
20
+ *
21
+ * // Threat Modeling
22
+ * const diagram = await client.threatModeling.upload('architecture.png');
23
+ * const threats = await client.threatModeling.getThreats(diagram.id);
24
+ *
25
+ * // Compliance
26
+ * const assessment = await client.compliance.assess(diagramId, 'SOC2');
27
+ *
28
+ * // Red Team
29
+ * const simulation = await client.redteam.runSimulation(targetId, 'lateral_movement');
30
+ */
31
+ export interface AribotConfig {
32
+ apiKey?: string;
33
+ baseUrl?: string;
34
+ timeout?: number;
35
+ maxRetries?: number;
36
+ }
37
+ export interface Diagram {
38
+ id: string;
39
+ name: string;
40
+ filename?: string;
41
+ stage: string;
42
+ threats_count: number;
43
+ created_at: string;
44
+ updated_at?: string;
45
+ }
46
+ export interface Threat {
47
+ id: string;
48
+ title: string;
49
+ description?: string;
50
+ severity: string;
51
+ category: string;
52
+ stride_category?: string;
53
+ mitigation?: string;
54
+ cvss_score?: number;
55
+ attack_vector?: string;
56
+ }
57
+ export interface ComplianceAssessment {
58
+ id: string;
59
+ standard: string;
60
+ score: number;
61
+ passed_controls: number;
62
+ failed_controls: number;
63
+ status: string;
64
+ created_at: string;
65
+ }
66
+ export interface SecurityFinding {
67
+ id: string;
68
+ title: string;
69
+ severity: string;
70
+ resource_type: string;
71
+ resource_id: string;
72
+ policy: string;
73
+ remediation?: string;
74
+ status: string;
75
+ }
76
+ export interface PaginatedResponse<T> {
77
+ count: number;
78
+ next?: string;
79
+ previous?: string;
80
+ results: T[];
81
+ }
82
+ export declare class AribotError extends Error {
83
+ constructor(message: string);
84
+ }
85
+ export declare class AuthenticationError extends AribotError {
86
+ constructor(message?: string);
87
+ }
88
+ export declare class RateLimitError extends AribotError {
89
+ retryAfter?: number;
90
+ constructor(message?: string, retryAfter?: number);
91
+ }
92
+ export declare class APIError extends AribotError {
93
+ statusCode?: number;
94
+ response?: any;
95
+ constructor(message: string, statusCode?: number, response?: any);
96
+ }
97
+ export declare class AribotClient {
98
+ private apiKey;
99
+ private baseUrl;
100
+ private timeout;
101
+ private maxRetries;
102
+ threatModeling: ThreatModelingResource;
103
+ cloudSecurity: CloudSecurityResource;
104
+ compliance: ComplianceResource;
105
+ economics: EconomicsResource;
106
+ finops: FinOpsResource;
107
+ redteam: RedTeamResource;
108
+ architecture: ArchitectureResource;
109
+ user: UserResource;
110
+ ai: AIResource;
111
+ diagrams: ThreatModelingResource;
112
+ constructor(config?: AribotConfig);
113
+ private getHeaders;
114
+ private getAuthHeader;
115
+ request<T = any>(method: string, endpoint: string, options?: {
116
+ body?: any;
117
+ params?: Record<string, string | number>;
118
+ formData?: FormData;
119
+ }): Promise<T>;
120
+ private sleep;
121
+ }
122
+ declare class ThreatModelingResource {
123
+ private client;
124
+ constructor(client: AribotClient);
125
+ list(options?: {
126
+ limit?: number;
127
+ offset?: number;
128
+ }): Promise<PaginatedResponse<Diagram>>;
129
+ get(diagramId: string): Promise<Diagram>;
130
+ upload(filePath: string, options?: {
131
+ name?: string;
132
+ autoGenerateThreats?: boolean;
133
+ }): Promise<Diagram>;
134
+ getThreats(diagramId: string, options?: {
135
+ severity?: string;
136
+ }): Promise<Threat[]>;
137
+ generateThreats(diagramId: string, options?: {
138
+ waitForCompletion?: boolean;
139
+ timeout?: number;
140
+ }): Promise<Diagram>;
141
+ export(diagramId: string, options?: {
142
+ format?: string;
143
+ outputPath?: string;
144
+ }): Promise<any>;
145
+ }
146
+ declare class CloudSecurityResource {
147
+ private client;
148
+ constructor(client: AribotClient);
149
+ scanPosture(cloudProvider?: string): Promise<any>;
150
+ getFindings(options?: {
151
+ severity?: string;
152
+ status?: string;
153
+ limit?: number;
154
+ }): Promise<SecurityFinding[]>;
155
+ getDashboard(): Promise<any>;
156
+ remediate(findingId: string, autoFix?: boolean): Promise<any>;
157
+ }
158
+ declare class ComplianceResource {
159
+ private client;
160
+ static SUPPORTED_STANDARDS: string[];
161
+ constructor(client: AribotClient);
162
+ listStandards(): Promise<any[]>;
163
+ assess(diagramId: string, standard?: string, includeRecommendations?: boolean): Promise<ComplianceAssessment>;
164
+ getAssessment(assessmentId: string): Promise<ComplianceAssessment>;
165
+ listReports(limit?: number): Promise<ComplianceAssessment[]>;
166
+ runScan(targetId: string, standards?: string[], scanType?: string): Promise<any>;
167
+ getRemediation(findingId: string): Promise<any>;
168
+ getDashboard(): Promise<any>;
169
+ }
170
+ declare class EconomicsResource {
171
+ private client;
172
+ constructor(client: AribotClient);
173
+ calculateROI(securityInvestment: number, riskReductionPercent?: number, timeHorizonYears?: number): Promise<any>;
174
+ calculateTCO(cloudProvider: string, workloadType?: string, durationMonths?: number): Promise<any>;
175
+ analyzeCosts(diagramId: string): Promise<any>;
176
+ getMarketIntelligence(): Promise<any>;
177
+ getDashboard(): Promise<any>;
178
+ createForecast(months?: number): Promise<any>;
179
+ }
180
+ declare class FinOpsResource {
181
+ private client;
182
+ constructor(client: AribotClient);
183
+ getCloudCosts(options?: {
184
+ provider?: string;
185
+ period?: string;
186
+ }): Promise<any>;
187
+ getSecuritySpend(): Promise<any>;
188
+ getOptimizationRecommendations(): Promise<any[]>;
189
+ getPricing(service: string, provider?: string): Promise<any>;
190
+ }
191
+ declare class RedTeamResource {
192
+ private client;
193
+ static ATTACK_TYPES: string[];
194
+ constructor(client: AribotClient);
195
+ runSimulation(targetId: string, attackType?: string, intensity?: string): Promise<any>;
196
+ getAttackPaths(diagramId: string): Promise<any[]>;
197
+ listSimulations(limit?: number): Promise<any[]>;
198
+ getSimulation(simulationId: string): Promise<any>;
199
+ }
200
+ declare class ArchitectureResource {
201
+ private client;
202
+ constructor(client: AribotClient);
203
+ listComponents(diagramId: string): Promise<any[]>;
204
+ getComponent(diagramId: string, componentId: string): Promise<any>;
205
+ updateComponent(diagramId: string, componentId: string, updates: any): Promise<any>;
206
+ getConnections(diagramId: string): Promise<any[]>;
207
+ }
208
+ declare class UserResource {
209
+ private client;
210
+ constructor(client: AribotClient);
211
+ me(): Promise<any>;
212
+ apiKeys(): Promise<any[]>;
213
+ getUsage(): Promise<any>;
214
+ getRateLimits(): Promise<any>;
215
+ }
216
+ declare class AIResource {
217
+ private client;
218
+ /**
219
+ * Secure AI usage management and configuration.
220
+ *
221
+ * Features:
222
+ * - AI model selection and configuration
223
+ * - Usage tracking and quotas
224
+ * - Cost monitoring for AI operations
225
+ * - Secure prompt/response handling
226
+ * - AI processing queue management
227
+ *
228
+ * Security:
229
+ * - All AI requests are signed and authenticated
230
+ * - Sensitive data is sanitized before AI processing
231
+ * - Usage is tracked per API key for audit compliance
232
+ * - Rate limiting prevents abuse
233
+ */
234
+ static AI_OPERATIONS: string[];
235
+ static MODEL_TIERS: string[];
236
+ constructor(client: AribotClient);
237
+ /**
238
+ * Get AI usage statistics for the current billing period.
239
+ */
240
+ getUsage(): Promise<any>;
241
+ /**
242
+ * Get current AI quota and limits.
243
+ */
244
+ getQuota(): Promise<any>;
245
+ /**
246
+ * List available AI models for your subscription tier.
247
+ */
248
+ getModels(): Promise<any[]>;
249
+ /**
250
+ * Configure AI settings for your account.
251
+ */
252
+ configure(options?: {
253
+ modelTier?: string;
254
+ maxTokens?: number;
255
+ temperature?: number;
256
+ enableCaching?: boolean;
257
+ }): Promise<any>;
258
+ /**
259
+ * Run AI analysis on content.
260
+ */
261
+ analyze(content: string, options?: {
262
+ operation?: string;
263
+ context?: Record<string, any>;
264
+ sanitizePii?: boolean;
265
+ }): Promise<any>;
266
+ /**
267
+ * Get status of pending AI processing jobs.
268
+ */
269
+ getQueueStatus(): Promise<any>;
270
+ /**
271
+ * List AI processing jobs.
272
+ */
273
+ listJobs(options?: {
274
+ status?: string;
275
+ limit?: number;
276
+ }): Promise<any[]>;
277
+ /**
278
+ * Get details of a specific AI job.
279
+ */
280
+ getJob(jobId: string): Promise<any>;
281
+ /**
282
+ * Cancel a pending AI job.
283
+ */
284
+ cancelJob(jobId: string): Promise<any>;
285
+ /**
286
+ * Get cost estimate for an AI operation before executing.
287
+ */
288
+ getCostEstimate(operation: string, contentLength: number, modelTier?: string): Promise<any>;
289
+ /**
290
+ * Get AI usage audit log for compliance.
291
+ */
292
+ getAuditLog(options?: {
293
+ startDate?: string;
294
+ endDate?: string;
295
+ limit?: number;
296
+ }): Promise<any[]>;
297
+ }
298
+ /**
299
+ * HMAC-SHA256 request signing for API request integrity.
300
+ */
301
+ export declare class RequestSigner {
302
+ /**
303
+ * Generate HMAC-SHA256 signature for request.
304
+ */
305
+ static sign(apiKey: string, method: string, path: string, timestamp: string, body?: string): string;
306
+ /**
307
+ * Verify request signature and timestamp freshness.
308
+ */
309
+ static verify(apiKey: string, signature: string, method: string, path: string, timestamp: string, body?: string, maxAgeSeconds?: number): boolean;
310
+ }
311
+ /**
312
+ * Secure credential storage utilities.
313
+ */
314
+ export declare class SecureCredentialManager {
315
+ private static SERVICE_NAME;
316
+ /**
317
+ * Store API key securely using environment variable.
318
+ * For production, use OS keyring via native modules.
319
+ */
320
+ static setApiKey(apiKey: string): void;
321
+ /**
322
+ * Retrieve API key from environment.
323
+ */
324
+ static getApiKey(): string | undefined;
325
+ /**
326
+ * Clear stored API key.
327
+ */
328
+ static clearApiKey(): void;
329
+ /**
330
+ * Validate API key format.
331
+ */
332
+ static isValidFormat(apiKey: string): boolean;
333
+ }
334
+ /**
335
+ * Quick function to analyze a diagram and get threats.
336
+ */
337
+ export declare function analyzeDiagram(filePath: string, options?: {
338
+ apiKey?: string;
339
+ name?: string;
340
+ waitForThreats?: boolean;
341
+ }): Promise<{
342
+ diagram: Diagram;
343
+ threats: Threat[];
344
+ }>;
345
+ /**
346
+ * Quick compliance check against multiple standards.
347
+ */
348
+ export declare function runComplianceCheck(diagramId: string, standards?: string[], apiKey?: string): Promise<any>;
349
+ export default AribotClient;