synapse-hub 2.1.0 → 2.2.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 (60) hide show
  1. package/.agents/agents/orchestrator.md +7 -0
  2. package/.agents/rules/lessons-learned.md +1 -0
  3. package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +1 -1
  4. package/.agents/skills/antigravity-test-sentinel/SKILL.md +1 -2
  5. package/.agents/skills/api-network-mocking-interception/SKILL.md +1 -1
  6. package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +11 -4
  7. package/.agents/skills/architecture-decision-records/SKILL.md +1 -1
  8. package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +1 -1
  9. package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +32 -11
  10. package/.agents/skills/bats-testing-patterns/SKILL.md +1 -1
  11. package/.agents/skills/clean-pom-crafter/SKILL.md +1 -4
  12. package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +1 -1
  13. package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +1 -1
  14. package/.agents/skills/e2e-testing-patterns/SKILL.md +1 -1
  15. package/.agents/skills/failure-autopsy-and-healing/SKILL.md +1 -3
  16. package/.agents/skills/file-and-report-validator/SKILL.md +1 -1
  17. package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +1 -1
  18. package/.agents/skills/github-actions-templates/SKILL.md +1 -1
  19. package/.agents/skills/graphify-impact-analyzer/SKILL.md +1 -3
  20. package/.agents/skills/katalon-cli-runner/SKILL.md +1 -1
  21. package/.agents/skills/lam-script-generator/SKILL.md +1 -2
  22. package/.agents/skills/playwright-live-interaction/SKILL.md +1 -4
  23. package/.agents/skills/security-dast-sentinel/SKILL.md +1 -1
  24. package/.agents/skills/self-healing-locator/SKILL.md +1 -2
  25. package/.agents/skills/skillspector-security-guard/SKILL.md +115 -0
  26. package/.agents/skills/synthetic-test-data-generator/SKILL.md +1 -1
  27. package/.agents/skills/token-and-context-optimizer/SKILL.md +1 -1
  28. package/.agents/skills/visual-regression-sentinel/SKILL.md +1 -1
  29. package/.agents/skills/wcag-audit-patterns/SKILL.md +1 -1
  30. package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +1 -1
  31. package/AGENTS.md +36 -0
  32. package/README.md +140 -103
  33. package/package.json +1 -1
  34. package/skills_manifest.json +42 -29
  35. package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +15 -1
  36. package/templates/ai_bridges/CLAUDE.md +31 -0
  37. package/templates/ai_bridges/copilot-instructions.md +25 -0
  38. package/templates/ai_bridges/cursor_synapse_qa.mdc +26 -0
  39. package/templates/ai_bridges/windsurfrules +25 -0
  40. package/templates/ci/github-actions-synapse.yml +28 -0
  41. package/templates/ci/gitlab-ci-synapse.yml +16 -0
  42. package/tools/TOOLS_RUNBOOK.md +203 -12
  43. package/tools/browser_helpers.js +2 -2
  44. package/tools/bump_version.py +8 -0
  45. package/tools/cli.py +74 -2
  46. package/tools/export_postman_collection.py +535 -218
  47. package/tools/generate_jmx_plan.py +672 -102
  48. package/tools/git_pre_commit_guard.py +21 -0
  49. package/tools/jtl_analyzer.py +474 -0
  50. package/tools/mcp_excel_server.ps1 +1 -1
  51. package/tools/mcp_server.py +1 -1
  52. package/tools/newman_analyzer.py +385 -0
  53. package/tools/setup_project.py +203 -18
  54. package/tools/skillspector.py +1141 -0
  55. package/tools/telemetry_correlator.py +351 -0
  56. package/tools/templates/jmeter-distributed/README.md +54 -0
  57. package/tools/templates/jmeter-distributed/docker-compose.yml +83 -0
  58. package/tools/update_sentinel.py +313 -0
  59. package/tools/repo_map.json +0 -12
  60. package/tools/repo_map.txt +0 -7
@@ -35,7 +35,10 @@
35
35
  | **Generating test scripts from Natural Language Story** | `tools/generate_tc_from_story.py`| `python tools/generate_tc_from_story.py "<story>"` |
36
36
  | **Generating E2E matrix from OpenAPI/Swagger** | `tools/generate_api_matrix.py` | `python tools/generate_api_matrix.py --spec <swagger.json>` |
37
37
  | **Exporting API tests to Postman Collection v2.1** | `tools/export_postman_collection.py` | `agent-qa export-postman --spec <swagger.json> -o col.json` |
