engrm 0.3.0 → 0.3.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.
- package/dist/cli.js +11 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2299,6 +2299,15 @@ Authorization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
|
2299
2299
|
}
|
|
2300
2300
|
function writeConfigFromProvision(baseUrl, result) {
|
|
2301
2301
|
ensureConfigDir();
|
|
2302
|
+
let existingDeviceId;
|
|
2303
|
+
let existingSentinel;
|
|
2304
|
+
if (configExists()) {
|
|
2305
|
+
try {
|
|
2306
|
+
const existing = loadConfig();
|
|
2307
|
+
existingDeviceId = existing.device_id;
|
|
2308
|
+
existingSentinel = existing.sentinel;
|
|
2309
|
+
} catch {}
|
|
2310
|
+
}
|
|
2302
2311
|
const config = {
|
|
2303
2312
|
candengo_url: baseUrl,
|
|
2304
2313
|
candengo_api_key: result.api_key,
|
|
@@ -2306,7 +2315,7 @@ function writeConfigFromProvision(baseUrl, result) {
|
|
|
2306
2315
|
namespace: result.namespace,
|
|
2307
2316
|
user_id: result.user_id,
|
|
2308
2317
|
user_email: result.user_email,
|
|
2309
|
-
device_id: generateDeviceId2(),
|
|
2318
|
+
device_id: existingDeviceId || generateDeviceId2(),
|
|
2310
2319
|
teams: result.teams ?? [],
|
|
2311
2320
|
sync: {
|
|
2312
2321
|
enabled: true,
|
|
@@ -2323,7 +2332,7 @@ function writeConfigFromProvision(baseUrl, result) {
|
|
|
2323
2332
|
custom_patterns: [],
|
|
2324
2333
|
default_sensitivity: "shared"
|
|
2325
2334
|
},
|
|
2326
|
-
sentinel: {
|
|
2335
|
+
sentinel: existingSentinel ?? {
|
|
2327
2336
|
enabled: false,
|
|
2328
2337
|
mode: "advisory",
|
|
2329
2338
|
provider: "openai",
|