@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
33 lines (32 loc) • 1.13 kB
JavaScript
/**
* Type definitions for NeuroLink tool system, including parameter schemas,
* argument patterns, execution metadata, context, and result types.
*/
/**
* Type guard for tool result
*/
export function isToolResult(value) {
return (typeof value === "object" &&
value !== null &&
"success" in value &&
typeof value.success === "boolean");
}
/**
* Type guard for tool definition
*/
export function isToolDefinition(value) {
return (typeof value === "object" &&
value !== null &&
"description" in value &&
"execute" in value &&
typeof value.description === "string" &&
typeof value.execute === "function");
}
/**
* Own property stamped on a tool object whose `execute` already emits one
* `tool:start` / `tool:end` pair per execution. It lives on the OBJECT, not
* the function: later layers (the execution recorder, discovery) replace
* `execute` via `{ ...tool, execute }`, which drops a function-identity check
* but carries a symbol-keyed own property along.
*/
export const TOOL_EVENTS_WRAPPED = Symbol.for("neurolink.toolEventsWrapped");