chore: address oauth PR concerns (#1184)

This commit is contained in:
Ralph Khreish
2025-09-08 01:15:19 +02:00
parent 7cf4004038
commit 15900d9fd5
23 changed files with 1042 additions and 139 deletions

View File

@@ -3,7 +3,7 @@
* This file defines the contract for configuration management
*/
import type { TaskComplexity, TaskPriority } from '../types/index';
import type { TaskComplexity, TaskPriority } from '../types/index.js';
/**
* Model configuration for different AI roles
@@ -74,19 +74,48 @@ export interface TagSettings {
}
/**
* Storage and persistence settings
* Storage type options
* - 'file': Local file system storage
* - 'api': Remote API storage (Hamster integration)
* - 'auto': Automatically detect based on auth status
*/
export interface StorageSettings {
/** Storage backend type - 'auto' detects based on auth status */
type: 'file' | 'api' | 'auto';
/** Base path for file storage */
export type StorageType = 'file' | 'api' | 'auto';
/**
* Runtime storage configuration used for storage backend selection
* This is what getStorageConfig() returns and what StorageFactory expects
*/
export interface RuntimeStorageConfig {
/** Storage backend type */
type: StorageType;
/** Base path for file storage (if configured) */
basePath?: string;
/** API endpoint for API storage (Hamster integration) */
apiEndpoint?: string;
/** Access token for API authentication */
apiAccessToken?: string;
/** Indicates whether API is configured (has endpoint or token) */
apiConfigured?: boolean;
/**
* Indicates whether API is configured (has endpoint or token)
* @computed Derived automatically from presence of apiEndpoint or apiAccessToken
* @internal Should not be set manually - computed by ConfigManager
*/
readonly apiConfigured: boolean;
}
/**
* Storage and persistence settings
* Extended storage settings including file operation preferences
*/
export interface StorageSettings
extends Omit<RuntimeStorageConfig, 'apiConfigured'> {
/** Base path for file storage */
basePath?: string;
/**
* Indicates whether API is configured
* @computed Derived automatically from presence of apiEndpoint or apiAccessToken
* @internal Should not be set manually in user config - computed by ConfigManager
*/
readonly apiConfigured?: boolean;
/** Enable automatic backups */
enableBackup: boolean;
/** Maximum number of backups to retain */

View File

@@ -4,13 +4,13 @@
*/
// Storage interfaces
export type * from './storage.interface';
export * from './storage.interface';
export type * from './storage.interface.js';
export * from './storage.interface.js';
// AI Provider interfaces
export type * from './ai-provider.interface';
export * from './ai-provider.interface';
export type * from './ai-provider.interface.js';
export * from './ai-provider.interface.js';
// Configuration interfaces
export type * from './configuration.interface';
export * from './configuration.interface';
export type * from './configuration.interface.js';
export * from './configuration.interface.js';

View File

@@ -3,7 +3,7 @@
* This file defines the contract for all storage implementations
*/
import type { Task, TaskMetadata } from '../types/index';
import type { Task, TaskMetadata } from '../types/index.js';
/**
* Interface for storage operations on tasks