UNPKG

@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

44 lines (43 loc) • 2.16 kB
/** * GitHub Copilot CLI client configurator. * * Copilot is the odd one out: its provider settings are read **only** from the * environment. `app.js` resolves `COPILOT_PROVIDER_BASE_URL` (and siblings) via * `process.env`, and `~/.copilot/config.json` — which announces itself as * "managed automatically" — carries no provider block. There is no file this * proxy can write that Copilot will read. * * So rather than edit a shell profile, which lives outside this proxy's blast * radius and runs on every shell the user opens, `apply()` writes a small * sourceable script inside the proxy's own directory. The user adds one line to * their profile once: * * [ -f ~/.neurolink/copilot-env.sh ] && . ~/.neurolink/copilot-env.sh * * `restore()` deletes the script, so a sourced-but-stale file cannot outlive * the proxy — the guard above makes a missing file a no-op. * * Copilot also honours `OPENAI_API_KEY` + `OPENAI_BASE_URL`, but only when * `COPILOT_ENABLE_ALT_PROVIDERS=true` is set; the `COPILOT_PROVIDER_*` path has * no such gate, so that is the one used here. */ import type { CliProxyClientConfigurator } from "../../types/index.js"; /** * Resolved per call rather than at module load so `detect()` and `apply()` * agree when HOME changes — under test, and on the `--dev` isolation path. */ declare function getCopilotConfigDir(): string; declare function getCopilotEnvPath(): string; /** Whether any shell profile already sources the generated script. */ declare function isEnvScriptSourced(): Promise<boolean>; export declare function setCopilotProxySettings(baseUrl: string, proxyKey?: string): Promise<boolean>; export declare function clearCopilotProxySettings(expectedBaseUrl?: string): Promise<boolean>; export declare const copilotConfigurator: CliProxyClientConfigurator; export declare const __copilotTestHooks: { getCopilotConfigDir: typeof getCopilotConfigDir; getCopilotEnvPath: typeof getCopilotEnvPath; isEnvScriptSourced: typeof isEnvScriptSourced; setCopilotProxySettings: typeof setCopilotProxySettings; clearCopilotProxySettings: typeof clearCopilotProxySettings; }; export {};