Files
jlinc-langchain-js/dist/auth/JLINCAuthTool.d.ts
2025-11-24 14:21:49 +00:00

48 lines
1.5 KiB
TypeScript

export type JLINCConfig = import("./common").JLINCConfig;
export type JLINCAuthToolFields = {
config: JLINCConfig;
jlincAuthDecision: Tool;
targetAuthorized: Tool;
targetNotAuthorized: Tool | null;
};
/**
* @typedef {import('./common').JLINCConfig} JLINCConfig
*/
/**
* @typedef {Object} JLINCAuthToolFields
* @property {JLINCConfig} config
* @property {Tool} jlincAuthDecision
* @property {Tool} targetAuthorized
* @property {Tool|null} targetNotAuthorized
*/
export class JLINCAuthTool extends Tool<any> {
/**
* @param {JLINCAuthToolFields} fields
*/
constructor({ config, jlincAuthDecision, targetAuthorized, targetNotAuthorized }: JLINCAuthToolFields);
/** @type {JLINCConfig} */
config: JLINCConfig;
/** @type {Tool} */
jlincAuthDecision: Tool;
/** @type {Tool} */
targetAuthorized: Tool;
/** @type {Tool|null} */
targetNotAuthorized: Tool | null;
/** @type {JLINCTracer} */
tracer: JLINCTracer;
/** @type {string} */
authType: string;
/**
* @template TInput
* @template {undefined | ToolRunnableConfig} TConfig
* @template TOutput
*
* @param {TInput} input
* @param {TConfig} [config]
* @returns {Promise<ToolReturnType<TInput, TConfig, TOutput>>}
*/
invoke<TInput, TConfig extends undefined | ToolRunnableConfig, TOutput>(input: TInput, runManager: any): Promise<ToolReturnType<TInput, TConfig, TOutput>>;
}
import { Tool } from "@langchain/core/dist/tools/index.js";
import { JLINCTracer } from "../tracer/index.js";