@teevee98/synapse-hub 4.1.3 → 4.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.
- package/.agents/rules/git-push-protocol.md +2 -2
- package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +8 -3
- package/.agents/skills/01-web-automation/clean-pom-crafter/examples/standard_test_case.groovy +3 -0
- package/.agents/skills/01-web-automation/clean-pom-crafter/references/pom_patterns.groovy +3 -0
- package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/e2e-testing-patterns/examples/playwright_sharded_config.ts +3 -0
- package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/BaseScreen.java +2 -2
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/LoginScreen.java +2 -2
- package/.agents/skills/01-web-automation/mobile-appium-som/examples/TC_MobileLogin.java +2 -2
- package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +7 -2
- package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +6 -1
- package/.agents/skills/01-web-automation/playwright-webapp-testing/examples/server_lifecycle_playwright.py +3 -0
- package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +6 -1
- package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +6 -1
- package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +6 -1
- package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +6 -1
- package/.agents/skills/02-test-design/review-spec/SKILL.md +4 -1
- package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +6 -1
- package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +6 -1
- package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +6 -1
- package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +7 -2
- package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +7 -2
- package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +4 -1
- package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +6 -1
- package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +3 -0
- package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +6 -1
- package/.agents/skills/05-security-and-compliance/security-dast-sentinel/references/dast_recipes.ts +3 -0
- package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +6 -1
- package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +7 -2
- package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +6 -1
- package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +6 -1
- package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +6 -1
- package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +6 -1
- package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +6 -1
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +6 -1
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +3 -0
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +3 -0
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +6 -1
- package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +6 -1
- package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +4 -1
- package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +4 -1
- package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +6 -1
- package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +4 -1
- package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +6 -1
- package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +6 -1
- package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +6 -1
- package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +6 -1
- package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +6 -1
- package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +6 -1
- package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +6 -1
- package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +6 -1
- package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +6 -1
- package/.agents/skills/11-ai-and-prompting/qa-aci-interface/examples/surgical_code_window_walkthrough.md +1 -1
- package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +6 -1
- package/AGENTS.md +7 -1
- package/LICENSE +5 -5
- package/NOTICE +1 -1
- package/README.en.md +4 -4
- package/README.md +4 -4
- package/agentskills.json +1 -1
- package/docs/ARCHITECTURE.en.md +2 -2
- package/docs/ARCHITECTURE.md +11 -2
- package/docs/CLI_REFERENCE.en.md +6 -4
- package/docs/CLI_REFERENCE.md +1 -1
- package/docs/CONTRIBUTING.en.md +1 -1
- package/docs/CONTRIBUTING.md +2 -2
- package/docs/PERFORMANCE_AUDIT_REPORT.md +2 -2
- package/docs/TOOL_CATALOG.md +6 -2
- package/docs/research/agent_skill_training_analysis.md +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/scripts/generate_skill_examples.py +3 -0
- package/scripts/package_dist.py +3 -0
- package/skills_manifest.json +320 -55
- package/synapse.config.json +1 -1
- package/templates/ui/index.html +2 -2
- package/tools/.infer_baseline.json +3 -796
- package/tools/TOOL_CATALOG.json +63 -3
- package/tools/__init__.py +4 -1
- package/tools/agent_canary.py +3 -0
- package/tools/analyze_project.py +3 -0
- package/tools/api_drift_sentinel.py +3 -0
- package/tools/api_fuzzer.py +182 -118
- package/tools/ast_cache.py +4 -2
- package/tools/author_integrity.py +174 -12
- package/tools/auto_heal.py +7 -2
- package/tools/autogen_qa_broker.py +14 -15
- package/tools/benchmark_swarm_context.py +119 -18
- package/tools/break_ui_generator.py +233 -0
- package/tools/browser_helpers.js +2 -2
- package/tools/bug_reporter.py +3 -0
- package/tools/build_consolidated_report.py +3 -0
- package/tools/bump_version.py +4 -1
- package/tools/cache_resolver.py +7 -3
- package/tools/check_env.py +3 -0
- package/tools/check_version_sync.py +21 -50
- package/tools/ci_healing_hook.py +3 -0
- package/tools/cli.py +116 -22
- package/tools/config_decoupler.py +3 -0
- package/tools/core/__init__.py +3 -0
- package/tools/core/bm25_retriever.py +218 -0
- package/tools/core/file_lock.py +23 -14
- package/tools/core/i18n.py +13 -11
- package/tools/core/memory_bus.py +6 -3
- package/tools/core/process_supervisor.py +28 -18
- package/tools/core/provider_usage_adapter.py +317 -0
- package/tools/core/token_estimator.py +83 -18
- package/tools/count_tokens.py +16 -7
- package/tools/coverage_reporter.py +245 -0
- package/tools/create_mock_docx.py +3 -0
- package/tools/dashboard_generator.py +17 -15
- package/tools/db_sandbox.py +150 -5
- package/tools/debt_harvester.py +2 -2
- package/tools/diagram_architect.py +3 -0
- package/tools/distill_log.py +22 -2
- package/tools/distill_skill.py +191 -0
- package/tools/e2e_flow_prober.py +3 -0
- package/tools/export_postman_collection.py +3 -0
- package/tools/flaky_detector.py +3 -0
- package/tools/fsm_enforcer.py +2 -2
- package/tools/fuzz_payloads.py +3 -0
- package/tools/generate_allure_report.py +3 -0
- package/tools/generate_api_matrix.py +3 -0
- package/tools/generate_jmx_plan.py +3 -0
- package/tools/generate_tc_from_story.py +3 -0
- package/tools/generate_test_reports.py +3 -0
- package/tools/git_pre_commit_guard.py +25 -3
- package/tools/git_worktree_manager.py +3 -0
- package/tools/heal/__init__.py +3 -0
- package/tools/heal_pr_automator.py +3 -0
- package/tools/heuristic_locator_matcher.py +3 -0
- package/tools/hub_publisher.py +3 -3
- package/tools/humanize_linter.py +3 -0
- package/tools/infer_linter.py +19 -9
- package/tools/init_config.py +6 -9
- package/tools/jtl_analyzer.py +3 -0
- package/tools/lint/__init__.py +3 -0
- package/tools/lint_ai_docs.py +3 -0
- package/tools/lookup_tc.py +3 -0
- package/tools/lookup_xpath.py +3 -0
- package/tools/matrix_sharder.py +3 -0
- package/tools/mcp/__init__.py +3 -0
- package/tools/mcp_docx_server.py +1 -1
- package/tools/mcp_excel_server.py +4 -1
- package/tools/mcp_server.py +78 -15
- package/tools/md_to_xlsx.py +3 -0
- package/tools/mechanical_ui_gate.py +3 -0
- package/tools/micro_mutator.py +93 -19
- package/tools/network_mock_shield.py +3 -0
- package/tools/newman_analyzer.py +3 -0
- package/tools/omni_emitter.py +3 -0
- package/tools/omni_parser.py +3 -0
- package/tools/omni_transpiler.py +3 -0
- package/tools/output_formatter.py +3 -0
- package/tools/package_release.py +6 -6
- package/tools/pairwise_generator.py +3 -0
- package/tools/pentest_scope_guard.py +401 -58
- package/tools/perf/__init__.py +3 -0
- package/tools/perf/benchmark_perf_runner.py +42 -0
- package/tools/pinpoint_failure.py +3 -0
- package/tools/project_state.py +3 -0
- package/tools/repo_map.py +3 -0
- package/tools/report/__init__.py +3 -0
- package/tools/rules_router.py +426 -34
- package/tools/runaway_stopper.py +3 -0
- package/tools/safety_firewall.py +3 -0
- package/tools/security_scanner.py +80 -0
- package/tools/senior_code_review.py +14 -0
- package/tools/setup_project.py +9 -4
- package/tools/skill_canonical_digest.py +244 -0
- package/tools/skill_collision_guard.py +2 -2
- package/tools/skill_profiles.py +77 -7
- package/tools/skillspector.py +2 -1
- package/tools/slide_deck_exporter.py +477 -0
- package/tools/smart_visual_masker.py +3 -0
- package/tools/sync_skills_manifest.py +166 -0
- package/tools/task_memory_manager.py +260 -0
- package/tools/telemetry_correlator.py +3 -0
- package/tools/template_excel_exporter.py +2 -2
- package/tools/test_impact.py +3 -0
- package/tools/trace_data_flow.py +3 -0
- package/tools/traffic_session_converter.py +3 -0
- package/tools/ui_server.py +2 -2
- package/tools/universal_ir.py +3 -0
- package/tools/update_sentinel.py +15 -9
- package/tools/validate_groovy_scripts.py +3 -0
- package/tools/validate_host_interop.py +485 -0
- package/tools/validate_skills_schema.py +282 -0
- package/tools/verify_all.py +600 -63
- package/tools/visual_diff_canvas.py +3 -0
- package/tools/visual_som_helper.py +3 -0
- package/tools/watch_mode.py +4 -4
- package/tools/wcag_audit.py +3 -0
- package/tools/welcome_page.py +2 -2
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
# -*- coding: utf-8 -*-
|
|
6
|
+
"""
|
|
7
|
+
tools/break_ui_generator.py — Edge-Case UI Stress Testing Data Generator
|
|
8
|
+
Inspired by Emil Kowalski's break-ui skill (emilkowalski/skills).
|
|
9
|
+
Generates extreme data boundaries, unspaced strings, Zalgo, RTL, boundary floats,
|
|
10
|
+
and odd viewports to proactively discover layout breakages, text truncation bugs,
|
|
11
|
+
and visual regressions before production deployment.
|
|
12
|
+
100% UTF-8 No BOM. Zero external dependencies.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import json
|
|
19
|
+
import sys
|
|
20
|
+
from typing import Any, Dict, List
|
|
21
|
+
|
|
22
|
+
# Enforce UTF-8 stdout encoding
|
|
23
|
+
if hasattr(sys.stdout, "reconfigure"):
|
|
24
|
+
try:
|
|
25
|
+
sys.stdout.reconfigure(encoding="utf-8")
|
|
26
|
+
sys.stderr.reconfigure(encoding="utf-8")
|
|
27
|
+
except Exception:
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
# 1. Extreme Strings (Zalgo, unspaced overflow, zero-width, markup injection)
|
|
31
|
+
BREAK_STRINGS: List[Dict[str, str]] = [
|
|
32
|
+
{
|
|
33
|
+
"name": "unspaced_500_chars",
|
|
34
|
+
"description": "500-char continuous string to test CSS word-break / overflow-wrap",
|
|
35
|
+
"value": "Supercalifragilisticexpialidocious" * 15,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "unspaced_2000_chars",
|
|
39
|
+
"description": "2,000-char continuous string to force container overflow",
|
|
40
|
+
"value": "A" * 2000,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "zero_width_spaces",
|
|
44
|
+
"description": "Invisible zero-width joiners and spaces to test renderer length calculation",
|
|
45
|
+
"value": "Zero\u200BWidth\u200CSpace\u200DTest\uFEFFInvisible",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "zalgo_corrupted_text",
|
|
49
|
+
"description": "Heavily combining diacritic marks to test vertical line-height clipping",
|
|
50
|
+
"value": "T̶͕͂é̷̯s̴̱͘t̸͙͒ ̸͚̈́Z̷̯̆a̴͖̓l̸͔̐g̶̭͒ỏ̷̱ ̶̦̋C̴̠̃o̶̧͝r̶̠̾r̵͇̈́ǘ̸͎p̸̀ͅẗ̴͚́ì̷̳o̸̭͝n̶̡̈́",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "html_markup_injection",
|
|
54
|
+
"description": "Unescaped HTML tags to ensure UI framework escapes entities safely",
|
|
55
|
+
"value": "<script>alert('XSS')</script><b>Bold</b>&\"'<svg onload=alert(1)>",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "sql_syntax_injection",
|
|
59
|
+
"description": "SQL special characters in UI input to verify backend sanitization",
|
|
60
|
+
"value": "' OR '1'='1' -- /* drop table users; */ \";",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "emoji_complex_graphemes",
|
|
64
|
+
"description": "Multi-codepoint composite emojis testing font glyph rendering",
|
|
65
|
+
"value": "👨👩👧👦 🏳️⚧️ 🧑🏾🚀 🦾 👁️🗨️",
|
|
66
|
+
},
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
# 2. Localization & Directional Boundaries (RTL, German compounds, CJK, Vietnamese tones)
|
|
70
|
+
BREAK_LOCALIZATION: List[Dict[str, str]] = [
|
|
71
|
+
{
|
|
72
|
+
"name": "rtl_arabic",
|
|
73
|
+
"description": "Right-to-Left Arabic text to test bidirectional layout mirroring",
|
|
74
|
+
"value": "مرحبا بالعالم! هذا اختبار لتخطيط الواجهة من اليمين إلى اليسار.",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "rtl_hebrew",
|
|
78
|
+
"description": "Right-to-Left Hebrew text with mixed LTR numbers",
|
|
79
|
+
"value": "בדיקת ממשק משתמש בעברית עם מספרים: 12345 וטקست באנגלית ABC.",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "german_compound_noun",
|
|
83
|
+
"description": "Extremely long German word to test column wrapping",
|
|
84
|
+
"value": "Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "vietnamese_complex_tones",
|
|
88
|
+
"description": "Stacked diacritics testing font vertical metrics and accent collisions",
|
|
89
|
+
"value": "Khảo sát tự động hóa kiểm thử: Độc lập - Tự do - Hạnh phúc (Thuở, Nghĩa, Triệu)",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "cjk_wide_characters",
|
|
93
|
+
"description": "Full-width East Asian glyphs testing monospace alignment and line breaks",
|
|
94
|
+
"value": "日本語のテスト文字列。全角文字と半角文字の混在チェック:12345ABCDE。",
|
|
95
|
+
},
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
# 3. Numeric Boundaries & Floating Point Edge Cases
|
|
99
|
+
BREAK_NUMBERS: List[Dict[str, Any]] = [
|
|
100
|
+
{
|
|
101
|
+
"name": "max_safe_integer_js",
|
|
102
|
+
"description": "JavaScript Number.MAX_SAFE_INTEGER (2^53 - 1)",
|
|
103
|
+
"value": 9007199254740991,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "min_safe_integer_js",
|
|
107
|
+
"description": "JavaScript Number.MIN_SAFE_INTEGER -(2^53 - 1)",
|
|
108
|
+
"value": -9007199254740991,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "int64_max",
|
|
112
|
+
"description": "Signed 64-bit maximum integer (2^63 - 1)",
|
|
113
|
+
"value": 9223372036854775807,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "extreme_decimal_precision",
|
|
117
|
+
"description": "20-decimal float testing rounding and currency formatting truncation",
|
|
118
|
+
"value": 1234567.12345678901234567890,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "near_zero_subnormal",
|
|
122
|
+
"description": "Subnormal scientific notation close to zero",
|
|
123
|
+
"value": 1e-15,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "extreme_large_scientific",
|
|
127
|
+
"description": "Large exponent testing scientific notation formatting",
|
|
128
|
+
"value": 1.7976931348623157e308,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "zero_and_negative_zero",
|
|
132
|
+
"description": "Zero and boundary float 0.0",
|
|
133
|
+
"value": 0.0,
|
|
134
|
+
},
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
# 4. Viewport Dimensions for Layout Stress Testing
|
|
138
|
+
BREAK_VIEWPORTS: List[Dict[str, Any]] = [
|
|
139
|
+
{"name": "mobile_compact_se", "width": 320, "height": 568, "device_scale": 2.0},
|
|
140
|
+
{"name": "mobile_modern_tall", "width": 390, "height": 844, "device_scale": 3.0},
|
|
141
|
+
{"name": "tablet_portrait", "width": 768, "height": 1024, "device_scale": 2.0},
|
|
142
|
+
{"name": "tablet_landscape", "width": 1024, "height": 768, "device_scale": 2.0},
|
|
143
|
+
{"name": "desktop_standard_hd", "width": 1366, "height": 768, "device_scale": 1.0},
|
|
144
|
+
{"name": "desktop_full_hd_standard", "width": 1920, "height": 1080, "device_scale": 1.0},
|
|
145
|
+
{"name": "desktop_ultrawide", "width": 3440, "height": 1440, "device_scale": 1.0},
|
|
146
|
+
{"name": "desktop_4k_extreme", "width": 3840, "height": 2160, "device_scale": 2.0},
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def get_break_strings() -> List[Dict[str, str]]:
|
|
151
|
+
"""Returns extreme string boundaries for text input and layout testing."""
|
|
152
|
+
return list(BREAK_STRINGS)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def get_break_localization() -> List[Dict[str, str]]:
|
|
156
|
+
"""Returns bidirectional, CJK, and complex diacritic strings."""
|
|
157
|
+
return list(BREAK_LOCALIZATION)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def get_break_numbers() -> List[Dict[str, Any]]:
|
|
161
|
+
"""Returns numerical edge cases and boundary floats."""
|
|
162
|
+
return list(BREAK_NUMBERS)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def get_break_viewports() -> List[Dict[str, Any]]:
|
|
166
|
+
"""Returns standard and extreme responsive viewport configurations."""
|
|
167
|
+
return list(BREAK_VIEWPORTS)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def generate_all_break_payloads() -> Dict[str, Any]:
|
|
171
|
+
"""Generates the unified break-ui testing catalog."""
|
|
172
|
+
return {
|
|
173
|
+
"version": "1.0.0",
|
|
174
|
+
"source": "Synapse Hub break-ui generator (Emil Kowalski pattern)",
|
|
175
|
+
"categories": {
|
|
176
|
+
"strings": get_break_strings(),
|
|
177
|
+
"localization": get_break_localization(),
|
|
178
|
+
"numbers": get_break_numbers(),
|
|
179
|
+
"viewports": get_break_viewports(),
|
|
180
|
+
},
|
|
181
|
+
"total_cases": (
|
|
182
|
+
len(BREAK_STRINGS)
|
|
183
|
+
+ len(BREAK_LOCALIZATION)
|
|
184
|
+
+ len(BREAK_NUMBERS)
|
|
185
|
+
+ len(BREAK_VIEWPORTS)
|
|
186
|
+
),
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def main() -> None:
|
|
191
|
+
parser = argparse.ArgumentParser(description="Break-UI Edge-Case Test Data Generator for Synapse Hub")
|
|
192
|
+
parser.add_argument(
|
|
193
|
+
"--category",
|
|
194
|
+
"-c",
|
|
195
|
+
choices=["strings", "localization", "numbers", "viewports", "all"],
|
|
196
|
+
default="all",
|
|
197
|
+
help="Category of edge-case test data to generate (default: all)",
|
|
198
|
+
)
|
|
199
|
+
parser.add_argument("--limit", "-l", type=int, default=0, help="Limit number of items output (0 = all)")
|
|
200
|
+
parser.add_argument("--json", action="store_true", help="Output in machine-readable JSON format")
|
|
201
|
+
args = parser.parse_args()
|
|
202
|
+
|
|
203
|
+
catalog = generate_all_break_payloads()
|
|
204
|
+
|
|
205
|
+
if args.category == "all":
|
|
206
|
+
data: Any = catalog["categories"]
|
|
207
|
+
else:
|
|
208
|
+
data = catalog["categories"][args.category]
|
|
209
|
+
if args.limit > 0:
|
|
210
|
+
data = data[:args.limit]
|
|
211
|
+
|
|
212
|
+
if args.json:
|
|
213
|
+
print(json.dumps(data, indent=2, ensure_ascii=False))
|
|
214
|
+
else:
|
|
215
|
+
print(f"💥 Break-UI Generator (Category: {args.category})")
|
|
216
|
+
if isinstance(data, dict):
|
|
217
|
+
for cat, items in data.items():
|
|
218
|
+
print(f"\n[{cat.upper()}] ({len(items)} items)")
|
|
219
|
+
for item in items[: (args.limit if args.limit > 0 else len(items))]:
|
|
220
|
+
val = str(item.get("value", f"{item.get('width')}x{item.get('height')}"))
|
|
221
|
+
if len(val) > 60:
|
|
222
|
+
val = val[:57] + "..."
|
|
223
|
+
print(f" • {item['name']:<28} : {val}")
|
|
224
|
+
else:
|
|
225
|
+
for item in data:
|
|
226
|
+
val = str(item.get("value", f"{item.get('width')}x{item.get('height')}"))
|
|
227
|
+
if len(val) > 60:
|
|
228
|
+
val = val[:57] + "..."
|
|
229
|
+
print(f" • {item['name']:<28} : {val}")
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
if __name__ == "__main__":
|
|
233
|
+
main()
|
package/tools/browser_helpers.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
(function () {
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
if (window.__qa && window.__qa.__version === '4.
|
|
16
|
+
if (window.__qa && window.__qa.__version === '4.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: '4.
|
|
50
|
+
__version: '4.2.0',
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* 1. Smart Action Batching
|
package/tools/bug_reporter.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
2
5
|
"""
|
|
3
6
|
Auto-Bug Reporter & Root Cause Analysis (RCA) Ticket Generator
|
|
4
7
|
--------------------------------------------------------------
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
2
5
|
# -*- coding: utf-8 -*-
|
|
3
6
|
"""
|
|
4
7
|
tools/build_consolidated_report.py — Generate Unified Top 20 Skills & Agents Evaluation Report
|
package/tools/bump_version.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
2
5
|
# -*- coding: utf-8 -*-
|
|
3
6
|
"""
|
|
4
7
|
tools/bump_version.py — Atomic Universal Version Bumper for Synapse Hub
|
|
@@ -229,7 +232,7 @@ def git_commit_and_tag(version: str, push: bool = False):
|
|
|
229
232
|
if untracked:
|
|
230
233
|
print(f"⚠️ Warning: Detected {len(untracked)} untracked file(s). Note that 'git add -u' only stages modified tracked files.")
|
|
231
234
|
except Exception as err:
|
|
232
|
-
|
|
235
|
+
print(f"Notice: Could not check untracked files ({err}).")
|
|
233
236
|
|
|
234
237
|
print(f"\n📦 Creating Git commit and tag {tag_name}...")
|
|
235
238
|
subprocess.run(["git", "add", "-u"], cwd=REPO_ROOT, check=True, timeout=30.0)
|
package/tools/cache_resolver.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
2
5
|
"""
|
|
3
6
|
Universal Local Semantic Memory Cache & Self-Healing Resolver
|
|
4
7
|
-------------------------------------------------------------
|
|
@@ -259,7 +262,7 @@ def retry_on_locked(max_retries=5, initial_delay=0.05, backoff=2.0):
|
|
|
259
262
|
last_err = e
|
|
260
263
|
err_msg = str(e).lower()
|
|
261
264
|
if "locked" in err_msg or "busy" in err_msg:
|
|
262
|
-
time.sleep(delay)
|
|
265
|
+
time.sleep(delay) # synapse-ignore: HARD_DELAY_ANTI_PATTERN
|
|
263
266
|
delay *= backoff
|
|
264
267
|
else:
|
|
265
268
|
raise
|
|
@@ -317,8 +320,9 @@ def init_db(seed=True, target_db=None):
|
|
|
317
320
|
""")
|
|
318
321
|
try:
|
|
319
322
|
cursor.execute("ALTER TABLE healing_cache ADD COLUMN code_patch TEXT DEFAULT ''")
|
|
320
|
-
except sqlite3.OperationalError:
|
|
321
|
-
|
|
323
|
+
except sqlite3.OperationalError as _err:
|
|
324
|
+
import logging
|
|
325
|
+
logging.getLogger("cache_resolver").debug("code_patch column already exists: %s", _err)
|
|
322
326
|
|
|
323
327
|
# 2. Negative Memory Table (Blacklist of Failed Fix Attempts)
|
|
324
328
|
cursor.execute("""
|
package/tools/check_env.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
2
5
|
"""
|
|
3
6
|
==============================================================================
|
|
4
7
|
Enterprise Automation - Environment & Onboarding Diagnostic Tool
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
2
5
|
# -*- coding: utf-8 -*-
|
|
3
6
|
"""
|
|
4
7
|
tools/check_version_sync.py — Version Synchronization Sentinel for Synapse Hub
|
|
@@ -189,9 +192,15 @@ def extract_versions(repo_root: str) -> Dict[str, str]:
|
|
|
189
192
|
return versions
|
|
190
193
|
|
|
191
194
|
|
|
195
|
+
from skill_canonical_digest import (
|
|
196
|
+
validate_lockfile_integrity,
|
|
197
|
+
update_skills_lockfile,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
|
|
192
201
|
def check_sync(repo_root: str, expected_version: Optional[str] = None) -> Tuple[bool, Dict[str, str], str]:
|
|
193
202
|
"""
|
|
194
|
-
Checks if all version definitions match.
|
|
203
|
+
Checks if all version definitions match across manifests and verifies canonical skill lockfile integrity.
|
|
195
204
|
Returns (is_synced, versions_dict, canonical_version_or_error_msg).
|
|
196
205
|
"""
|
|
197
206
|
versions = extract_versions(repo_root)
|
|
@@ -213,65 +222,27 @@ def check_sync(repo_root: str, expected_version: Optional[str] = None) -> Tuple[
|
|
|
213
222
|
|
|
214
223
|
if mismatches:
|
|
215
224
|
return False, versions, target_ver
|
|
216
|
-
return True, versions, target_ver
|
|
217
225
|
|
|
226
|
+
# Enforce canonical skills lockfile integrity (live content hash validation)
|
|
227
|
+
lock_ok, lock_msg = validate_lockfile_integrity(repo_root, enforce_content_hash=True)
|
|
228
|
+
if not lock_ok:
|
|
229
|
+
return False, versions, f"Lockfile integrity verification failed: {lock_msg}"
|
|
218
230
|
|
|
219
|
-
|
|
220
|
-
"""
|
|
221
|
-
Validates canonical lockfile (skills-lock.json), synchronizes .skill-lock.json,
|
|
222
|
-
and verifies SHA-256 integrity hash for all registered skills.
|
|
223
|
-
"""
|
|
224
|
-
canonical_lock = os.path.join(repo_root, "skills-lock.json")
|
|
225
|
-
secondary_lock = os.path.join(repo_root, ".skill-lock.json")
|
|
226
|
-
|
|
227
|
-
if not os.path.exists(canonical_lock):
|
|
228
|
-
return False, "Canonical lockfile skills-lock.json is missing!"
|
|
229
|
-
|
|
230
|
-
try:
|
|
231
|
-
with open(canonical_lock, "r", encoding="utf-8") as f:
|
|
232
|
-
lock_data = json.load(f)
|
|
233
|
-
except Exception as e:
|
|
234
|
-
return False, f"skills-lock.json malformed JSON: {e}"
|
|
235
|
-
|
|
236
|
-
skills = lock_data.get("skills", {})
|
|
237
|
-
if len(skills) != 53:
|
|
238
|
-
return False, f"Expected 53 skills in skills-lock.json, found {len(skills)}"
|
|
239
|
-
|
|
240
|
-
for s_name, s_meta in skills.items():
|
|
241
|
-
s_path = s_meta.get("skillPath")
|
|
242
|
-
if not s_path:
|
|
243
|
-
return False, f"Skill '{s_name}' missing skillPath"
|
|
244
|
-
full_path = os.path.join(repo_root, s_path)
|
|
245
|
-
if not os.path.exists(full_path):
|
|
246
|
-
return False, f"Skill '{s_name}' path not found: {s_path}"
|
|
247
|
-
s_hash = s_meta.get("skillFolderHash")
|
|
248
|
-
if not s_hash or len(s_hash) != 64 or not all(c in "0123456789abcdefABCDEF" for c in s_hash):
|
|
249
|
-
return False, f"Skill '{s_name}' has invalid SHA-256 hash: {s_hash}"
|
|
250
|
-
|
|
251
|
-
# Auto-sync secondary lockfile .skill-lock.json to maintain atomic parity
|
|
252
|
-
try:
|
|
253
|
-
with open(canonical_lock, "rb") as cf:
|
|
254
|
-
content_bytes = cf.read()
|
|
255
|
-
needs_write = True
|
|
256
|
-
if os.path.exists(secondary_lock):
|
|
257
|
-
with open(secondary_lock, "rb") as sf:
|
|
258
|
-
if sf.read() == content_bytes:
|
|
259
|
-
needs_write = False
|
|
260
|
-
if needs_write:
|
|
261
|
-
with open(secondary_lock, "wb") as sf:
|
|
262
|
-
sf.write(content_bytes)
|
|
263
|
-
except Exception as e:
|
|
264
|
-
return False, f"Failed to sync .skill-lock.json: {e}"
|
|
265
|
-
|
|
266
|
-
return True, "53/53 skills verified with valid paths & SHA-256 hashes (auto-synced .skill-lock.json)"
|
|
231
|
+
return True, versions, target_ver
|
|
267
232
|
|
|
268
233
|
|
|
269
234
|
def main() -> int:
|
|
270
235
|
parser = argparse.ArgumentParser(description="Verify universal version sync across Synapse Hub files")
|
|
271
236
|
parser.add_argument("--expected-version", "-e", help="Expected version string (e.g. from git tag)", default=None)
|
|
272
237
|
parser.add_argument("--repo-root", default=REPO_ROOT, help="Root directory of the repository")
|
|
238
|
+
parser.add_argument("--update-hashes", action="store_true", help="Recalculate and update canonical skill folder hashes in lockfiles")
|
|
273
239
|
args = parser.parse_args()
|
|
274
240
|
|
|
241
|
+
if args.update_hashes:
|
|
242
|
+
ok, msg = update_skills_lockfile(args.repo_root)
|
|
243
|
+
print(f"[{'SUCCESS' if ok else 'FAIL'}] {msg}")
|
|
244
|
+
return 0 if ok else 1
|
|
245
|
+
|
|
275
246
|
expected = args.expected_version
|
|
276
247
|
if expected and expected.startswith("v"):
|
|
277
248
|
expected = expected[1:]
|
package/tools/ci_healing_hook.py
CHANGED
package/tools/cli.py
CHANGED
|
@@ -16,7 +16,7 @@ import json
|
|
|
16
16
|
import re
|
|
17
17
|
import difflib
|
|
18
18
|
import argparse
|
|
19
|
-
from typing import Optional
|
|
19
|
+
from typing import Any, Optional
|
|
20
20
|
|
|
21
21
|
# Enforce UTF-8 stdout encoding for Windows console compatibility
|
|
22
22
|
if hasattr(sys.stdout, 'reconfigure'):
|
|
@@ -96,27 +96,55 @@ def cmd_set_lang(args):
|
|
|
96
96
|
sys.exit(0)
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
def _resolve_manifest_path(repo_root: Optional[str] = None) -> Optional[str]:
|
|
100
|
+
"""
|
|
101
|
+
Fallback manifest resolution:
|
|
102
|
+
1. REPO_ROOT/skills_manifest.json
|
|
103
|
+
2. tools/skills_manifest.json
|
|
104
|
+
3. importlib.resources.files("tools").joinpath("skills_manifest.json")
|
|
105
|
+
"""
|
|
106
|
+
root = repo_root or REPO_ROOT
|
|
107
|
+
candidate1 = os.path.join(root, "skills_manifest.json")
|
|
108
|
+
if os.path.isfile(candidate1):
|
|
109
|
+
return candidate1
|
|
110
|
+
candidate2 = os.path.join(SCRIPT_DIR, "skills_manifest.json")
|
|
111
|
+
if os.path.isfile(candidate2):
|
|
112
|
+
return candidate2
|
|
113
|
+
candidate2_alt = os.path.join(root, "tools", "skills_manifest.json")
|
|
114
|
+
if os.path.isfile(candidate2_alt):
|
|
115
|
+
return candidate2_alt
|
|
116
|
+
try:
|
|
117
|
+
import importlib.resources as pkg_resources
|
|
118
|
+
resource = pkg_resources.files("tools").joinpath("skills_manifest.json")
|
|
119
|
+
if resource.is_file():
|
|
120
|
+
try:
|
|
121
|
+
r_str = str(resource)
|
|
122
|
+
if os.path.isfile(r_str):
|
|
123
|
+
return r_str
|
|
124
|
+
except (TypeError, ValueError) as str_err:
|
|
125
|
+
res_str_err = str(str_err)
|
|
126
|
+
with pkg_resources.as_file(resource) as p:
|
|
127
|
+
return str(p)
|
|
128
|
+
except (ImportError, AttributeError, TypeError) as res_err:
|
|
129
|
+
res_load_err = str(res_err)
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
|
|
99
133
|
def cmd_version(args):
|
|
100
134
|
"""Displays the current hub version, skill catalog count, and license information."""
|
|
101
|
-
manifest_path =
|
|
102
|
-
version = "4.
|
|
103
|
-
|
|
135
|
+
manifest_path = _resolve_manifest_path()
|
|
136
|
+
version = "4.2.0"
|
|
137
|
+
manifest_skills = 53
|
|
138
|
+
if manifest_path and os.path.exists(manifest_path):
|
|
104
139
|
try:
|
|
105
140
|
import json
|
|
106
141
|
with open(manifest_path, "r", encoding="utf-8") as f:
|
|
107
142
|
data = json.load(f)
|
|
108
143
|
version = data.get("version", version)
|
|
109
|
-
|
|
110
|
-
|
|
144
|
+
manifest_skills = data.get("totalSkills", manifest_skills)
|
|
145
|
+
except (OSError, json.JSONDecodeError) as json_err:
|
|
146
|
+
manifest_err = str(json_err)
|
|
111
147
|
print(f"Agent-QA Hub CLI v{version}")
|
|
112
|
-
manifest_skills = 42
|
|
113
|
-
if os.path.exists(manifest_path):
|
|
114
|
-
try:
|
|
115
|
-
import json
|
|
116
|
-
with open(manifest_path, "r", encoding="utf-8") as f:
|
|
117
|
-
manifest_skills = json.load(f).get("totalSkills", 42)
|
|
118
|
-
except (OSError, json.JSONDecodeError):
|
|
119
|
-
manifest_skills = 42
|
|
120
148
|
print(f"Catalog: {manifest_skills} Standardized Skills | 9 Subagent Swarm Profiles")
|
|
121
149
|
print("Created by: Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>")
|
|
122
150
|
print("License : MIT (Attribution Required)")
|
|
@@ -485,9 +513,70 @@ def cmd_init_config(args):
|
|
|
485
513
|
sys.exit(init_cfg_main())
|
|
486
514
|
|
|
487
515
|
|
|
516
|
+
def get_registered_commands(parser: Optional[argparse.ArgumentParser] = None, lang: str = "en") -> list[dict[str, Any]]:
|
|
517
|
+
"""
|
|
518
|
+
Dynamically introspects the CLI parser subparsers action and extracts
|
|
519
|
+
all registered commands, aliases, and localized descriptions directly from the registry.
|
|
520
|
+
"""
|
|
521
|
+
if parser is None:
|
|
522
|
+
parser = build_parser(lang)
|
|
523
|
+
|
|
524
|
+
subparsers_action = None
|
|
525
|
+
for action in parser._actions:
|
|
526
|
+
if isinstance(action, argparse._SubParsersAction):
|
|
527
|
+
subparsers_action = action
|
|
528
|
+
break
|
|
529
|
+
|
|
530
|
+
if not subparsers_action:
|
|
531
|
+
return []
|
|
532
|
+
|
|
533
|
+
help_map = {a.dest: a.help for a in getattr(subparsers_action, "_choices_actions", [])}
|
|
534
|
+
|
|
535
|
+
commands = []
|
|
536
|
+
seen_parsers = set()
|
|
537
|
+
for name, subp in subparsers_action.choices.items():
|
|
538
|
+
if id(subp) in seen_parsers:
|
|
539
|
+
continue
|
|
540
|
+
seen_parsers.add(id(subp))
|
|
541
|
+
aliases = [n for n, s in subparsers_action.choices.items() if s is subp and n != name]
|
|
542
|
+
help_text = help_map.get(name) or getattr(subp, "description", None) or getattr(subp, "help", "") or ""
|
|
543
|
+
commands.append({
|
|
544
|
+
"name": name,
|
|
545
|
+
"aliases": aliases,
|
|
546
|
+
"help": help_text,
|
|
547
|
+
"prog": getattr(subp, "prog", f"agent-qa {name}"),
|
|
548
|
+
})
|
|
549
|
+
commands.sort(key=lambda c: c["name"])
|
|
550
|
+
return commands
|
|
551
|
+
|
|
552
|
+
|
|
488
553
|
def cmd_help(args):
|
|
489
554
|
"""Displays command-line help and usage documentation."""
|
|
490
555
|
parser = getattr(args, "_parser", None)
|
|
556
|
+
if not parser:
|
|
557
|
+
lang = getattr(args, "lang", None) or resolve_language(_extract_cli_lang())
|
|
558
|
+
parser = build_parser(lang)
|
|
559
|
+
|
|
560
|
+
lang = getattr(parser, "lang", "en")
|
|
561
|
+
|
|
562
|
+
if getattr(args, "json_output", False):
|
|
563
|
+
commands = get_registered_commands(parser, lang)
|
|
564
|
+
print(json.dumps(commands, indent=2, ensure_ascii=False))
|
|
565
|
+
sys.exit(0)
|
|
566
|
+
|
|
567
|
+
if getattr(args, "md_output", False):
|
|
568
|
+
commands = get_registered_commands(parser, lang)
|
|
569
|
+
lines = [
|
|
570
|
+
"| Command | Aliases | Description |",
|
|
571
|
+
"| :--- | :--- | :--- |",
|
|
572
|
+
]
|
|
573
|
+
for cmd in commands:
|
|
574
|
+
aliases_str = ", ".join(f"`{a}`" for a in cmd["aliases"]) if cmd["aliases"] else "—"
|
|
575
|
+
desc = cmd["help"].replace("\n", " ").strip()
|
|
576
|
+
lines.append(f"| `{cmd['name']}` | {aliases_str} | {desc} |")
|
|
577
|
+
print("\n".join(lines))
|
|
578
|
+
sys.exit(0)
|
|
579
|
+
|
|
491
580
|
if parser:
|
|
492
581
|
parser.print_help()
|
|
493
582
|
sys.exit(0)
|
|
@@ -685,15 +774,15 @@ def cmd_trend(args):
|
|
|
685
774
|
|
|
686
775
|
|
|
687
776
|
def _hub_version():
|
|
688
|
-
manifest_path =
|
|
689
|
-
version = "4.
|
|
690
|
-
if os.path.exists(manifest_path):
|
|
777
|
+
manifest_path = _resolve_manifest_path()
|
|
778
|
+
version = "4.2.0"
|
|
779
|
+
if manifest_path and os.path.exists(manifest_path):
|
|
691
780
|
try:
|
|
692
781
|
import json
|
|
693
782
|
with open(manifest_path, "r", encoding="utf-8") as f:
|
|
694
783
|
version = json.load(f).get("version", version)
|
|
695
784
|
except (OSError, json.JSONDecodeError):
|
|
696
|
-
version = "4.
|
|
785
|
+
version = "4.2.0"
|
|
697
786
|
return version
|
|
698
787
|
|
|
699
788
|
|
|
@@ -844,7 +933,8 @@ class SynapseArgumentParser(argparse.ArgumentParser):
|
|
|
844
933
|
except SystemExit as exc:
|
|
845
934
|
sys.exit(exc.code if exc.code is not None else 0)
|
|
846
935
|
except Exception as _err:
|
|
847
|
-
|
|
936
|
+
import logging
|
|
937
|
+
logging.getLogger("cli").debug("Argparse error formatting: %s", _err)
|
|
848
938
|
|
|
849
939
|
def format_help(self):
|
|
850
940
|
self._localize_argparse_groups()
|
|
@@ -877,6 +967,8 @@ def _register_core_and_setup_commands(subparsers, lang: Optional[str] = None):
|
|
|
877
967
|
# help
|
|
878
968
|
p_help = subparsers.add_parser("help", help=t("cmd_help", lang=lang))
|
|
879
969
|
p_help.add_argument("--all", "-a", action="store_true", dest="show_all", help=t("opt_all", lang=lang))
|
|
970
|
+
p_help.add_argument("--json", action="store_true", dest="json_output", help=_lh("Output complete registered command list as JSON", "Xuất toàn bộ danh sách lệnh đã đăng ký dưới dạng JSON", lang))
|
|
971
|
+
p_help.add_argument("--markdown", "--md", action="store_true", dest="md_output", help=_lh("Output complete registered command list as Markdown table", "Xuất toàn bộ danh sách lệnh đã đăng ký dưới dạng bảng Markdown", lang))
|
|
880
972
|
p_help.set_defaults(func=cmd_help)
|
|
881
973
|
|
|
882
974
|
# set-lang
|
|
@@ -1562,7 +1654,8 @@ def main():
|
|
|
1562
1654
|
try:
|
|
1563
1655
|
persist_language_preference(cli_lang)
|
|
1564
1656
|
except Exception as _err:
|
|
1565
|
-
|
|
1657
|
+
import logging
|
|
1658
|
+
logging.getLogger("cli").debug("Failed to persist language preference: %s", _err)
|
|
1566
1659
|
active_lang = resolve_language(cli_lang)
|
|
1567
1660
|
parser = build_parser(active_lang)
|
|
1568
1661
|
args, unknown = parser.parse_known_args()
|
|
@@ -1602,8 +1695,9 @@ def main():
|
|
|
1602
1695
|
try:
|
|
1603
1696
|
import update_sentinel
|
|
1604
1697
|
update_sentinel.check_for_updates(force=False, notify=True)
|
|
1605
|
-
except (ImportError, OSError, TimeoutError):
|
|
1606
|
-
|
|
1698
|
+
except (ImportError, OSError, TimeoutError) as err:
|
|
1699
|
+
import logging
|
|
1700
|
+
logging.getLogger("cli").debug("Update check skipped: %s", err)
|
|
1607
1701
|
args.func(args)
|
|
1608
1702
|
|
|
1609
1703
|
|
package/tools/core/__init__.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
1
4
|
"""
|
|
2
5
|
Synapse Hub — Core Execution Engines & Verification Sentinels (tools.core)
|
|
3
6
|
--------------------------------------------------------------------------
|