packfs-core
Version:
Semantic filesystem operations for LLM agent frameworks with natural language understanding. See LLM_AGENT_GUIDE.md for copy-paste examples.
61 lines • 2.08 kB
TypeScript
/**
* LangChain.js integration for PackFS semantic filesystem
* LangChain JavaScript/TypeScript - https://js.langchain.com/
*/
import type { BaseIntegrationConfig, ToolDescription, FrameworkToolAdapter } from './types.js';
/**
* LangChain-specific configuration
*/
export interface LangChainIntegrationConfig extends BaseIntegrationConfig {
/** LangChain-specific options */
langchain?: {
/** Enable verbose logging */
verbose?: boolean;
/** Tool metadata for LangChain */
metadata?: Record<string, any>;
/** Custom callbacks */
callbacks?: any[];
};
}
/**
* LangChain DynamicTool-compatible structure
*/
interface LangChainDynamicTool {
name: string;
description: string;
func: (input: any) => Promise<string>;
schema?: any;
}
/**
* PackFS semantic filesystem tool for LangChain.js
* Compatible with LangChain's tool calling and agent frameworks
*/
export declare class LangChainSemanticFilesystemTool implements FrameworkToolAdapter<LangChainDynamicTool> {
createTool(config: LangChainIntegrationConfig): LangChainDynamicTool;
getToolDescription(): ToolDescription;
validateParameters(params: any): {
valid: boolean;
errors?: string[];
};
private getLangChainSchema;
private executeOperation;
private executeSemanticIntent;
private executeStructuredOperation;
private formatLangChainResponse;
}
/**
* Create a LangChain.js compatible semantic filesystem tool
*/
export declare function createLangChainSemanticFilesystemTool(config: LangChainIntegrationConfig): LangChainDynamicTool;
/**
* Create multiple specialized LangChain tools for different operations
* Useful for agents that need granular control over file operations
*/
export declare function createLangChainSemanticToolSet(config: LangChainIntegrationConfig): {
fileReader: LangChainDynamicTool;
fileWriter: LangChainDynamicTool;
fileSearcher: LangChainDynamicTool;
fileManager: LangChainDynamicTool;
};
export {};
//# sourceMappingURL=langchain-js.d.ts.map