blun-king-cli 9.1.62 → 9.1.63

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 (49) hide show
  1. package/bin/context-performance-policy.cjs +18 -0
  2. package/bin/launcher-runtime.js +2 -2
  3. package/bin/package-regression-policy.cjs +77 -0
  4. package/bin/provider-idle-timeout-policy.cjs +14 -0
  5. package/bin/skill-listing-performance-policy.cjs +33 -0
  6. package/bin/standard-tools-bootstrap.js +80 -26
  7. package/bin/turn-thinking-policy.cjs +66 -0
  8. package/bin/turn-tool-performance-policy.cjs +141 -0
  9. package/blun.mjs +519 -220
  10. package/package.json +4 -1
  11. package/release-planned-removals.json +4 -0
  12. package/scripts/check-package-regression.js +38 -0
  13. package/standard-skills/agent-browser/SKILL.md +19 -0
  14. package/standard-skills/agent-browser/references/runtime.md +8 -0
  15. package/standard-skills/design-taste-frontend/SKILL.md +1206 -0
  16. package/standard-skills/full-output-enforcement/SKILL.md +49 -0
  17. package/standard-skills/high-end-visual-design/SKILL.md +98 -0
  18. package/standard-skills/image-to-code/SKILL.md +1228 -0
  19. package/standard-skills/industrial-brutalist-ui/SKILL.md +92 -0
  20. package/standard-skills/minimalist-ui/SKILL.md +85 -0
  21. package/standard-skills/motion-design-taste/SKILL.md +74 -0
  22. package/standard-skills/playwright-testing/SKILL.md +19 -0
  23. package/standard-skills/playwright-testing/references/runtime.md +7 -0
  24. package/standard-skills/premortem/SKILL.md +148 -0
  25. package/standard-skills/redesign-existing-projects/SKILL.md +178 -0
  26. package/standard-skills/screenshot-lesen/SKILL.md +52 -0
  27. package/standard-skills/stitch-design-taste/DESIGN.md +121 -0
  28. package/standard-skills/stitch-design-taste/SKILL.md +184 -0
  29. package/standard-skills/telegram-channel/SKILL.md +18 -0
  30. package/standard-skills/telegram-channel/references/runtime.md +7 -0
  31. package/standard-skills/translate-native/LICENSE +21 -0
  32. package/standard-skills/translate-native/SKILL.md +39 -0
  33. package/standard-skills/translate-native/VERSION +1 -0
  34. package/standard-skills/translate-native/provenance.json +7 -0
  35. package/standard-skills/translate-native/references/evaluation-protocol.md +95 -0
  36. package/standard-skills/translate-native/references/native-orthography.md +79 -0
  37. package/standard-skills/translate-native/references/native-translation-standard.md +94 -0
  38. package/standard-skills/translate-native/references/structured-content.md +72 -0
  39. package/standard-skills/translate-native/references/translationese-review.md +77 -0
  40. package/standard-skills/translate-native/scripts/blun_language_guard.py +686 -0
  41. package/standard-skills/translate-native/scripts/check_diacritics.py +353 -0
  42. package/standard-skills/translate-native/scripts/guard_service_client.py +82 -0
  43. package/standard-skills/translate-native/scripts/language_gateway.py +62 -0
  44. package/standard-skills/translate-native/scripts/language_quality.py +172 -0
  45. package/standard-skills/translate-native/scripts/pre_output_guard.py +67 -0
  46. package/standard-skills/translate-native/scripts/translation_guard.py +916 -0
  47. package/standard-skills/web-lesen/SKILL.md +58 -0
  48. package/standard-skills/windows-mcp/SKILL.md +19 -0
  49. package/standard-skills/windows-mcp/references/runtime.md +9 -0
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env python3
2
+ """Installed-skill hook that verifies an exact current V6 release receipt."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import hashlib
7
+ import importlib.util
8
+ import json
9
+ import os
10
+ import stat
11
+ import sys
12
+ from pathlib import Path
13
+
14
+
15
+ QUALITY_PATH = Path(__file__).with_name("language_quality.py")
16
+ SPEC = importlib.util.spec_from_file_location("blun_installed_hook_quality", QUALITY_PATH)
17
+ assert SPEC and SPEC.loader
18
+ QUALITY = importlib.util.module_from_spec(SPEC)
19
+ SPEC.loader.exec_module(QUALITY)
20
+
21
+
22
+ def load_verification_key(path: Path) -> bytes:
23
+ """Load an existing verifier key without creating or replacing trust state."""
24
+ environment_key = os.environ.get("BLUN_LANGUAGE_GUARD_KEY")
25
+ if environment_key:
26
+ return hashlib.sha256(environment_key.encode("utf-8")).digest()
27
+ try:
28
+ mode = stat.S_IMODE(path.stat().st_mode)
29
+ if os.name != "nt" and mode & 0o077:
30
+ raise ValueError("signing key permissions are broader than owner-only")
31
+ key = path.read_bytes()
32
+ except FileNotFoundError as error:
33
+ raise ValueError("signing key is missing; verification fails closed") from error
34
+ except OSError as error:
35
+ raise ValueError("signing key cannot be read") from error
36
+ if len(key) < 32:
37
+ raise ValueError("signing key is invalid")
38
+ return key
39
+
40
+
41
+ def main() -> int:
42
+ try:
43
+ request = json.loads(sys.stdin.read().lstrip("\ufeff"))
44
+ task_kind = request["task_kind"]
45
+ source = request.get("source_text", "")
46
+ if task_kind not in {"translation", "response"}:
47
+ raise ValueError("task_kind must be translation or response")
48
+ if task_kind == "translation" and not source.strip():
49
+ raise ValueError("translation receipts require source_text")
50
+ if task_kind == "response" and source.strip():
51
+ raise ValueError("response receipts cannot carry source_text")
52
+ key_path = Path(os.environ.get("BLUN_LANGUAGE_GUARD_KEY_FILE", Path.home() / ".config" / "blun-language-guard" / "signing.key"))
53
+ result = QUALITY.verify_receipt(
54
+ request["release_token"], source, request["target_text"],
55
+ request["language"], load_verification_key(key_path),
56
+ request.get("content_type", "prose"), request.get("short_text_reviewed") is True,
57
+ purpose=task_kind,
58
+ )
59
+ except (KeyError, ValueError, json.JSONDecodeError, OSError) as error:
60
+ print(json.dumps({"allow": False, "error": str(error)}))
61
+ return 1
62
+ print(json.dumps({"allow": result["valid"], "verification": result}))
63
+ return 0 if result["valid"] else 1
64
+
65
+
66
+ if __name__ == "__main__":
67
+ raise SystemExit(main())