7a788a9d90
CI / check (pull_request) Successful in 2m31s
- All 5 CLI bins: shebang --disable-warning=ExperimentalWarning - Remove NODE_OPTIONS injection from thread.ts spawn (redundant now) - Bootstrap pip install: venv (recommended) / pipx / source options - setup --help mentions interactive wizard mode - Update shebang test to accept -S flag Fixes #116
26 lines
879 B
JavaScript
26 lines
879 B
JavaScript
#!/usr/bin/env -S node --disable-warning=ExperimentalWarning
|
|
|
|
// eslint-disable-next-line -- dynamic import for version
|
|
const pkg = await import("../package.json", { with: { type: "json" } });
|
|
if (process.argv.includes("--version") || process.argv.includes("-V")) {
|
|
process.stdout.write(`${pkg.default.version}\n`);
|
|
process.exit(0);
|
|
}
|
|
|
|
import { createMockAgent } from "./mock-agent.js";
|
|
|
|
const USAGE = "usage: uwf-mock --mock-data <path> --thread <id> --role <role> --prompt <text>";
|
|
|
|
function getMockDataPath(argv: string[]): string {
|
|
const idx = argv.indexOf("--mock-data");
|
|
if (idx === -1 || idx + 1 >= argv.length || argv[idx + 1] === "") {
|
|
process.stderr.write(`--mock-data is required. ${USAGE}\n`);
|
|
process.exit(1);
|
|
}
|
|
return argv[idx + 1];
|
|
}
|
|
|
|
const mockDataPath = getMockDataPath(process.argv);
|
|
const main = createMockAgent(mockDataPath);
|
|
void main();
|