Return explicit method intents in reference indexes while preserving all full contracts, topic matching and complete MCP catalogs. Separate provider-free contracts from session admission and defer native loading until open. Validate 82 related tests, exact SDK/MCP full-contract parity, real zlib CLI/SDK reads and native/inspection cleanup retries. Freeze the unchanged two-level question for an order-reversed real-model repeat. Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
21 lines
588 B
JavaScript
21 lines
588 B
JavaScript
import { readFile } from "node:fs/promises";
|
|
import { AtomicSession } from "./session.mjs";
|
|
import { executeJavaScript } from "./executor.mjs";
|
|
|
|
const [binary, script] = process.argv.slice(2);
|
|
if (!binary || !script)
|
|
throw new Error("Usage: node cli.mjs BINARY JAVASCRIPT_FILE");
|
|
const session = new AtomicSession();
|
|
try {
|
|
await session.open(binary);
|
|
const result = await executeJavaScript(
|
|
session,
|
|
await readFile(script, "utf8"),
|
|
);
|
|
console.log(JSON.stringify(result));
|
|
process.exitCode = result.ok ? 0 : 1;
|
|
} finally {
|
|
session.abort();
|
|
await session.close();
|
|
}
|