UNPKG

organ-ai-zer

Version:

AI-powered file organizer CLI tool

226 lines 9.44 kB
/** * The `OrganizationContext` class extends the `ConversationContext` class and provides * functionality for managing and organizing file information, patterns, suggestions, and * categories within a specific organizational context. It is designed to facilitate the * analysis, conversation, and organization phases of a workflow, with the ability to track * clarifications, rejected suggestions, approved patterns, discovered categories, and more. * * This class encapsulates the state and behavior required to process files and organize them * based on the provided intent and configuration. It includes methods for adding, retrieving, * and updating various aspects of the organizational context, such as files, suggestions, * patterns, and categories. * * Key features: * - Tracks files and their associated metadata. * - Manages rejected suggestions and approved patterns. * - Organizes files into discovered categories. * - Handles clarifications and pattern hints. * - Supports multiple workflow phases: analysis, conversation, organization, and completion. * * @extends ConversationContext */ import { Clarification, ConversationConfig, FileInfo, OrganizationSuggestion } from "../types"; import { ConversationContext } from "./conversation-context"; export declare class OrganizationContext extends ConversationContext { private files; private baseDirectory; private intent; private rejectedSuggestions; private approvedPatterns; private discoveredCategories; private clarifications; private currentBatch?; private phase; private patternHints; /** * Constructs an instance of the OrganizationContext service. * * @param subject - The subject or topic of the organization context. * @param files - An array of file information objects to be processed. * @param baseDirectory - The base directory path where files are located. * @param intent - The intent or purpose of the organization context. * @param config - Optional partial configuration for the conversation context. */ constructor(subject: string, files: FileInfo[], baseDirectory: string, intent: string, config?: Partial<ConversationConfig>); /** * Retrieves the list of files associated with the organization context. * * @returns {FileInfo[]} An array of `FileInfo` objects representing the files. */ getFiles(): FileInfo[]; /** * Sets the list of files for the organization context. * * @param files - An array of `FileInfo` objects representing the files to be set. */ setFiles(files: FileInfo[]): void; /** * Retrieves the base directory associated with the organization context. * * @returns {string} The base directory path as a string. */ getBaseDirectory(): string; /** * Sets the base directory for the organization context. * * @param baseDirectory - The path to the base directory to be set. */ setBaseDirectory(baseDirectory: string): void; /** * Retrieves the current intent associated with the organization context. * * @returns {string} The intent as a string. */ getIntent(): string; /** * Sets the intent for the organization context. * * @param intent - A string representing the intent to be set. */ setIntent(intent: string): void; /** * Retrieves the list of rejected organization suggestions. * * @returns {OrganizationSuggestion[]} An array of rejected suggestions. */ getRejectedSuggestions(): OrganizationSuggestion[]; /** * Updates the list of rejected organization suggestions. * * @param rejectedSuggestions - An array of `OrganizationSuggestion` objects * representing the suggestions that have been rejected. */ setRejectedSuggestions(rejectedSuggestions: OrganizationSuggestion[]): void; /** * Retrieves the list of approved patterns. * * @returns {string[]} An array of strings representing the approved patterns. */ getApprovedPatterns(): string[]; /** * Sets the approved patterns for the organization context. * * @param approvedPatterns - An array of strings representing the approved patterns. */ setApprovedPatterns(approvedPatterns: string[]): void; /** * Retrieves the discovered categories and their associated file information. * * @returns A record where the keys are category names (strings) and the values are arrays of `FileInfo` objects. */ getDiscoveredCategories(): Record<string, FileInfo[]>; /** * Updates the discovered categories with the provided data. * * @param discoveredCategories - An object where the keys represent category names * and the values are arrays of `FileInfo` objects associated with each category. */ setDiscoveredCategories(discoveredCategories: Record<string, FileInfo[]>): void; /** * Retrieves the list of clarifications associated with the organization context. * * @returns {Clarification[]} An array of clarifications. */ getClarifications(): Clarification[]; /** * Updates the clarifications for the organization context. * * @param clarifications - An array of `Clarification` objects to set as the current clarifications. */ setClarifications(clarifications: Clarification[]): void; /** * Retrieves the current batch information, including its name and associated files. * * @returns An object containing the name of the current batch and an array of file information, * or `undefined` if no batch is currently set. */ getCurrentBatch(): { name: string; files: FileInfo[]; } | undefined; /** * Sets the current batch for the organization context. * * @param currentBatch - The batch to set as the current batch. * It can either be an object containing a `name` and an array of `FileInfo` objects, * or `undefined` to clear the current batch. */ setCurrentBatch(currentBatch: { name: string; files: FileInfo[]; } | undefined): void; /** * Retrieves the current phase of the organization context. * * @returns {'analysis' | 'conversation' | 'organization' | 'complete'} * The current phase, which can be one of the following: * - `'analysis'`: Represents the analysis phase. * - `'conversation'`: Represents the conversation phase. * - `'organization'`: Represents the organization phase. * - `'complete'`: Represents the completion phase. */ getPhase(): 'analysis' | 'conversation' | 'organization' | 'complete'; /** * Sets the current phase of the organization context. * * @param phase - The phase to set, which must be one of the following: * - `'analysis'`: Represents the analysis phase. * - `'conversation'`: Represents the conversation phase. * - `'organization'`: Represents the organization phase. * - `'complete'`: Represents the completion phase. */ setPhase(phase: 'analysis' | 'conversation' | 'organization' | 'complete'): void; /** * Retrieves the list of pattern hints associated with the organization context. * * @returns {string[]} An array of strings representing the pattern hints. */ getPatternHints(): string[]; /** * Sets the pattern hints for the organization context. * * @param patternHints - An array of strings representing the pattern hints to be set. */ setPatternHints(patternHints: string[]): void; /** * Adds new files to the existing list of files in the organization context. * * @param newFiles - An array of `FileInfo` objects representing the new files to be added. * These files will be appended to the current list of files. */ addFiles(newFiles: FileInfo[]): void; /** * Adds a suggestion to the list of rejected suggestions. * * @param suggestion - The organization suggestion to be marked as rejected. */ addRejectedSuggestion(suggestion: OrganizationSuggestion): void; /** * Adds a new pattern to the list of approved patterns. * * @param pattern - The pattern to be added to the approved patterns list. */ addApprovedPattern(pattern: string): void; /** * Adds a discovered category along with its associated files to the organization context. * If the category does not already exist, it initializes an empty array for it. * Then, it appends the provided files to the category's file list. * * @param category - The name of the category to add or update. * @param files - An array of file information objects to associate with the category. */ addDiscoveredCategory(category: string, files: FileInfo[]): void; /** * Adds a clarification to the list of clarifications. * * @param clarification - The clarification object to be added. */ addClarification(clarification: Clarification): void; /** * Adds a pattern hint to the list of pattern hints. * * @param hint - The pattern hint to be added. */ addPatternHint(hint: string): void; } //# sourceMappingURL=organization-context.d.ts.map