evolcore 0.0.6 → 0.0.7

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  本文件记录 EvolCore 的重要变更。EvolClaw 版本线的历史记录已归档至
4
4
  [`docs/_archive/CHANGELOG-evolclaw.md`](docs/_archive/CHANGELOG-evolclaw.md)。
5
5
 
6
+ ## 0.0.7 (2026-08-03)
7
+
8
+ ### 运行可靠性
9
+
10
+ - 修复 restart-monitor 直接重启 daemon 时未同步拉起 ECWeb 的问题,避免依赖反向隧道的服务在自愈重启后失联。
11
+
6
12
  ## 0.0.6 (2026-08-03)
7
13
 
8
14
  ### 跨渠道消息与会话迁移
@@ -111,7 +111,7 @@ function buildDaemonEnv(p, opts) {
111
111
  ...(opts.bindBootstrap ? { EVOLCORE_BIND_BOOTSTRAP: '1' } : {}),
112
112
  };
113
113
  }
114
- function serviceProxyNeedsEcweb(cfg) {
114
+ export function serviceProxyNeedsEcweb(cfg) {
115
115
  if (!cfg.serviceProxy?.enabled)
116
116
  return false;
117
117
  return (cfg.serviceProxy.services ?? []).some(s => s.enabled !== false && s.source === 'ecweb');
@@ -2530,7 +2530,12 @@ function ensureServiceProxyConfig(cfg, port) {
2530
2530
  console.log(` 自动配置 Service Proxy: https://${cfg.aid}/proxy/ecweb/`);
2531
2531
  }
2532
2532
  }
2533
- async function startEcwebIfEnabled(p) {
2533
+ /**
2534
+ * Start the separately installed `ec-web` process for a configured runtime.
2535
+ * Kept public for restart-monitor, which launches the daemon directly and
2536
+ * therefore cannot rely on cmdStart's post-ready ECWeb startup path.
2537
+ */
2538
+ export async function startEcwebIfEnabled(p) {
2534
2539
  const cfg = loadDaemonConfig();
2535
2540
  if (!cfg.ecweb?.enabled)
2536
2541
  return false;
@@ -15,6 +15,7 @@ import { WEB_PACKAGE_NAME } from '../product.js';
15
15
  import { shouldSuppressRealRestart } from '../utils/restart-safety.js';
16
16
  import { rotateStdoutLog } from '../utils/log-writer.js';
17
17
  import { inspectDataMigrationRequirement } from '../core/data-migration.js';
18
+ import { serviceProxyNeedsEcweb, startEcwebIfEnabled } from './daemon-commands.js';
18
19
  const execFileAsync = promisify(execFile);
19
20
  // 清理 Claude Code 环境变量,防止 SDK 认为是嵌套会话
20
21
  function cleanEnv() {
@@ -177,9 +178,22 @@ export async function cmdRestartMonitor() {
177
178
  await notifyDaemonOwners(p, `⚠️ ${WEB_PACKAGE_NAME} 升级失败,使用当前版本继续\n${ecwebUpgrade.error ?? ''}`.trim(), log);
178
179
  break;
179
180
  }
181
+ // source=ecweb 的 Service Proxy 只在 daemon 启动后的短窗口内发现实例。
182
+ // restart-monitor 直接 spawn daemon,必须在此先启动独立的 ec-web,不能绕过
183
+ // cmdStart 的 ECWeb 生命周期逻辑。
184
+ const ecwebStartedBeforeDaemon = serviceProxyNeedsEcweb(loadDaemonConfig())
185
+ ? await startEcwebIfEnabled(p)
186
+ : false;
187
+ if (ecwebStartedBeforeDaemon)
188
+ log('ECWeb started before daemon');
180
189
  // 启动并检测 ready signal
181
190
  let started = await spawnAndWaitReady(p, log, READY_TIMEOUT);
182
191
  if (started) {
192
+ // 没有 Service Proxy 时可以等 daemon ready 后再启动;有代理时已在上方启动,
193
+ // 避免重新拉起造成实例记录和反向隧道短暂失配。
194
+ if (!ecwebStartedBeforeDaemon && await startEcwebIfEnabled(p)) {
195
+ log('ECWeb started after daemon');
196
+ }
183
197
  log('✓ Service restarted successfully');
184
198
  archiveSelfHealLog(p, log);
185
199
  // 发起会话内的“重启成功”通知由新进程自行发送,此处只负责失败/自愈告警。
package/dist/index.js CHANGED
@@ -1961,7 +1961,9 @@ async function main() {
1961
1961
  }
1962
1962
  }
1963
1963
  else {
1964
- logger.warn(`ECWeb 配置已启用但未找到 ${ecwebEntry}`);
1964
+ // 正式安装时 ECWeb 是独立的全局 ec-web 包,由 ec start/restart 的
1965
+ // 启动链路管理;runtime 目录没有内嵌构建产物是正常状态。
1966
+ logger.debug(`ECWeb runtime entry absent (managed externally): ${ecwebEntry}`);
1965
1967
  }
1966
1968
  }
1967
1969
  // 控制 AID 接收 owner 指令:
@@ -366,8 +366,8 @@ export function findOrphanProcesses() {
366
366
  // 二次验证:确实是 evolcore 的 dist/index.js
367
367
  if (!/dist[\\/]index\.js/.test(cmdline))
368
368
  continue;
369
- // 三次验证:排除 ecweb(/ecweb/dist/index.js)
370
- if (/[\\/]ecweb[\\/]dist[\\/]index\.js/.test(cmdline))
369
+ // 三次验证:排除内嵌 ecweb 与独立 npm 包 ec-web。
370
+ if (/[\\/](?:ecweb|ec-web)[\\/]dist[\\/]index\.js/.test(cmdline))
371
371
  continue;
372
372
  const processEnv = readProcessEnvironment(pid);
373
373
  orphans.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evolcore",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "AI Agent gateway connecting Claude, Codex, Gemini, and the bundled ecagent runner to messaging channels with multi-project session management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",