add authentication support

This commit is contained in:
2025-11-24 14:21:49 +00:00
parent 05ebf84bb9
commit 9941d61fb8
27 changed files with 1126 additions and 69 deletions

47
dist/auth/JLINCAuthTool.d.ts vendored Normal file
View File

@@ -0,0 +1,47 @@
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";