@sigmashake/ssg 0.29.100 → 0.29.101

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
@@ -16,29 +16,39 @@ let binaryPath;
16
16
  // This is checked first so a freshly-installed platform binary always wins over
17
17
  // any stale root-level binary that may have survived from a manual build.
18
18
  //
19
- // Resolve from the global root explicitly so a freshly-installed top-level
20
- // @sigmashake/ssg-<platform>-<arch> wins over a stale nested copy under
21
- // @sigmashake/ssg/node_modules/. Without { paths: [...] }, Node's default
22
- // resolution walks UP from this script and picks the nested copy first —
23
- // which is whatever the published coordinator's optionalDependencies pinned
24
- // at publish time. If a promote-main race shipped main with stale platform
25
- // pins (see 0.29.99 postmortem in promote-main.sh), ssg update can recover
26
- // by installing the platform pkg directly at the global root; this path
27
- // option ensures the launcher actually picks it up.
19
+ // Resolution order:
20
+ // a) global root (e.g. /usr/local/lib/node_modules) lets `npm i -g
21
+ // @sigmashake/ssg-<plat>-<arch>@latest` install at the top level and
22
+ // override a stale nested platform pkg. Recovery path for promote-main
23
+ // races (see 0.29.99 / 0.29.100 postmortems) where the coordinator's
24
+ // optionalDependencies pin an older platform version than what's on npm.
25
+ // b) default (walks UP from __dirname) finds the nested copy at
26
+ // @sigmashake/ssg/node_modules/@sigmashake/ssg-<plat>-<arch>. Required
27
+ // because npm does NOT always hoist optionalDependencies of a globally
28
+ // installed pkg; if (a) misses we MUST find the nested copy or the
29
+ // launcher falls through to step 4 and errors on the missing src/cli.ts.
28
30
  let hookBinPath;
29
31
  let evalServerBinPath;
30
- try {
32
+ {
31
33
  const globalRoot = path.resolve(__dirname, "..", "..", "..");
32
- const pkgRoot = path.dirname(
33
- require.resolve(`${platformPkg}/package.json`, { paths: [globalRoot] }),
34
- );
35
- const candidate = path.join(pkgRoot, "bin", `ssg${ext}`);
36
- if (fs.existsSync(candidate)) binaryPath = candidate;
37
- const hookCandidate = path.join(pkgRoot, "bin", `ssg-hook-fast${ext}`);
38
- if (fs.existsSync(hookCandidate)) hookBinPath = hookCandidate;
39
- const sidecarCandidate = path.join(pkgRoot, "bin", `ssg-eval-server${ext}`);
40
- if (fs.existsSync(sidecarCandidate)) evalServerBinPath = sidecarCandidate;
41
- } catch {}
34
+ let pkgRoot;
35
+ for (const opts of [{ paths: [globalRoot] }, undefined]) {
36
+ try {
37
+ pkgRoot = path.dirname(
38
+ require.resolve(`${platformPkg}/package.json`, opts),
39
+ );
40
+ break;
41
+ } catch {}
42
+ }
43
+ if (pkgRoot) {
44
+ const candidate = path.join(pkgRoot, "bin", `ssg${ext}`);
45
+ if (fs.existsSync(candidate)) binaryPath = candidate;
46
+ const hookCandidate = path.join(pkgRoot, "bin", `ssg-hook-fast${ext}`);
47
+ if (fs.existsSync(hookCandidate)) hookBinPath = hookCandidate;
48
+ const sidecarCandidate = path.join(pkgRoot, "bin", `ssg-eval-server${ext}`);
49
+ if (fs.existsSync(sidecarCandidate)) evalServerBinPath = sidecarCandidate;
50
+ }
51
+ }
42
52
 
43
53
  // 2. Check if binary was bundled in the root (dev: local npm pack or manual build)
44
54
  if (!binaryPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigmashake/ssg",
3
- "version": "0.29.100",
3
+ "version": "0.29.101",
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",
@@ -16,8 +16,8 @@
16
16
  "optionalDependencies": {
17
17
  "@sigmashake/ssg-linux-x64": "0.29.100",
18
18
  "@sigmashake/ssg-linux-arm64": "0.29.100",
19
- "@sigmashake/ssg-darwin-arm64": "0.29.98",
20
- "@sigmashake/ssg-darwin-x64": "0.29.98",
19
+ "@sigmashake/ssg-darwin-arm64": "0.29.101",
20
+ "@sigmashake/ssg-darwin-x64": "0.29.101",
21
21
  "@sigmashake/ssg-win32-x64": "0.29.99"
22
22
  },
23
23
  "scripts": {