car-runtime 0.4.3 → 0.4.5

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 (2) hide show
  1. package/install.js +9 -4
  2. package/package.json +2 -2
package/install.js CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  const fs = require('node:fs');
8
8
  const path = require('node:path');
9
+ const http = require('node:http');
9
10
  const https = require('node:https');
10
11
  const { pipeline } = require('node:stream/promises');
11
12
 
@@ -37,7 +38,10 @@ function pkgVersion() {
37
38
 
38
39
  function get(url) {
39
40
  return new Promise((resolve, reject) => {
40
- const req = https.get(
41
+ // Select transport by scheme. Production URLs are always https; http is
42
+ // supported so CAR_RUNTIME_DOWNLOAD_BASE can point at a local mirror / test.
43
+ const mod = url.startsWith('http://') ? http : https;
44
+ const req = mod.get(
41
45
  url,
42
46
  { headers: { 'user-agent': `car-runtime-install/${pkgVersion()}` } },
43
47
  (res) => {
@@ -93,9 +97,10 @@ async function main() {
93
97
  `Place ${name} manually in ${__dirname} or set CAR_RUNTIME_SKIP_DOWNLOAD=1 ` +
94
98
  `and ensure the binary is resolvable at require-time.`,
95
99
  );
96
- // Exit 0 so `npm install` doesn't fail the whole project — the require()
97
- // in index.js will surface a clear error if the binary is missing.
98
- process.exit(0);
100
+ // Exit non-zero so `npm install` fails loudly instead of silently producing
101
+ // a broken package. CAR_RUNTIME_SKIP_DOWNLOAD=1 remains the escape hatch
102
+ // for air-gapped installs; see the opt-out branch above.
103
+ process.exit(1);
99
104
  }
100
105
  }
101
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "car-runtime",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Common Agent Runtime — a deterministic execution layer for AI agents",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -38,7 +38,7 @@
38
38
  "LICENSE"
39
39
  ],
40
40
  "scripts": {
41
- "install": "node install.js || true"
41
+ "install": "node install.js"
42
42
  },
43
43
  "license": "SEE LICENSE IN LICENSE",
44
44
  "private": false