38
+ | **Analyzing Newman Results & CI/CD Gatekeeper** | `tools/newman_analyzer.py` | `agent-qa analyze-newman report.json --max-failures 0` |
38
39
  | **Generating JMeter Performance Test Plan (.jmx)** | `tools/generate_jmx_plan.py` | `agent-qa generate-jmx --spec <swagger.json> --vus 100 -o plan.jmx` |
40
+ | **Analyzing JMeter JTL & Enforcing CI/CD SLA Gate** | `tools/jtl_analyzer.py` | `agent-qa analyze-jtl results.jtl --sla-p95 500 --max-error-rate 1.0` |
41
+ | **Full-Stack APM & Server Telemetry RCA Correlator** | `tools/telemetry_correlator.py` | `agent-qa correlate-telemetry --jtl results.jtl --server-metrics srv.csv` |
39
42
  | **Auditing Web Accessibility (WCAG 2.2)** | `tools/wcag_audit.py` | `python tools/wcag_audit.py <path_to_html_or_url>` |
40
43
  | **0-Token Polyglot Test Transpilation** | `tools/omni_transpiler.py` | `agent-qa transpile <file> --to <target>` (Playwright TS, Python, Java, Katalon, Cypress) |
41
44
  | **0-Token Repository Polyglot AST Scan** | `tools/omni_transpiler.py` | `agent-qa omni-scan [path]` (Instant inventory of Pages, Locators, Tests across languages) |
@@ -52,11 +55,28 @@
52
55
  | **Lookup XPath Locator in cached memory** | `tools/lookup_xpath.py` | `python tools/lookup_xpath.py "<keyword>"` |
53
56
  | **Lookup Test Case metadata** | `tools/lookup_tc.py` | `python tools/lookup_tc.py "<keyword_or_id>"` |
54
57
  | **Linting Markdown documentation quality** | `tools/lint_ai_docs.py` | `python tools/lint_ai_docs.py` |
58
+ | **Auditing AI Agent Skills & MCP Security** | `tools/skillspector.py` | `python tools/skillspector.py [path]` (or `agent-qa skillspector [path]` / `npx synapse-hub skillspector`) |
59
+ | **Upstream Version Check & 1-Click Self-Update** | `tools/update_sentinel.py` | `python tools/update_sentinel.py --check / --update` (or `agent-qa update` / `npx synapse-hub update`) |
55
60
 
56
61
  ---
57
62
 
58
63
  ## 2. DETAILED TOOL USAGE
59
64
 
65
+ ### 0. `tools/update_sentinel.py` (Upstream Update & Drift Sentinel)
66
+ Checks upstream releases on NPM Registry and GitHub, displaying non-blocking update notifications when a new version is published. Supports 1-click self-updating across local git repos and global plugins.
67
+
68
+ ```bash
69
+ # Check if update is available without applying
70
+ python tools/update_sentinel.py --check
71
+ # or via CLI
72
+ agent-qa update --check
73
+
74
+ # Perform 1-click self-update (pulls git, syncs memory cache, verifies DoD)
75
+ python tools/update_sentinel.py --update
76
+ # or via CLI
77
+ agent-qa update
78
+ ```
79
+
60
80
  ### 1. `tools/generate_api_matrix.py`
61
81
  - **Purpose:** Ingests OpenAPI / Swagger JSON schemas and automatically computes comprehensive E2E test matrices: Positive, Boundary Value (min/max length, special characters, XSS payloads), and Negative (invalid types, missing required fields).
62
82
  - **CLI Syntax:**
@@ -319,31 +339,202 @@
319
339
  ---
320
340
 
321
341
  ### 21. `tools/export_postman_collection.py`
322
- - **Purpose:** Enterprise OpenAPI/Swagger & HAR to Postman Collection v2.1.0 Exporter. Generates fully structured Postman collections with dynamic pre-request scripts, SLA latency tests, response code assertions, and autonomous bearer token / created entity ID extraction for Newman and CI/CD pipelines.
342
+ - **Purpose:** Enterprise OpenAPI/Swagger, HAR & Zero-Input Domain Postman Collection v2.1.0 Exporter (Postman Pinnacle Suite). Generates fully structured Postman collections with dynamic pre-request scripts, SLA latency tests, response code assertions, autonomous token/entity chaining, native **AJV JSON Schema Validation**, companion **Data-Driven Testing (DDT) CSV matrix**, and **Autonomous Zero-Input Domain Synthesis** (`--domain [ecommerce|banking|saas]`).
323
343
  - **CLI Syntax:**
