@ayurak/sdk 1.4.0 → 1.5.0

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/README.md +310 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -277,8 +277,16 @@ console.log(`Monthly cost: $${cost.total_monthly_cost}`);
277
277
  // Get component cost
278
278
  const componentCost = await client.economics.getComponentCost(componentId);
279
279
 
280
- // Get economic intelligence
280
+ // Get economic intelligence (includes Strategic Cost Optimization)
281
281
  const intel = await client.economics.getEconomicIntelligence();
282
+ // Returns: { status: 'success', provider: 'aws', pricing: {...},
283
+ // strategic_optimization: { current: {...}, previous: {...} } }
284
+
285
+ // Refresh Strategic Cost Optimization recommendations (AI-powered)
286
+ // Moves current recommendations to "previous" and generates new ones
287
+ const refresh = await client.economics.refreshRecommendations();
288
+ // Returns: { status: 'success', message: 'Recommendations refreshed',
289
+ // current: {...}, previous: {...} }
282
290
 
283
291
  // Get market intelligence
284
292
  const market = await client.economics.getMarketIntelligence();
@@ -315,6 +323,292 @@ const paths = await client.redTeam.generateAttackPaths(diagramId, {
315
323
  const requirements = await client.redTeam.getSecurityRequirements(diagramId);
316
324
  ```
317
325
 
326
+ ### Severity Assignment (AI-powered)
327
+
328
+ ```typescript
329
+ // Estimate AI cost for severity assignment
330
+ const estimate = await client.compliance.estimateSeverityCost({
331
+ scanId: scanId,
332
+ accountId: accountId
333
+ });
334
+ // Returns: { estimated_tokens: 15000, estimated_cost_usd: 0.45, violations_count: 150 }
335
+
336
+ // Assign severity using AI (automatically analyzes all violations)
337
+ const result = await client.compliance.assignSeverityAI({
338
+ scanId: scanId,
339
+ accountId: accountId,
340
+ model: 'claude-3-sonnet', // or 'gpt-4', 'gemini-pro'
341
+ batchSize: 50
342
+ });
343
+ // Returns: { status: 'completed', processed: 150, updated: 142, errors: 0 }
344
+
345
+ // Manually assign severity to violations
346
+ const manualResult = await client.compliance.assignSeverityManual({
347
+ violationIds: ['v-123', 'v-456'],
348
+ severity: 'high' // critical, high, medium, low, info
349
+ });
350
+ // Returns: { updated: 2, violations: [...] }
351
+ ```
352
+
353
+ ### Scanner Rules
354
+
355
+ ```typescript
356
+ // List scanner rules
357
+ const rules = await client.compliance.listScannerRules({
358
+ severity: 'critical',
359
+ provider: 'aws'
360
+ });
361
+ // Returns: [{ id: '...', name: 'S3 Public Access', severity: 'critical' }, ...]
362
+
363
+ // Get scanner rule statistics
364
+ const stats = await client.compliance.getScannerStatistics();
365
+ // Returns: { total_rules: 500, by_severity: {...}, by_provider: {...} }
366
+
367
+ // Sync rules from cloud providers
368
+ const syncResult = await client.compliance.syncScannerRules({
369
+ providers: ['aws', 'azure', 'gcp']
370
+ });
371
+ // Returns: { synced: 150, new: 25, updated: 10 }
372
+
373
+ // Create custom scanner rule
374
+ const rule = await client.compliance.createScannerRule({
375
+ name: 'Custom S3 Encryption Check',
376
+ description: 'Ensure all S3 buckets have encryption enabled',
377
+ severity: 'high',
378
+ provider: 'aws',
379
+ resourceType: 's3_bucket',
380
+ condition: {
381
+ field: 'encryption.enabled',
382
+ operator: 'equals',
383
+ value: true
384
+ }
385
+ });
386
+ ```
387
+
388
+ ### Dynamic Cloud Scanning
389
+
390
+ ```typescript
391
+ // Execute dynamic scan on cloud account
392
+ const scan = await client.compliance.executeDynamicScan({
393
+ accountId: accountId,
394
+ scanType: 'full', // full, quick, targeted
395
+ resources: ['ec2', 's3', 'iam'],
396
+ standards: ['CIS-AWS', 'SOC2']
397
+ });
398
+ // Returns: { scan_id: '...', status: 'running', estimated_duration: 300 }
399
+
400
+ // Execute unified scan with flexible scope
401
+ const unifiedScan = await client.compliance.executeUnifiedScan({
402
+ scope: 'account', // account, standard, diagram
403
+ scopeId: accountId,
404
+ includeRemediation: true
405
+ });
406
+ // Returns: { scan_id: '...', status: 'queued' }
407
+ ```
408
+
409
+ ### Remediation Execution
410
+
411
+ ```typescript
412
+ // Preview remediation before execution
413
+ const preview = await client.compliance.previewRemediation({
414
+ policyId: policyId,
415
+ accountId: accountId
416
+ });
417
+ // Returns: { actions: [...], risk_level: 'low', affected_resources: 5 }
418
+
419
+ // Execute remediation
420
+ const result = await client.compliance.executeRemediation({
421
+ policyId: policyId,
422
+ accountId: accountId,
423
+ dryRun: false,
424
+ autoApprove: true
425
+ });
426
+ // Returns: { status: 'completed', resources_fixed: 5, rollback_available: true }
427
+ ```
428
+
429
+ ### AI Agents & Self-Healing
430
+
431
+ ```typescript
432
+ // Get AI agent status
433
+ const status = await client.aiAgents.getStatus();
434
+ // Returns: { active: true, agents: [...], capabilities: [...] }
435
+
436
+ // Run specialist agent analysis
437
+ const analysis = await client.aiAgents.runSpecialist({
438
+ agentType: 'security', // security, compliance, cost, architecture
439
+ diagramId: diagramId
440
+ });
441
+
442
+ // Self-healing operations
443
+ const healingStatus = await client.aiAgents.getSelfHealingStatus();
444
+ // Returns: { enabled: true, recent_actions: [...], autonomy_level: 'supervised' }
445
+
446
+ // Get autonomy stats
447
+ const autonomyStats = await client.aiAgents.getAutonomyStats();
448
+ // Returns: { total_remediations: 150, auto_approved: 120, manual_review: 30 }
449
+
450
+ // Trigger remediation
451
+ const remediation = await client.aiAgents.triggerRemediation({
452
+ findingId: findingId,
453
+ autoApprove: false
454
+ });
455
+
456
+ // Approve/reject remediation action
457
+ await client.aiAgents.approveRemediation(remediationId);
458
+ await client.aiAgents.rejectRemediation(remediationId, 'Risk too high');
459
+
460
+ // Rollback remediation
461
+ await client.aiAgents.rollbackRemediation(remediationId);
462
+
463
+ // Emergency stop all autonomous actions
464
+ await client.aiAgents.emergencyStop();
465
+
466
+ // Resume autonomous operations
467
+ await client.aiAgents.resumeOperations();
468
+ ```
469
+
470
+ ### Security Co-Pilot
471
+
472
+ ```typescript
473
+ // Get security co-pilot status
474
+ const status = await client.securityCopilot.getStatus();
475
+ // Returns: { enabled: true, mode: 'supervised', active_threats: 5 }
476
+
477
+ // Get pending actions awaiting approval
478
+ const actions = await client.securityCopilot.getPendingActions();
479
+ // Returns: [{ id: '...', type: 'patch', resource: '...', risk: 'low' }, ...]
480
+
481
+ // Get action history
482
+ const history = await client.securityCopilot.getActionHistory({ limit: 50 });
483
+
484
+ // Get active threats
485
+ const threats = await client.securityCopilot.getActiveThreats();
486
+
487
+ // Approve/reject action
488
+ await client.securityCopilot.approveAction(actionId);
489
+ await client.securityCopilot.rejectAction(actionId);
490
+
491
+ // Rollback action
492
+ await client.securityCopilot.rollbackAction(actionId);
493
+
494
+ // Trigger security scan
495
+ const scan = await client.securityCopilot.triggerScan({ scope: 'full' });
496
+
497
+ // Update settings
498
+ await client.securityCopilot.updateSettings({
499
+ autoRemediation: true,
500
+ maxRiskLevel: 'medium'
501
+ });
502
+
503
+ // Toggle co-pilot on/off
504
+ await client.securityCopilot.toggle(true);
505
+ ```
506
+
507
+ ### Presets Import
508
+
509
+ ```typescript
510
+ // Import compliance presets
511
+ const presets = await client.compliance.importPresets({
512
+ provider: 'aws', // aws, azure, gcp, all
513
+ categories: ['security', 'cost', 'operations']
514
+ });
515
+ // Returns: { imported: 50, standards: [...], rules: [...] }
516
+ ```
517
+
518
+ ### Strategic Remediation Plan (AI-powered)
519
+
520
+ ```typescript
521
+ // Generate strategic remediation plan for a severity level
522
+ // Uses AI to analyze all violations and create a comprehensive plan
523
+ const plan = await client.compliance.generateStrategicPlan({
524
+ scanId: scanId,
525
+ accountId: accountId,
526
+ severity: 'critical' // critical, high, medium, low
527
+ });
528
+ // Returns: {
529
+ // id: 'uuid',
530
+ // severity: 'critical',
531
+ // status: 'generated',
532
+ // overview: 'Strategic overview of all critical violations...',
533
+ // rootCauses: [{ cause: '...', theme: '...', impact: '...' }],
534
+ // groupedViolations: [{ policy: '...', violations: [...] }],
535
+ // highImpactActions: [{ action: '...', impactScore: 95 }],
536
+ // remediationPhases: [{ phase: 1, duration: '1 week', actions: [...] }],
537
+ // successMetrics: [{ metric: '...', target: '...' }],
538
+ // estimatedTotalEffort: '2-3 weeks',
539
+ // costSavingsFinops: { monthly: 5000, annual: 60000 },
540
+ // costSavingsRisk: { riskReduction: '85%', avoidedIncidents: 12 }
541
+ // }
542
+
543
+ // Get existing strategic plan
544
+ const existing = await client.compliance.getStrategicPlan(planId);
545
+
546
+ // List strategic plans for an account
547
+ const plans = await client.compliance.listStrategicPlans({
548
+ accountId: accountId,
549
+ severity: 'critical'
550
+ });
551
+ ```
552
+
553
+ ### Mitigation Plan (AI-powered)
554
+
555
+ ```typescript
556
+ // Get existing mitigation plan for a diagram
557
+ const plan = await client.threatModeling.getMitigationPlan(diagramId);
558
+ if (plan) {
559
+ console.log(`Overview: ${plan.plan.overview}`);
560
+ console.log(`Recommendations: ${plan.plan.recommendations.length}`);
561
+ plan.plan.recommendations.forEach(rec => {
562
+ console.log(` [${rec.rank}] ${rec.title} - ${rec.priority}`);
563
+ });
564
+ }
565
+
566
+ // Generate new mitigation plan (AI-powered, uses chunked processing)
567
+ const newPlan = await client.threatModeling.generateMitigationPlan(diagramId, {
568
+ forceRegenerate: true // Force regenerate even if cached
569
+ });
570
+ // Returns comprehensive plan with:
571
+ // - overview: Strategic summary of all threats
572
+ // - recommendations: Ranked list with code snippets
573
+ // - rootCauses: Identified patterns across threats
574
+ // - remediationPhases: Phased approach with timelines
575
+ // - successMetrics: Measurable criteria
576
+ // - metadata: AI provider, generation time, etc.
577
+
578
+ console.log(`Generated in ${newPlan.plan.metadata.generationTimeMs}ms`);
579
+ console.log(`Threats analyzed: ${newPlan.plan.metadata.threatCount}`);
580
+
581
+ // Access recommendations with code snippets
582
+ newPlan.plan.recommendations.forEach(rec => {
583
+ console.log(`[${rec.priority}] ${rec.title}`);
584
+ console.log(` Impact: ${rec.impact}`);
585
+ console.log(` Effort: ${rec.effort}`);
586
+ console.log(` Affected threats: ${rec.affectedThreats?.join(', ')}`);
587
+ if (rec.codeSnippet) {
588
+ console.log(` Code (${rec.codeLanguage}):`);
589
+ console.log(` ${rec.codeSnippet}`);
590
+ }
591
+ });
592
+
593
+ // View root causes (patterns identified across multiple threats)
594
+ newPlan.plan.rootCauses.forEach(cause => {
595
+ console.log(`Root cause: ${cause.cause}`);
596
+ console.log(` Theme: ${cause.theme}, Impact: ${cause.impact}`);
597
+ });
598
+
599
+ // View phased remediation plan
600
+ newPlan.plan.remediationPhases.forEach(phase => {
601
+ console.log(`Phase: ${phase.phase} (${phase.duration})`);
602
+ console.log(` Actions: ${phase.actions.join(', ')}`);
603
+ console.log(` Threats resolved: ${phase.threatsResolved}`);
604
+ });
605
+
606
+ // Update plan with manual edits
607
+ const updatedPlan = { ...newPlan.plan };
608
+ updatedPlan.recommendations[0].priority = 'immediate';
609
+ await client.threatModeling.updateMitigationPlan(diagramId, updatedPlan);
610
+ ```
611
+
318
612
  ## Error Handling
319
613
 
320
614
  ```typescript
@@ -445,6 +739,18 @@ input?.addEventListener('change', async (e) => {
445
739
 
446
740
  ## Changelog
447
741
 
742
+ ### v1.5.0
743
+ - **Added**: Strategic Remediation Plan API (`client.compliance.generateStrategicPlan`, `getStrategicPlan`, `listStrategicPlans`) - AI-powered strategic planning for compliance violations with cost savings analysis
744
+ - **Added**: Economic Intelligence Refresh (`client.economics.refreshRecommendations`) - Refresh AI-powered cost optimization recommendations
745
+ - **Added**: Severity Assignment API (`client.compliance.estimateSeverityCost`, `assignSeverityAI`, `assignSeverityManual`)
746
+ - **Added**: Scanner Rules API (`client.compliance.listScannerRules`, `getScannerStatistics`, `syncScannerRules`, `createScannerRule`)
747
+ - **Added**: Dynamic Cloud Scanning (`client.compliance.executeDynamicScan`, `executeUnifiedScan`)
748
+ - **Added**: Remediation Execution (`client.compliance.previewRemediation`, `executeRemediation`)
749
+ - **Added**: AI Agents & Self-Healing module (`client.aiAgents`) with autonomous remediation
750
+ - **Added**: Security Co-Pilot module (`client.securityCopilot`) for supervised security operations
751
+ - **Added**: Presets Import (`client.compliance.importPresets`)
752
+ - **Added**: Mitigation Plan API (`client.threatModeling.getMitigationPlan`, `generateMitigationPlan`, `updateMitigationPlan`) - AI-powered strategic remediation planning with chunked processing
753
+
448
754
  ### v1.4.0
449
755
  - **Fixed**: Base URL corrected from `api.aribot.aristiun.com` to `api.aribot.ayurak.com`
450
756
  - **Added**: AI module (`client.ai`) - usage, quota, models, configure, analyze, queue status
@@ -457,9 +763,9 @@ input?.addEventListener('change', async (e) => {
457
763
 
458
764
  ## Support
459
765
 
460
- - Documentation: https://developers.aristiun.com/docs/js-sdk
461
- - API Reference: https://developers.aristiun.com/api
462
- - Issues: https://github.com/Aristiun/aribot-js/issues
766
+ - Documentation: https://developer.ayurak.com/docs/js-sdk
767
+ - API Reference: https://developer.ayurak.com/api
768
+ - Issues: https://github.com/ayurak/aribot-js/issues
463
769
 
464
770
  ## License
465
771
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayurak/sdk",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Aribot Security Platform SDK by Aristiun & Ayurak - Threat modeling, compliance, and cloud security APIs",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",