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

60 lines (59 loc) • 3.08 kB
/** * CLI execution for GitHub Action * @module action/actionExecutor */ import type { ActionInputs, ActionExecutionResult, CliResponse } from "../types/index.js"; /** * Transform CLI response to action result format */ export declare function transformCliResponse(cliResponse: CliResponse): Omit<ActionExecutionResult, "success" | "error">; /** * Build CLI arguments from action inputs (using verified camelCase flags) */ export declare function buildCliArgs(inputs: ActionInputs): string[]; /** * Install the NeuroLink CLI into a private directory under RUNNER_TEMP and * return the path of its `neurolink` executable. * * Three things changed from the original `npm install -g @juspay/neurolink`: * * - The version is exact unless the consumer opts into `latest`. The action * runs with the consumer's provider keys in its environment, so a moving tag * would hand one bad npm publish to every consumer within minutes; pinning * the action itself by SHA cannot protect against that, only pinning what it * installs can. `latest` still works, with a warning that names the trade. * - `--ignore-scripts`: no lifecycle script of any package in the tree runs on * the consumer's runner. NeuroLink has none of its own, and the packages * whose scripts matter (ffmpeg-static's binary download, sharp's prebuilt * lookup) are optional dependencies the action's text generation path does * not use. Video inputs need an ffmpeg on the runner's PATH, which GitHub's * Ubuntu images provide. * - `npm audit signatures` after the install: every package in the tree must * carry a valid registry signature, and the ones published with provenance * (this package is) must carry an attestation that matches. A tarball that * was swapped or re-signed fails here instead of running. * * A project directory rather than `-g` because `npm audit signatures` reads a * project's lockfile, and because it keeps the install out of the runner's * global prefix, where a later step could find a stale copy. */ export declare function installNeurolink(version: string, installRoot?: string): Promise<string>; /** * The exact `npm install` spec for a `neurolink_version` input. Anything that * is neither `latest` nor an exact `x.y.z` is refused: a range or a dist-tag * would quietly reintroduce the moving target the pin exists to remove. */ export declare function resolveInstallSpec(version: string): string; /** * Execute NeuroLink CLI command * @param args - CLI arguments * @param env - Environment variables * @param workingDirectory - Working directory for execution * @param timeout - Timeout in milliseconds (defaults to 5 minutes) * @param cliPath - The executable to run; defaults to `neurolink` on PATH */ export declare function executeNeurolink(args: string[], env: Record<string, string>, workingDirectory?: string, timeout?: number, cliPath?: string): Promise<ActionExecutionResult>; /** * Run complete NeuroLink action */ export declare function runNeurolink(inputs: ActionInputs): Promise<ActionExecutionResult>;