shennian 0.2.21 → 0.2.23
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.
|
@@ -13,14 +13,13 @@ export function restartCurrentDaemonAfterUpgrade(deps = {}) {
|
|
|
13
13
|
const spawnFn = deps.spawn ?? spawn;
|
|
14
14
|
const execSyncFn = deps.execSync ?? execSync;
|
|
15
15
|
if (platform === 'win32') {
|
|
16
|
-
const
|
|
16
|
+
const command = env.ComSpec || 'cmd.exe';
|
|
17
17
|
try {
|
|
18
|
-
const child = spawnFn(
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
delayedStart,
|
|
18
|
+
const child = spawnFn(command, [
|
|
19
|
+
'/d',
|
|
20
|
+
'/s',
|
|
21
|
+
'/c',
|
|
22
|
+
'timeout /t 2 /nobreak >nul & schtasks /Run /TN ShennianAgent >nul',
|
|
24
23
|
], {
|
|
25
24
|
detached: true,
|
|
26
25
|
stdio: 'ignore',
|
package/dist/src/index.js
CHANGED
|
@@ -16,6 +16,8 @@ import { SERVERS, regionToUrl, urlToRegion } from './region.js';
|
|
|
16
16
|
import { getCurrentVersion, handleStartupCrashCheck, checkForUpdate, isUpgradeVersionInCooldown, recordUpgradeFailure, } from './upgrade/engine.js';
|
|
17
17
|
import { detectAgents } from './agents/detect.js';
|
|
18
18
|
const cliVersion = getCurrentVersion();
|
|
19
|
+
const AUTO_UPGRADE_INITIAL_DELAY_MS = 30_000;
|
|
20
|
+
const AUTO_UPGRADE_POLL_INTERVAL_MS = 5 * 60_000;
|
|
19
21
|
import { getCachedAgentInfos, resolveAgentInfos } from './agents/model-registry.js';
|
|
20
22
|
import { initCliLogReporter, reportLog } from './log-reporter.js';
|
|
21
23
|
import { NativeSessionFusionService } from './native-fusion/service.js';
|
|
@@ -320,6 +322,6 @@ async function scheduleAutoUpgrade(client, policy) {
|
|
|
320
322
|
};
|
|
321
323
|
// Delay slightly so we don't hit npm on every cold start during development,
|
|
322
324
|
// then keep polling so a bad published patch can be superseded by a good one.
|
|
323
|
-
setTimeout(() => void tick(),
|
|
324
|
-
setInterval(() => void tick(),
|
|
325
|
+
setTimeout(() => void tick(), AUTO_UPGRADE_INITIAL_DELAY_MS);
|
|
326
|
+
setInterval(() => void tick(), AUTO_UPGRADE_POLL_INTERVAL_MS);
|
|
325
327
|
}
|