@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
55 lines • 2.31 kB
JavaScript
import { inspectProxyPackage } from "../../proxy/globalInstaller.js";
import { captureProxyPackageBaseline } from "../../proxy/proxyPackagePolyfills.js";
/** Record the base of a locally patched package without changing running services. */
export const proxyPolyfillCommand = {
command: "polyfill <action>",
describe: "Preserve local proxy compatibility edits across staged upgrades",
builder: (yargs) => yargs
.positional("action", {
choices: ["capture"],
type: "string",
demandOption: true,
})
.option("base", {
type: "string",
demandOption: true,
description: "CLI entry script of the pristine package used for the local edit",
})
.option("patched", {
type: "string",
demandOption: true,
description: "CLI entry script of the locally patched package",
})
.option("format", {
choices: ["text", "json"],
type: "string",
default: "text",
})
.example("neurolink proxy polyfill capture --base /original/dist/cli/index.js --patched /local/dist/cli/index.js", "Record the exact original files so later upgrades can apply only the local diff"),
handler: async (argv) => {
try {
const base = inspectProxyPackage(argv.base);
const patched = inspectProxyPackage(argv.patched);
const files = captureProxyPackageBaseline(base, patched);
const result = {
captured: true,
baseVersion: base.version,
patchedVersion: patched.version,
files,
};
console.info(argv.format === "json"
? JSON.stringify(result)
: `Recorded ${files.length} local proxy polyfill file(s). Upgrades will apply remaining diff hunks, skip included fixes, and retain the current worker on conflicts.`);
}
catch (error) {
const message = error instanceof Error
? error.message
: "Proxy polyfill capture failed";
console.error(argv.format === "json"
? JSON.stringify({ captured: false, message })
: message);
process.exitCode = 1;
}
},
};
//# sourceMappingURL=proxyPolyfill.js.map