opencode-skills-antigravity 1.0.21 → 1.0.22
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/bundled-skills/.antigravity-install-manifest.json +1 -1
- package/bundled-skills/claude-monitor/scripts/api_bench.py +12 -1
- package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package-lock.json +3 -3
- package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package.json +1 -0
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +3 -3
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +1 -0
- package/bundled-skills/whatsapp-cloud-api/scripts/send_test_message.py +18 -14
- package/bundled-skills/whatsapp-cloud-api/scripts/validate_config.py +54 -37
- package/package.json +1 -1
|
@@ -34,6 +34,17 @@ ENDPOINTS = [
|
|
|
34
34
|
]
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
def create_tls_context():
|
|
38
|
+
"""Cria contexto TLS restringindo conexoes a TLS 1.2+."""
|
|
39
|
+
context = ssl.create_default_context()
|
|
40
|
+
if hasattr(ssl, "TLSVersion"):
|
|
41
|
+
context.minimum_version = ssl.TLSVersion.TLSv1_2
|
|
42
|
+
else:
|
|
43
|
+
context.options |= getattr(ssl, "OP_NO_TLSv1", 0)
|
|
44
|
+
context.options |= getattr(ssl, "OP_NO_TLSv1_1", 0)
|
|
45
|
+
return context
|
|
46
|
+
|
|
47
|
+
|
|
37
48
|
def test_tcp_latency(host, port, timeout=5):
|
|
38
49
|
"""Testa latência TCP para um host:port."""
|
|
39
50
|
try:
|
|
@@ -49,7 +60,7 @@ def test_tcp_latency(host, port, timeout=5):
|
|
|
49
60
|
def test_tls_handshake(host, port=443, timeout=5):
|
|
50
61
|
"""Testa tempo do handshake TLS."""
|
|
51
62
|
try:
|
|
52
|
-
context =
|
|
63
|
+
context = create_tls_context()
|
|
53
64
|
start = time.time()
|
|
54
65
|
with socket.create_connection((host, port), timeout=timeout) as sock:
|
|
55
66
|
with context.wrap_socket(sock, server_hostname=host) as ssock:
|
|
@@ -1110,9 +1110,9 @@
|
|
|
1110
1110
|
}
|
|
1111
1111
|
},
|
|
1112
1112
|
"node_modules/path-to-regexp": {
|
|
1113
|
-
"version": "0.1.
|
|
1114
|
-
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.
|
|
1115
|
-
"integrity": "sha512-
|
|
1113
|
+
"version": "0.1.13",
|
|
1114
|
+
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
|
|
1115
|
+
"integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
|
|
1116
1116
|
"license": "MIT"
|
|
1117
1117
|
},
|
|
1118
1118
|
"node_modules/prebuild-install": {
|
|
@@ -1527,9 +1527,9 @@
|
|
|
1527
1527
|
"license": "ISC"
|
|
1528
1528
|
},
|
|
1529
1529
|
"node_modules/picomatch": {
|
|
1530
|
-
"version": "4.0.
|
|
1531
|
-
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.
|
|
1532
|
-
"integrity": "sha512-
|
|
1530
|
+
"version": "4.0.4",
|
|
1531
|
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
|
1532
|
+
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
|
1533
1533
|
"dev": true,
|
|
1534
1534
|
"license": "MIT",
|
|
1535
1535
|
"engines": {
|
|
@@ -28,11 +28,21 @@ except ImportError:
|
|
|
28
28
|
GRAPH_API = "https://graph.facebook.com/v21.0"
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
def _redact_json(value):
|
|
32
|
+
"""Recursively redact common secret-bearing keys before logging JSON."""
|
|
33
|
+
sensitive_keys = {"authorization", "token", "access_token", "app_secret", "secret"}
|
|
34
|
+
|
|
35
|
+
if isinstance(value, dict):
|
|
36
|
+
redacted = {}
|
|
37
|
+
for key, item in value.items():
|
|
38
|
+
if key.lower() in sensitive_keys:
|
|
39
|
+
redacted[key] = "***redacted***"
|
|
40
|
+
else:
|
|
41
|
+
redacted[key] = _redact_json(item)
|
|
42
|
+
return redacted
|
|
43
|
+
if isinstance(value, list):
|
|
44
|
+
return [_redact_json(item) for item in value]
|
|
45
|
+
return value
|
|
36
46
|
|
|
37
47
|
|
|
38
48
|
def send_test(to: str, message: str) -> None:
|
|
@@ -84,11 +94,7 @@ def send_test(to: str, message: str) -> None:
|
|
|
84
94
|
|
|
85
95
|
print()
|
|
86
96
|
print("Full response:")
|
|
87
|
-
|
|
88
|
-
response_str = json.dumps(data, indent=2)
|
|
89
|
-
if token and token in response_str:
|
|
90
|
-
response_str = response_str.replace(token, _mask_secret(token))
|
|
91
|
-
print(response_str)
|
|
97
|
+
print(json.dumps(_redact_json(data), indent=2))
|
|
92
98
|
|
|
93
99
|
except httpx.ConnectError:
|
|
94
100
|
print("Error: Connection failed. Check your internet connection.")
|
|
@@ -96,10 +102,8 @@ def send_test(to: str, message: str) -> None:
|
|
|
96
102
|
except httpx.TimeoutException:
|
|
97
103
|
print("Error: Request timed out.")
|
|
98
104
|
sys.exit(1)
|
|
99
|
-
except Exception as
|
|
100
|
-
|
|
101
|
-
safe_err = str(e).replace(token, _mask_secret(token)) if token else str(e)
|
|
102
|
-
print(f"Error: {safe_err}")
|
|
105
|
+
except Exception as exc:
|
|
106
|
+
print(f"Error: unexpected {exc.__class__.__name__} while sending the test message.")
|
|
103
107
|
sys.exit(1)
|
|
104
108
|
|
|
105
109
|
|
|
@@ -47,14 +47,19 @@ def check_env_vars() -> tuple[bool, list[str]]:
|
|
|
47
47
|
return len(missing) == 0, missing
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
def
|
|
51
|
-
"""Return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
def _format_api_failure(response: httpx.Response) -> dict[str, str]:
|
|
51
|
+
"""Return sanitized API failure details without echoing sensitive payloads."""
|
|
52
|
+
try:
|
|
53
|
+
error = response.json().get("error", {})
|
|
54
|
+
except ValueError:
|
|
55
|
+
error = {}
|
|
56
|
+
return {
|
|
57
|
+
"status_code": str(response.status_code),
|
|
58
|
+
"error_code": str(error.get("code", "?")),
|
|
59
|
+
}
|
|
55
60
|
|
|
56
61
|
|
|
57
|
-
def test_api_connection() -> tuple[bool, str]:
|
|
62
|
+
def test_api_connection() -> tuple[bool, dict[str, str]]:
|
|
58
63
|
"""Test connection to WhatsApp Cloud API."""
|
|
59
64
|
token = os.environ.get("WHATSAPP_TOKEN", "")
|
|
60
65
|
phone_id = os.environ.get("PHONE_NUMBER_ID", "")
|
|
@@ -69,27 +74,26 @@ def test_api_connection() -> tuple[bool, str]:
|
|
|
69
74
|
|
|
70
75
|
if response.status_code == 200:
|
|
71
76
|
data = response.json()
|
|
72
|
-
return True,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return False, f"API Error {error.get('code', '?')}: {error.get('message', 'Unknown')}"
|
|
77
|
+
return True, {
|
|
78
|
+
"phone": str(data.get("display_phone_number", "N/A")),
|
|
79
|
+
"name": str(data.get("verified_name", "N/A")),
|
|
80
|
+
"status": str(data.get("code_verification_status", "N/A")),
|
|
81
|
+
"quality": str(data.get("quality_rating", "N/A")),
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return False, _format_api_failure(response)
|
|
81
85
|
|
|
82
86
|
except httpx.ConnectError:
|
|
83
|
-
return False, "Connection failed. Check your internet connection."
|
|
87
|
+
return False, {"reason": "Connection failed. Check your internet connection."}
|
|
84
88
|
except httpx.TimeoutException:
|
|
85
|
-
return False, "Request timed out after 10 seconds."
|
|
86
|
-
except Exception as
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
return False, {"reason": "Request timed out after 10 seconds."}
|
|
90
|
+
except Exception as exc:
|
|
91
|
+
return False, {
|
|
92
|
+
"reason": f"Unexpected {exc.__class__.__name__} while contacting the Graph API."
|
|
93
|
+
}
|
|
90
94
|
|
|
91
95
|
|
|
92
|
-
def test_waba_access() -> tuple[bool, str]:
|
|
96
|
+
def test_waba_access() -> tuple[bool, dict[str, str]]:
|
|
93
97
|
"""Test access to WhatsApp Business Account."""
|
|
94
98
|
token = os.environ.get("WHATSAPP_TOKEN", "")
|
|
95
99
|
waba_id = os.environ.get("WABA_ID", "")
|
|
@@ -104,15 +108,14 @@ def test_waba_access() -> tuple[bool, str]:
|
|
|
104
108
|
if response.status_code == 200:
|
|
105
109
|
data = response.json()
|
|
106
110
|
count = len(data.get("data", []))
|
|
107
|
-
return True,
|
|
108
|
-
else:
|
|
109
|
-
error = response.json().get("error", {})
|
|
110
|
-
return False, f"API Error {error.get('code', '?')}: {error.get('message', 'Unknown')}"
|
|
111
|
+
return True, {"count": str(count)}
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return False,
|
|
113
|
+
return False, _format_api_failure(response)
|
|
114
|
+
|
|
115
|
+
except Exception as exc:
|
|
116
|
+
return False, {
|
|
117
|
+
"reason": f"Unexpected {exc.__class__.__name__} while checking WABA access."
|
|
118
|
+
}
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
def main():
|
|
@@ -154,23 +157,37 @@ def main():
|
|
|
154
157
|
|
|
155
158
|
# Check 2: API connection
|
|
156
159
|
print("[2/3] Testing API connection (Phone Number)...")
|
|
157
|
-
api_ok,
|
|
160
|
+
api_ok, api_details = test_api_connection()
|
|
158
161
|
if api_ok:
|
|
159
|
-
print(
|
|
160
|
-
print(f" {
|
|
162
|
+
print(" OK - Connected successfully")
|
|
163
|
+
print(f" Phone: {api_details['phone']}")
|
|
164
|
+
print(f" Name: {api_details['name']}")
|
|
165
|
+
print(f" Status: {api_details['status']}")
|
|
166
|
+
print(f" Quality: {api_details['quality']}")
|
|
161
167
|
else:
|
|
162
|
-
|
|
168
|
+
if "reason" in api_details:
|
|
169
|
+
print(f" FAIL - {api_details['reason']}")
|
|
170
|
+
else:
|
|
171
|
+
print(" FAIL - API request failed.")
|
|
172
|
+
print(f" HTTP Status: {api_details['status_code']}")
|
|
173
|
+
print(f" Error Code: {api_details['error_code']}")
|
|
163
174
|
all_ok = False
|
|
164
175
|
|
|
165
176
|
print()
|
|
166
177
|
|
|
167
178
|
# Check 3: WABA access
|
|
168
179
|
print("[3/3] Testing WABA access...")
|
|
169
|
-
waba_ok,
|
|
180
|
+
waba_ok, waba_details = test_waba_access()
|
|
170
181
|
if waba_ok:
|
|
171
|
-
print(
|
|
182
|
+
print(" OK - WABA accessible")
|
|
183
|
+
print(f" Phone Numbers Found: {waba_details['count']}")
|
|
172
184
|
else:
|
|
173
|
-
|
|
185
|
+
if "reason" in waba_details:
|
|
186
|
+
print(f" FAIL - {waba_details['reason']}")
|
|
187
|
+
else:
|
|
188
|
+
print(" FAIL - API request failed.")
|
|
189
|
+
print(f" HTTP Status: {waba_details['status_code']}")
|
|
190
|
+
print(f" Error Code: {waba_details['error_code']}")
|
|
174
191
|
all_ok = False
|
|
175
192
|
|
|
176
193
|
print()
|
package/package.json
CHANGED