324
344
  ```bash
325
- # Ingest OpenAPI spec and export Postman collection + companion environment
345
+ # 1. Ingest OpenAPI spec and export Postman collection + environment + AJV Schema asserts
326
346
  agent-qa export-postman --spec swagger.json -o collection.json --env-output env.json
327
347
 
328
- # Replay production HAR traffic as Postman requests
329
- agent-qa export-postman --har session.har -o har_collection.json
348
+ # 2. Autonomous Zero-Input Synthesis (No file provided! Synthesizes complete Banking/Ecom suite)
349
+ agent-qa export-postman --domain banking -o banking_col.json --env-output env.json --ddt-output ddt_data.csv
350
+ agent-qa export-postman --domain ecommerce -o ecom_col.json --ddt-output ecom_data.csv
330
351
 
331
- # Generate sample collection from built-in enterprise schema
332
- agent-qa export-postman --sample -o sample_collection.json
352
+ # 3. Replay production HAR traffic as Postman requests
353
+ agent-qa export-postman --har session.har -o har_collection.json
333
354
  ```
334
355
 
335
356
  ---
336
357
 
337
358
  ### 22. `tools/generate_jmx_plan.py`
338
- - **Purpose:** Apache JMeter 5.x Performance Test Plan XML (.jmx) Generator. Ingests OpenAPI specifications, Postman Collections, or HAR recordings to output production-ready JMeter load, stress, and spike test plans with configurable VUs, ramp-up schedules, SLA assertions (< 500ms), and dynamic session token propagation.
359
+ - **Purpose:** Apache JMeter 5.x Performance Test Plan XML (.jmx) Generator (JMeter 360° Pinnacle Suite). Ingests OpenAPI specifications, Postman Collections, or HAR recordings to output production-ready JMeter load, stress, spike, and soak test plans with HTTP Cookie & Cache Managers, CSV Data Set Config, Transaction Controllers, Pareto Traffic Shaping (`--weighted-mix`), Deep Data Correlation (CSRF regex & random dynamic selectors), JSR223 Groovy HMAC payload signers, InfluxDB live APM telemetry, PerfMon server agent monitoring, and Multi-Protocol support (HTTP, JDBC, WebSocket, gRPC, Kafka).
339
360
  - **CLI Syntax:**
340
361
  ```bash
341
- # Generate JMeter plan from OpenAPI with 100 Virtual Users for 10 minutes
342
- agent-qa generate-jmx --spec swagger.json -o load_plan.jmx --vus 100 --duration 600
362
+ # 1. Generate JMeter plan with Pareto traffic shaping (70% Browse, 20% Cart, 10% Checkout)
363
+ agent-qa generate-jmx --spec swagger.json -o load_plan.jmx --weighted-mix "70:Browse,20:Cart,10:Checkout"
364
+
365
+ # 2. Convert existing Postman collection with CSV data & Deep Correlation (CSRF + random items)
366
+ agent-qa generate-jmx --postman collection.json -o perf_plan.jmx --csv-data users.csv --deep-correlation
343
367
 
344
- # Convert existing Postman collection into JMeter performance test plan
345
- agent-qa generate-jmx --postman collection.json -o perf_plan.jmx --vus 50 --ramp-up 20
368
+ # 3. Generate multi-protocol test plans (WebSocket, gRPC, Kafka, JDBC)
369
+ agent-qa generate-jmx --ws-sample -o websocket_plan.jmx
370
+ agent-qa generate-jmx --grpc-sample -o grpc_plan.jmx
371
+ agent-qa generate-jmx --kafka-sample -o kafka_plan.jmx
372
+ agent-qa generate-jmx --jdbc-sample -o jdbc_plan.jmx
346
373
 
347
- # Run headless JMeter CLI
374
+ # 4. Generate with live InfluxDB streaming & PerfMon Server Agent
375
+ agent-qa generate-jmx --spec swagger.json -o perf_plan.jmx --influxdb-url http://influxdb:8086/write?db=jmeter --perfmon-server 192.168.1.50:4444
376
+
377
+ # 5. Run headless JMeter CLI
348
378
  jmeter -n -t load_plan.jmx -l results.jtl -e -o ./html_report
349
379
  ```
