packfs-core
Version:
Semantic filesystem operations for LLM agent frameworks with natural language understanding. See LLM_AGENT_GUIDE.md for copy-paste examples.
82 lines • 2.75 kB
TypeScript
/**
* LlamaIndex.TS integration for PackFS semantic filesystem
* LlamaIndex TypeScript - https://www.llamaindex.ai/
*/
import type { BaseIntegrationConfig, ToolDescription, FrameworkToolAdapter } from './types.js';
/**
* LlamaIndex-specific configuration
*/
export interface LlamaIndexIntegrationConfig extends BaseIntegrationConfig {
/** LlamaIndex-specific options */
llamaIndex?: {
/** Enable verbose logging */
verbose?: boolean;
/** Tool metadata for LlamaIndex */
metadata?: Record<string, any>;
/** Function calling configuration */
functionCalling?: {
/** Enable auto function calling */
autoCall?: boolean;
/** Maximum function call depth */
maxDepth?: number;
};
};
}
/**
* LlamaIndex FunctionTool interface (based on LlamaIndex.TS patterns)
*/
interface LlamaIndexFunctionTool {
metadata: {
name: string;
description: string;
parameters?: any;
};
call: (input: any) => Promise<any>;
}
/**
* LlamaIndex Tool specification format
*/
interface LlamaIndexToolSpec {
name: string;
description: string;
parameters: any;
fn: (params: any) => Promise<string>;
}
/**
* PackFS semantic filesystem tool for LlamaIndex.TS
* Compatible with LlamaIndex's function calling and agent frameworks
*/
export declare class LlamaIndexSemanticFilesystemTool implements FrameworkToolAdapter<LlamaIndexFunctionTool> {
createTool(config: LlamaIndexIntegrationConfig): LlamaIndexFunctionTool;
getToolDescription(): ToolDescription;
validateParameters(params: any): {
valid: boolean;
errors?: string[];
};
private getLlamaIndexParameters;
private executeOperation;
private executeNaturalLanguageQuery;
private executeStructuredAction;
private formatLlamaIndexResponse;
private extractFilesAccessed;
}
/**
* Create a LlamaIndex.TS compatible semantic filesystem tool
*/
export declare function createLlamaIndexSemanticFilesystemTool(config: LlamaIndexIntegrationConfig): LlamaIndexFunctionTool;
/**
* Create a LlamaIndex ToolSpec for the semantic filesystem
* This format is used for agent tool registration
*/
export declare function createLlamaIndexSemanticToolSpec(config: LlamaIndexIntegrationConfig): LlamaIndexToolSpec;
/**
* Create specialized LlamaIndex tools for different file operations
*/
export declare function createLlamaIndexSemanticToolSuite(config: LlamaIndexIntegrationConfig): {
fileReader: LlamaIndexFunctionTool;
fileWriter: LlamaIndexFunctionTool;
fileSearcher: LlamaIndexFunctionTool;
fileManager: LlamaIndexFunctionTool;
};
export {};
//# sourceMappingURL=llamaindex-ts.d.ts.map