@studio-foundation/cli 0.16.0 → 0.17.1

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.
@@ -0,0 +1,40 @@
1
+ // Which @studio-foundation/cli-<platform> package holds a binary this host can run.
2
+ // Extracted from studio.mjs so the choice is testable without spawning anything.
3
+
4
+ import { readFileSync } from 'node:fs';
5
+
6
+ /** A musl runtime reports no glibc version; the two are not interchangeable. */
7
+ export function isMusl() {
8
+ return !process.report.getReport().header.glibcVersionRuntime;
9
+ }
10
+
11
+ /**
12
+ * Whether this CPU has AVX2, which Bun's default x64 build is compiled against.
13
+ *
14
+ * Unreadable /proc means assuming it does: that is what shipped before this check,
15
+ * and a wrong `false` would hand a slower binary to every host with a hidden /proc.
16
+ */
17
+ export function hasAvx2() {
18
+ try {
19
+ return /^flags\s*:.*\bavx2\b/m.test(readFileSync('/proc/cpuinfo', 'utf-8'));
20
+ } catch {
21
+ return true;
22
+ }
23
+ }
24
+
25
+ export function platformKey({
26
+ platform = process.platform,
27
+ arch = process.arch,
28
+ musl,
29
+ avx2,
30
+ } = {}) {
31
+ if (arch !== 'x64' && arch !== 'arm64') return null;
32
+ if (platform === 'darwin') return `darwin-${arch}`;
33
+ if (platform === 'win32') return arch === 'x64' ? 'win-x64' : null;
34
+ if (platform !== 'linux') return null;
35
+
36
+ // Without AVX2 the default x64 binary dies on SIGILL — no message, no exit code a
37
+ // human can read (STU-974). The baseline build is the same CLI compiled for it.
38
+ const suffix = arch === 'x64' && !(avx2 ?? hasAvx2()) ? '-baseline' : '';
39
+ return `linux-${arch}${(musl ?? isMusl()) ? '-musl' : ''}${suffix}`;
40
+ }
package/bin/studio.mjs CHANGED
@@ -6,20 +6,9 @@
6
6
  import { spawnSync } from 'node:child_process';
7
7
  import { createRequire } from 'node:module';
8
8
 
9
- const require = createRequire(import.meta.url);
9
+ import { platformKey } from './platform-key.mjs';
10
10
 
11
- function platformKey() {
12
- const arch = process.arch === 'x64' || process.arch === 'arm64' ? process.arch : null;
13
- if (!arch) return null;
14
- if (process.platform === 'darwin') return `darwin-${arch}`;
15
- if (process.platform === 'win32') return arch === 'x64' ? 'win-x64' : null;
16
- if (process.platform === 'linux') {
17
- // A musl runtime reports no glibc version; the two are not interchangeable.
18
- const musl = !process.report.getReport().header.glibcVersionRuntime;
19
- return `linux-${arch}${musl ? '-musl' : ''}`;
20
- }
21
- return null;
22
- }
11
+ const require = createRequire(import.meta.url);
23
12
 
24
13
  const platform = platformKey();
25
14
  let binary = null;
@@ -28,7 +17,9 @@ if (platform) {
28
17
  try {
29
18
  binary = require.resolve(`@studio-foundation/cli-${platform}/${exe}`);
30
19
  } catch {
31
- // No platform package installed — fall through to the JS build.
20
+ // No platform package installed — fall through to the JS build. A musl x64 host
21
+ // without AVX2 lands here: there is no musl baseline package, and the JS build
22
+ // runs on any CPU.
32
23
  }
33
24
  }
34
25
 
@@ -1,4 +1,4 @@
1
- export declare const PACKAGE_VERSION = "0.16.0";
1
+ export declare const PACKAGE_VERSION = "0.17.1";
2
2
  /** Contents of cli/templates/, keyed by path relative to that directory. */
3
3
  export declare const BUNDLED_ASSETS: Record<string, string>;
4
4
  //# sourceMappingURL=bundled-assets.d.ts.map
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/gen-bundled-assets.mjs — do not edit.
2
- export const PACKAGE_VERSION = "0.16.0";
2
+ export const PACKAGE_VERSION = "0.17.1";
3
3
  /** Contents of cli/templates/, keyed by path relative to that directory. */
4
4
  export const BUNDLED_ASSETS = {
5
5
  ".studiorc.yaml": "# Studio Configuration\n\nproviders:\n anthropic:\n apiKey: ${ANTHROPIC_API_KEY}\n # openai:\n # apiKey: ${OPENAI_API_KEY}\n\npaths:\n pipelines: ./pipelines\n contracts: ./configs/contracts\n agents: ./configs/agents\n\ndefaults:\n provider: anthropic\n model: claude-sonnet-4-20250514\n",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-foundation/cli",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "CLI for Studio — declarative YAML runtime for AI agents with structured output validation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,10 +29,10 @@
29
29
  "js-yaml": "^4.1.1",
30
30
  "ora": "^9.3.0",
31
31
  "semver": "^7.7.2",
32
- "@studio-foundation/api": "0.16.0",
33
- "@studio-foundation/runner": "0.16.0",
34
- "@studio-foundation/contracts": "0.16.0",
35
- "@studio-foundation/engine": "0.16.0"
32
+ "@studio-foundation/api": "0.17.1",
33
+ "@studio-foundation/engine": "0.17.1",
34
+ "@studio-foundation/contracts": "0.17.1",
35
+ "@studio-foundation/runner": "0.17.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/js-yaml": "^4.0.9",
@@ -42,13 +42,14 @@
42
42
  "vitest": "^4.0.18"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@studio-foundation/cli-darwin-arm64": "0.16.0",
46
- "@studio-foundation/cli-darwin-x64": "0.16.0",
47
- "@studio-foundation/cli-linux-arm64": "0.16.0",
48
- "@studio-foundation/cli-linux-arm64-musl": "0.16.0",
49
- "@studio-foundation/cli-linux-x64": "0.16.0",
50
- "@studio-foundation/cli-linux-x64-musl": "0.16.0",
51
- "@studio-foundation/cli-win-x64": "0.16.0"
45
+ "@studio-foundation/cli-darwin-arm64": "0.17.1",
46
+ "@studio-foundation/cli-darwin-x64": "0.17.1",
47
+ "@studio-foundation/cli-linux-arm64": "0.17.1",
48
+ "@studio-foundation/cli-linux-arm64-musl": "0.17.1",
49
+ "@studio-foundation/cli-linux-x64": "0.17.1",
50
+ "@studio-foundation/cli-linux-x64-baseline": "0.17.1",
51
+ "@studio-foundation/cli-linux-x64-musl": "0.17.1",
52
+ "@studio-foundation/cli-win-x64": "0.17.1"
52
53
  },
53
54
  "scripts": {
54
55
  "prebuild": "node ../scripts/gen-bundled-assets.mjs",