packfs-core
Version:
Semantic filesystem operations for LLM agent frameworks with natural language understanding. See LLM_AGENT_GUIDE.md for copy-paste examples.
70 lines • 2.33 kB
TypeScript
/**
* Mastra framework integration for PackFS semantic filesystem
* Mastra: The TypeScript AI framework - https://mastra.ai/
*/
import type { BaseIntegrationConfig, ToolDescription, FrameworkToolAdapter } from './types.js';
/**
* Mastra-specific configuration extending base config
*/
export interface MastraIntegrationConfig extends BaseIntegrationConfig {
/** Mastra-specific options */
mastra?: {
/** Enable automatic error recovery */
autoRetry?: boolean;
/** Maximum retry attempts */
maxRetries?: number;
/** Enable operation tracing */
enableTracing?: boolean;
/** Custom agent context */
agentContext?: Record<string, any>;
};
/**
* Root path for filesystem operations (backward compatibility)
* @deprecated Use workingDirectory instead
*/
rootPath?: string;
/**
* Base path for filesystem operations (backward compatibility)
* @deprecated Use workingDirectory instead
*/
basePath?: string;
}
/**
* Mastra tool interface (simplified based on Mastra patterns)
*/
interface MastraTool {
name: string;
description: string;
parameters: any;
execute: (params: any) => Promise<any>;
}
/**
* PackFS semantic filesystem tool for Mastra
* Provides unified file operations through natural language interface
*/
export declare class MastraSemanticFilesystemTool implements FrameworkToolAdapter<MastraTool> {
createTool(config: MastraIntegrationConfig): MastraTool;
getToolDescription(): ToolDescription;
validateParameters(params: any): {
valid: boolean;
errors?: string[];
};
private executeNaturalLanguageQuery;
private executeStructuredOperation;
}
/**
* Create a Mastra semantic filesystem tool with the given configuration
*/
export declare function createMastraSemanticFilesystemTool(config: MastraIntegrationConfig): MastraTool;
/**
* Utility to create multiple Mastra tools for different semantic operations
* Provides more granular control for complex agent workflows
*/
export declare function createMastraSemanticToolSuite(config: MastraIntegrationConfig): {
fileReader: MastraTool;
fileWriter: MastraTool;
fileSearcher: MastraTool;
fileOrganizer: MastraTool;
};
export {};
//# sourceMappingURL=mastra.d.ts.map