380
+
381
+ ---
382
+
383
+ ### 23. `tools/jtl_analyzer.py`
384
+ - **Purpose:** Apache JMeter JTL Results Analyzer & CI/CD SLA Quality Gatekeeper. Parses `.jtl` (CSV or XML), computes statistical percentiles ($P_{50}, P_{90}, P_{95}, P_{99}$, Throughput, Error Rate), evaluates user SLA thresholds, supports server telemetry correlation (`--telemetry`), and returns deterministic exit code `0` (Pass) or `1` (Fail) to enforce quality gates in automated pipelines.
385
+ - **CLI Syntax:**
386
+ ```bash
387
+ # 1. Enforce CI/CD Quality Gate with P95 Latency SLA (< 500ms) and max error rate (< 1%)
388
+ agent-qa analyze-jtl results.jtl --sla-p95 500 --max-error-rate 1.0
389
+
390
+ # 2. Correlate with Server-Side APM Telemetry directly in Quality Gate
391
+ agent-qa analyze-jtl results.jtl --sla-p95 500 --telemetry server_metrics.csv --markdown pr_report.md
392
+
393
+ # 3. Dry-run sample benchmark verification
394
+ agent-qa analyze-jtl --sample --sla-p95 500
395
+ ```
396
+
397
+ ---
398
+
399
+ ### 24. `tools/telemetry_correlator.py`
400
+ - **Purpose:** Full-Stack APM & Server Telemetry Performance Correlator. Performs time-aligned Pearson correlation between Client-Side perceived response times (`.jtl`) and Server-Side infrastructure metrics (CPU, RAM, Database Connection Pool, Disk I/O). Automatically isolates bottlenecks and produces Root Cause Analysis (RCA) diagnostic reports.
401
+ - **CLI Syntax:**
402
+ ```bash
403
+ # Correlate client JTL latency with server infrastructure telemetry
404
+ agent-qa correlate-telemetry --jtl results.jtl --server-metrics server_metrics.csv --markdown rca_report.md
405
+
406
+ # Dry-run sample correlation verification
407
+ agent-qa correlate-telemetry --sample
408
+ ```
409
+
410
+ ---
411
+
412
+ ### 25. `tools/skillspector.py` (AI Agent Skill & MCP Security Sentinel)
413
+ - **Purpose:** Autonomous security vulnerability and supply-chain auditor for AI Agent skills, prompt instructions, MCP tool configurations, and bundled automation scripts. Synthesized from **[NVIDIA/SkillSpector](https://github.com/NVIDIA/SkillSpector)** (Apache 2.0). Features 71 detection vectors across 17 categories, the NVIDIA Prohibition Context Engine to eliminate false positives in defensive rules, and multi-format outputs (Terminal, JSON, Markdown, SARIF 2.1.0).
414
+ - **Threat Categories Covered:**
415
+ - Prompt Injection (`P1`, `P2`, `P3`, `P4`, `P9`)
416
+ - Data Exfiltration & Credential Harvesting (`E1`–`E5`)
417
+ - Privilege Escalation & Container Escapes (`PE1`–`PE5`)
418
+ - Agent Configuration Snooping (`AS1`–`AS3` targeting `~/.claude`, `~/.gemini`, `mcp.json`)
419
+ - System Prompt Leakage (`P6`–`P8`)
420
+ - Anti-Refusal Statements & Jailbreaks (`AR1`–`AR3`)
421
+ - MCP Tool Poisoning & Unicode Homoglyphs (`TP1`–`TP4`)
422
+ - MCP Least Privilege (`LP1`–`LP4`)
423
+ - Behavioral AST & Dangerous Deserialization (`AST1`–`AST10`)
424
+ - Supply Chain & SSRF (`SC1`–`SC2`, `SSRF1`–`SSRF2`)
425
+ - **CLI Syntax:**
426
+ ```bash
427
+ # 1. Audit a skill directory or file with rich terminal output
428
+ python tools/skillspector.py .agents/skills/my-skill/
429
+ agent-qa skillspector .agents/skills/my-skill/
430
+ npx synapse-hub skillspector .agents/skills/my-skill/
431
+
432
+ # 2. Output SARIF 2.1.0 for GitHub Security tab integration
433
+ python tools/skillspector.py .agents/skills/ --format sarif --output reports/skillspector.sarif
434
+
435
+ # 3. Output JSON for CI/CD automated policy gate
436
+ python tools/skillspector.py .agents/skills/ --format json --output reports/skillspector.json
437
+
438
+ # 4. Strict CI gate: exit code 1 if any CRITICAL or DO_NOT_INSTALL findings exist
439
+ python tools/skillspector.py .agents/skills/ --strict
440
+ ```
441
+
442
+ ---
443
+
444
+ ### 26. `tools/newman_analyzer.py` (Newman CI/CD SLA Quality Gatekeeper)
445
+ - **Purpose:** Postman / Newman Automated Test Results Analyzer & CI/CD Gatekeeper. Ingests Newman JSON reports (`newman run -r json`), parses total requests, triages failed assertions with root causes, checks average latency SLA, and enforces deterministic exit code `0` (Pass) vs `1` (Fail) to prevent broken API contracts from deploying.
446
+ - **CLI Syntax:**
447
+ ```bash
448
+ # 1. Execute Newman with JSON report export
449
+ newman run collection.json -e env.json -r cli,json --reporter-json-export newman_report.json
450
+
451
+ # 2. Enforce CI/CD Quality Gate (Exit code 0 on Pass, 1 on Fail)
452
+ agent-qa analyze-newman newman_report.json --max-failures 0 --sla-avg 500
453
+
454
+ # 3. Export Pull Request Markdown report & JSON metrics
455
+ agent-qa analyze-newman newman_report.json --markdown pr_api_report.md --json api_metrics.json
456
+
457
+ # 4. Dry-run sample benchmark verification
458
+ agent-qa analyze-newman --sample
459
+ ```
460
+
461
+ ---
462
+
463
+ ### 27. `tools/auto_heal.py` & `tools/heuristic_locator_matcher.py` (Closed-Loop Test Failure Diagnosis & Locator Healing)
464
+ - **Purpose:** In-place autonomous test failure healer powered by `tools/heuristic_locator_matcher.py`. Correlates JUnit XML failures and screenshots (`Screenshots/FAILED_*.png`) with live DOM state, computes semantic element diffs via Role/Label/TestId hierarchy, and patches broken Page Class locators without full rerun.
465
+ - **CLI Syntax:**
466
+ ```bash
467
+ python tools/auto_heal.py
468
+ agent-qa auto-heal
469
+ ```
470
+
471
+ ---
472
+
473
+ ### 28. `tools/flaky_detector.py` (Flaky Test Sentinel & Quarantine Lifecycle)
474
+ - **Purpose:** Detects non-deterministic test flakiness across test suites, calculates historical flakiness scores, and manages automated test quarantine lifecycles to protect CI/CD pipelines from false alarms.
475
+ - **CLI Syntax:**
476
+ ```bash
477
+ python tools/flaky_detector.py --scan Reports/
478
+ agent-qa flaky --scan Reports/
479
+ ```
480
+
481
+ ---
482
+
483
+ ### 29. `tools/browser_helpers.js` (In-Browser Live AOM & Safe Interaction Prober)
484
+ - **Purpose:** Client-side JavaScript helper injected into headless Playwright/Chrome sessions. Provides `window.__helper` and `window.qa` APIs: `qa.getCompactAOM()` (extracts interactive nodes sub-200ms under 500 tokens), safe click overlay bypassing for PrimeNG/AntD backdrops, and live selector hit-rate verification.
485
+ - **Usage:** Injected automatically by `live-explorer` subagent and Playwright test fixtures.
486
+
487
+ ---
488
+
489
+ ### 30. `tools/project_state.py` (Compaction Anchoring & Persistent State Store)
490
+ - **Purpose:** Persists mission-critical project state (active test cases, defect registers, test data tracking) into disk-anchored files (`PROJECT_STATE.md` and `.project_state.properties`). Prevents loss of context during Antigravity automated context compaction.
491
+ - **Usage:** Autonomously invoked by the Lead Orchestrator agent across turn transitions.
492
+
493
+ ---
494
+
495
+ ### 31. `tools/universal_ir.py`, `tools/omni_parser.py`, `tools/omni_emitter.py`
496
+ - **Purpose:** Universal Intermediate Representation (IR) engine powering 0-token polyglot test transpilation (`agent-qa transpile`). Parses test scripts from Groovy, TypeScript, Python, or Java into a framework-agnostic AST and emits clean, idiomatic code for target test frameworks.
497
+ - **CLI Syntax:**
498
+ ```bash
499
+ agent-qa transpile Scripts/TC_Login.groovy --to playwright-ts
500
+ ```
501
+
502
+ ---
503
+
504
+ ### 32. `tools/check_env.py` (Prerequisites & Toolchain Diagnostic Checker)
505
+ - **Purpose:** Rapid diagnostic tool that checks required local execution toolchains: Python 3.9+, Node.js 18+, Java JDK 11+, Playwright browser binaries, Git, and Docker.
506
+ - **CLI Syntax:**
507
+ ```bash
508
+ python tools/check_env.py
509
+ ```
510
+
511
+ ---
512
+
513
+ ### 33. `tools/git_pre_commit_guard.py` (Zero-Leakage Git Pre-Commit Hook)
514
+ - **Purpose:** Git hook gatekeeper preventing accidental commits of UTF-8 BOM characters, hardcoded secrets/API keys, absolute machine paths, or temporary dump files into git repositories.
515
+ - **CLI Syntax:**
516
+ ```bash
517
+ python tools/git_pre_commit_guard.py
518
+ ```
519
+
520
+ ---
521
+
522
+ ### 34. `tools/validate_groovy_scripts.py` (Katalon / Groovy AST Syntax Guard)
523
+ - **Purpose:** Static verification scanner for Groovy and Katalon test scripts. Ensures 100% adherence to Clean POM Flat Architecture, zero raw XPaths in test cases, and valid import signatures.
524
+ - **CLI Syntax:**
525
+ ```bash
526
+ python tools/validate_groovy_scripts.py
527
+ ```
528
+
529
+ ---
530
+
531
+ ### 35. Platform Scripts & Automation Utilities
532
+ - `tools/verify_all.sh`: macOS / Linux Bash equivalent for the 8 Quality Gates DoD verification.
533
+ - `tools/generate_allure_report.ps1`: Automated generation and serving of Allure test execution dashboards.
534
+ - `tools/generate_test_reports.ps1`: Automated consolidation of polyglot test reports into centralized Markdown summaries.
535
+ - `tools/mcp_excel_server.ps1`: Specialized Model Context Protocol (MCP) server for structured Excel data interaction.
536
+ - `tools/e2e_flow_prober.ps1`: Automated E2E smoke flow prober across target web environments.
537
+ - `tools/bump_version.py`: Automated SemVer version bumper for Synapse-Hub releases.
538
+
539
+
540
+
@@ -13,7 +13,7 @@
13
13
  (function () {
14
14
  'use strict';
15
15
 
16
- if (window.__qa && window.__qa.__version === '2.1.0') {
16
+ if (window.__qa && window.__qa.__version === '2.2.0') {
17
17
  return window.__qa;
18
18
  }
19
19
 
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  const qa = {
50
- __version: '2.1.0',
50
+ __version: '2.2.0',
51
51
 
52
52
  /**
53
53
  * 1. Smart Action Batching
@@ -31,6 +31,14 @@ import json
31
31
  import argparse
32
32
  import subprocess
33
33
 
34
+ # Enforce UTF-8 stdout encoding for Windows console compatibility
35
+ if hasattr(sys.stdout, 'reconfigure'):
36
+ try:
37
+ sys.stdout.reconfigure(encoding='utf-8')
38
+ sys.stderr.reconfigure(encoding='utf-8')
39
+ except Exception:
40
+ pass
41
+
34
42
  REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
35
43
 
36
44
  def parse_semver(v_str: str):
package/tools/cli.py CHANGED
@@ -25,7 +25,7 @@ sys.path.insert(0, SCRIPT_DIR)
25
25
 
26
26
  def cmd_version(args):
27
27
  manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
28
- version = "2.1.0"
28
+ version = "2.2.0"
29
29
  if os.path.exists(manifest_path):
30
30
  try:
31
31
  import json
@@ -281,6 +281,45 @@ def cmd_generate_jmx(args):
281
281
  sys.exit(jmx_main())
282
282
 
283
283
 
284
+ def cmd_skillspector(args):
285
+ from skillspector import main as skillspector_main
286
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
287
+ sys.exit(skillspector_main())
288
+
289
+
290
+ def cmd_analyze_jtl(args):
291
+ from jtl_analyzer import main as jtl_main
292
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
293
+ sys.exit(jtl_main())
294
+
295
+
296
+ def cmd_correlate_telemetry(args):
297
+ from telemetry_correlator import main as telem_main
298
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
299
+ sys.exit(telem_main())
300
+
301
+
302
+ def cmd_analyze_newman(args):
303
+ from newman_analyzer import main as newman_main
304
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
305
+ sys.exit(newman_main())
306
+
307
+
308
+ def cmd_update(args):
309
+ import update_sentinel
310
+ if getattr(args, "check", False):
311
+ has_update, cur, rem = update_sentinel.check_for_updates(force=True, notify=False)
312
+ print(f"Current Hub Version : v{cur}")
313
+ print(f"Latest Upstream : v{rem if rem else 'Unknown'}")
314
+ if has_update:
315
+ print(f"⚠️ An update is available: v{cur} -> v{rem}. Run 'agent-qa update' to upgrade.")
316
+ sys.exit(1)
317
+ else:
318
+ print("✅ Synapse-Hub is up to date.")
319
+ sys.exit(0)
320
+ update_sentinel.perform_update()
321
+
322
+
284
323
  def main():
285
324
  parser = argparse.ArgumentParser(
286
325
  prog="agent-qa",
@@ -422,9 +461,34 @@ def main():
422
461
  p_postman.set_defaults(func=cmd_export_postman)
423
462
 
424
463
  # generate-jmx
425
- p_jmx = subparsers.add_parser("generate-jmx", help="Generate Apache JMeter 5.x Test Plan XML (.jmx) from OpenAPI / Postman / HAR")
464
+ p_jmx = subparsers.add_parser("generate-jmx", help="Generate Apache JMeter 5.x Test Plan XML (.jmx) with JMeter 360 Enterprise Capabilities")
426
465
  p_jmx.set_defaults(func=cmd_generate_jmx)
427
466
 
467
+ # analyze-jtl
468
+ p_jtl = subparsers.add_parser("analyze-jtl", help="Analyze JMeter .jtl results, evaluate P90/P95/P99 SLA, and enforce CI/CD Quality Gate")
469
+ p_jtl.set_defaults(func=cmd_analyze_jtl)
470
+
471
+ # correlate-telemetry
472
+ p_telemetry = subparsers.add_parser("correlate-telemetry", help="Correlate Client-Side JMeter latency with Server-Side APM CPU/RAM/DB telemetry")
473
+ p_telemetry.set_defaults(func=cmd_correlate_telemetry)
474
+
475
+ # analyze-newman
476
+ p_newman = subparsers.add_parser("analyze-newman", help="Analyze Postman / Newman test results, triage failed assertions, and enforce CI/CD Quality Gate")
477
+ p_newman.set_defaults(func=cmd_analyze_newman)
478
+
479
+ # update
480
+ p_update = subparsers.add_parser("update", help="1-Click update Synapse-Hub to latest version from GitHub/NPM")
481
+ p_update.add_argument("--check", action="store_true", help="Check for available updates without applying")
482
+ p_update.set_defaults(func=cmd_update)
483
+
484
+ # skillspector (AI Agent Skill & MCP Security Scanner)
485
+ p_skillspector = subparsers.add_parser("skillspector", help="AI Agent Skill & MCP Security Sentinel (71 vectors, NVIDIA SkillSpector spec)")
486
+ p_skillspector.add_argument("path", nargs="?", default=".", help="Skill directory or file to scan (default: current directory)")
487
+ p_skillspector.add_argument("--format", choices=["terminal", "json", "markdown", "sarif"], default="terminal", help="Output format")
488
+ p_skillspector.add_argument("--output", "-o", help="Write report to output file")
489
+ p_skillspector.add_argument("--strict", action="store_true", help="Fail with non-zero exit code on HIGH/CRITICAL finding")
490
+ p_skillspector.set_defaults(func=cmd_skillspector)
491
+
428
492
  args, unknown = parser.parse_known_args()
429
493
  if getattr(args, "offline", False):
430
494
  os.environ["AGENT_QA_OFFLINE"] = "1"
@@ -434,6 +498,14 @@ def main():
434
498
  parser.print_help()
435
499
  sys.exit(0)
436
500
 
501
+ # Non-intrusive cached update notification (24h cache)
502
+ if args.subcommand not in ("update", "mcp-serve", "version"):
503
+ try:
504
+ import update_sentinel
505
+ update_sentinel.check_for_updates(force=False, notify=True)
506
+ except Exception:
507
+ pass
508
+
437
509
  # Dispatch subcommand
438
510
  args.func(args)
439
511