advance 1-8 post-mvp execution batches

This commit is contained in:
lix-2026
2026-05-21 23:53:39 +08:00
parent 3ebcbff728
commit fdb20300e9
67 changed files with 4378 additions and 275 deletions
+21 -1
View File
@@ -26,6 +26,8 @@ import { AsyncLocalStorage } from 'node:async_hooks';
import { readFileSync, existsSync } from 'node:fs';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { execFileSync } from 'node:child_process';
const MNOTE_WEB_URL = process.env.MNOTE_WEB_URL || 'http://127.0.0.1:3000';
const DEBUG = process.env.MNOTE_REASONIX_ACP_DEBUG === '1';
@@ -162,8 +164,26 @@ process.env.DEEPSEEK_API_KEY = DEEPSEEK_API_KEY;
// ── Dynamic import of reasonix public API ────────────
let CacheFirstLoop, DeepSeekClient, ToolRegistry, ImmutablePrefix;
async function importReasonix() {
try {
return await import('reasonix');
} catch (error) {
let npmRoot = '';
try {
npmRoot = execFileSync('npm', ['root', '-g'], { encoding: 'utf8' }).trim();
} catch {
throw error;
}
const globalEntry = join(npmRoot, 'reasonix', 'dist', 'index.js');
if (!existsSync(globalEntry)) {
throw error;
}
return import(pathToFileURL(globalEntry).href);
}
}
try {
const r = await import('reasonix');
const r = await importReasonix();
CacheFirstLoop = r.CacheFirstLoop;
DeepSeekClient = r.DeepSeekClient;
ToolRegistry = r.ToolRegistry;