mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 22:11:12 +00:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import type { Logger } from "pino";
|
|
|
|
import { createV8CodeCacheService } from "../composition/v8CodeCache.js";
|
|
import { V8_CODE_CACHE_TOOL_CONTRACTS } from "../contracts/v8/v8CodeCacheToolContracts.js";
|
|
import { contractNamed } from "./contractCliDescription.js";
|
|
import { registerContractCommand } from "./contractCommand.js";
|
|
import { inspectWithService } from "./contractCommandRunners.js";
|
|
import type { CliInstance } from "./types.js";
|
|
|
|
/** Inspect operator-selected V8 code caches through the same shared workflow as MCP. */
|
|
export const registerV8CodeCacheCommands = (
|
|
cli: CliInstance,
|
|
logger: Logger,
|
|
): void => {
|
|
const contract = contractNamed(
|
|
V8_CODE_CACHE_TOOL_CONTRACTS,
|
|
"inspect_v8_code_cache",
|
|
);
|
|
registerContractCommand(
|
|
cli,
|
|
logger,
|
|
contract,
|
|
{
|
|
description:
|
|
"Inspect a V8 code cache header and its embedded printable byte patterns without executing it",
|
|
positionals: ["path"],
|
|
callerPaths: ["path"],
|
|
fields: { path: { description: "Local V8 code cache (.jsc) file" } },
|
|
},
|
|
inspectWithService(createV8CodeCacheService, "rea-v8-code-cache"),
|
|
);
|
|
};
|