@sigmashake/ssg 0.29.28 → 0.29.30

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/bin/ssg.cjs CHANGED
@@ -44,6 +44,40 @@ if (!binaryPath) {
44
44
  if (fs.existsSync(devBin)) binaryPath = devBin;
45
45
  }
46
46
 
47
+ // 2.5 Hook-eval fast-path short-circuit (perf):
48
+ // `ssg hook eval` is invoked by Claude Code / Cursor on EVERY tool call.
49
+ // The bun-compiled `ssg` binary takes ~1s just to boot on macOS without
50
+ // notarization (no dyld closure caching). The Zig `ssg-hook-fast` binary
51
+ // does the same eval in ~40ms. When called as `hook eval` and the fast
52
+ // bin exists, exec it directly and skip bun entirely.
53
+ //
54
+ // Exit status 99 is the Zig binary's "fall through to JS" sentinel
55
+ // (ask-mode / TTY prompts that need the full Bun runtime). Anything
56
+ // else — allow (0), redirect (non-zero), deny (non-zero) — the Zig
57
+ // binary handles natively.
58
+ //
59
+ // Without this short-circuit, every Claude Code Bash command pays the
60
+ // full bun-startup cost on macOS (~1.3 s), even though the actual eval
61
+ // only takes ~40 ms.
62
+ if (
63
+ hookBinPath &&
64
+ process.env['SSG_HOOK_NO_FAST'] !== '1' &&
65
+ process.argv.length === 4 &&
66
+ process.argv[2] === 'hook' &&
67
+ process.argv[3] === 'eval'
68
+ ) {
69
+ const env = { ...process.env, SSG_PUBLIC_DIR: path.resolve(__dirname, '..', 'public') };
70
+ if (evalServerBinPath) env['SSG_EVAL_SERVER_BIN'] = evalServerBinPath;
71
+ const r = spawnSync(hookBinPath, [], { stdio: 'inherit', env, windowsHide: true });
72
+ // status 99 = sentinel for "needs JS path" (ask mode, TTY) — fall through.
73
+ // null/undefined status with error → fall through and let bun ssg handle.
74
+ if (r.status !== 99 && r.status !== null && r.status !== undefined && !r.error) {
75
+ process.exit(r.status);
76
+ }
77
+ // Otherwise fall through to the bun ssg below (handles ask mode, TTY,
78
+ // and surface any error diagnostics consistently with the rest of the CLI).
79
+ }
80
+
47
81
  // 3. Run binary if found
48
82
  if (binaryPath) {
49
83
  const env = { ...process.env, SSG_PUBLIC_DIR: path.resolve(__dirname, '..', 'public') };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigmashake/ssg",
3
- "version": "0.29.28",
3
+ "version": "0.29.30",
4
4
  "description": "AI Agent Governance CLI — evaluate tool calls against rules, block dangerous operations, and surface blocked commands",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -14,8 +14,8 @@
14
14
  "README.md"
15
15
  ],
16
16
  "optionalDependencies": {
17
- "@sigmashake/ssg-linux-x64": "0.29.28",
18
- "@sigmashake/ssg-linux-arm64": "0.29.28",
17
+ "@sigmashake/ssg-linux-x64": "0.29.30",
18
+ "@sigmashake/ssg-linux-arm64": "0.29.30",
19
19
  "@sigmashake/ssg-darwin-arm64": "0.29.27",
20
20
  "@sigmashake/ssg-darwin-x64": "0.29.27",
21
21
  "@sigmashake/ssg-win32-x64": "0.29.21"