rird 2.1.225 → 2.1.227
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/rird +40 -1
- package/package.json +1 -23
package/bin/rird
CHANGED
|
@@ -286,13 +286,52 @@ if (command === "activate") {
|
|
|
286
286
|
const configPath = fs.existsSync(engineConfig) ? engineConfig : brainConfig
|
|
287
287
|
const workDir = fs.existsSync(engineConfig) ? engineDir : brainDir
|
|
288
288
|
|
|
289
|
+
// Sanitize config: remove empty apiKey fields that block env var auth
|
|
290
|
+
if (fs.existsSync(configPath)) {
|
|
291
|
+
try {
|
|
292
|
+
const configContent = fs.readFileSync(configPath, "utf-8")
|
|
293
|
+
const config = JSON.parse(configContent)
|
|
294
|
+
let modified = false
|
|
295
|
+
|
|
296
|
+
// Remove empty apiKey from provider options
|
|
297
|
+
if (config.provider) {
|
|
298
|
+
for (const [name, provider] of Object.entries(config.provider)) {
|
|
299
|
+
if (provider && provider.options && provider.options.apiKey === "") {
|
|
300
|
+
delete provider.options.apiKey
|
|
301
|
+
modified = true
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (modified) {
|
|
307
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2))
|
|
308
|
+
}
|
|
309
|
+
} catch (e) {
|
|
310
|
+
// Ignore config sanitization errors
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
289
314
|
const env = { ...process.env }
|
|
290
315
|
env.RIRD_CONFIG = configPath
|
|
291
316
|
env.RIRD_ENGINE_DIR = workDir
|
|
292
317
|
// Enable RIRD search tools
|
|
293
318
|
env.RIRD_ENABLE_SEARCH = "true"
|
|
294
319
|
|
|
295
|
-
// Inject
|
|
320
|
+
// PRIMARY: Inject license key directly - this is the most reliable auth method
|
|
321
|
+
const licenseKeyPath = path.join(rirdHome, "license.key")
|
|
322
|
+
if (fs.existsSync(licenseKeyPath)) {
|
|
323
|
+
try {
|
|
324
|
+
const licenseKey = fs.readFileSync(licenseKeyPath, "utf-8").trim()
|
|
325
|
+
if (licenseKey) {
|
|
326
|
+
env.RIRD_LICENSE_KEY = licenseKey
|
|
327
|
+
env.RIRD_API_KEY = licenseKey
|
|
328
|
+
}
|
|
329
|
+
} catch (e) {
|
|
330
|
+
// Ignore read errors
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// FALLBACK: Inject provider API keys from license cache
|
|
296
335
|
const licenseCachePath = path.join(rirdHome, "license_cache.json")
|
|
297
336
|
if (fs.existsSync(licenseCachePath)) {
|
|
298
337
|
try {
|
package/package.json
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rird",
|
|
3
|
-
"version": "2.1.225",
|
|
4
|
-
"bin": {
|
|
5
|
-
"rird": "./bin/rird"
|
|
6
|
-
},
|
|
7
|
-
"scripts": {
|
|
8
|
-
"postinstall": "node ./postinstall.mjs"
|
|
9
|
-
},
|
|
10
|
-
"optionalDependencies": {
|
|
11
|
-
"rird-linux-arm64": "2.1.225",
|
|
12
|
-
"rird-linux-x64": "2.1.225",
|
|
13
|
-
"rird-linux-x64-baseline": "2.1.225",
|
|
14
|
-
"rird-linux-arm64-musl": "2.1.225",
|
|
15
|
-
"rird-linux-x64-musl": "2.1.225",
|
|
16
|
-
"rird-linux-x64-baseline-musl": "2.1.225",
|
|
17
|
-
"rird-darwin-arm64": "2.1.225",
|
|
18
|
-
"rird-darwin-x64": "2.1.225",
|
|
19
|
-
"rird-darwin-x64-baseline": "2.1.225",
|
|
20
|
-
"rird-windows-x64": "2.1.225",
|
|
21
|
-
"rird-windows-x64-baseline": "2.1.225"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
{"name":"rird","version":"2.1.227","bin":{"rird":"./bin/rird"},"scripts":{"postinstall":"node ./postinstall.mjs"},"optionalDependencies":{"rird-linux-arm64":"2.1.227","rird-linux-x64":"2.1.227","rird-linux-x64-baseline":"2.1.227","rird-linux-arm64-musl":"2.1.227","rird-linux-x64-musl":"2.1.227","rird-linux-x64-baseline-musl":"2.1.227","rird-darwin-arm64":"2.1.227","rird-darwin-x64":"2.1.227","rird-darwin-x64-baseline":"2.1.227","rird-windows-x64":"2.1.227","rird-windows-x64-baseline":"2.1.227"}}
|