chore: fix CI with new typescript setup (#1194)
Co-authored-by: Ralph Khreish <Crunchyman-ralph@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
* This file defines the contract for configuration management
|
||||
*/
|
||||
|
||||
import type { TaskComplexity, TaskPriority } from '../types/index.js';
|
||||
import type {
|
||||
TaskComplexity,
|
||||
TaskPriority,
|
||||
StorageType
|
||||
} from '../types/index.js';
|
||||
|
||||
/**
|
||||
* Model configuration for different AI roles
|
||||
@@ -73,14 +77,6 @@ export interface TagSettings {
|
||||
tagNamingConvention: 'kebab-case' | 'camelCase' | 'snake_case';
|
||||
}
|
||||
|
||||
/**
|
||||
* Storage type options
|
||||
* - 'file': Local file system storage
|
||||
* - 'api': Remote API storage (Hamster integration)
|
||||
* - 'auto': Automatically detect based on auth status
|
||||
*/
|
||||
export type StorageType = 'file' | 'api' | 'auto';
|
||||
|
||||
/**
|
||||
* Runtime storage configuration used for storage backend selection
|
||||
* This is what getStorageConfig() returns and what StorageFactory expects
|
||||
|
||||
@@ -3,7 +3,12 @@
|
||||
* Core service for task operations - handles business logic between storage and API
|
||||
*/
|
||||
|
||||
import type { Task, TaskFilter, TaskStatus } from '../types/index.js';
|
||||
import type {
|
||||
Task,
|
||||
TaskFilter,
|
||||
TaskStatus,
|
||||
StorageType
|
||||
} from '../types/index.js';
|
||||
import type { IStorage } from '../interfaces/storage.interface.js';
|
||||
import { ConfigManager } from '../config/config-manager.js';
|
||||
import { StorageFactory } from '../storage/storage-factory.js';
|
||||
@@ -23,7 +28,7 @@ export interface TaskListResult {
|
||||
/** The tag these tasks belong to (only present if explicitly provided) */
|
||||
tag?: string;
|
||||
/** Storage type being used */
|
||||
storageType: 'file' | 'api';
|
||||
storageType: StorageType;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +118,7 @@ export class TaskService {
|
||||
total: rawTasks.length,
|
||||
filtered: filteredEntities.length,
|
||||
tag: options.tag, // Only include tag if explicitly provided
|
||||
storageType: this.configManager.getStorageConfig().type
|
||||
storageType: this.getStorageType()
|
||||
};
|
||||
} catch (error) {
|
||||
throw new TaskMasterError(
|
||||
@@ -166,7 +171,7 @@ export class TaskService {
|
||||
byStatus: Record<TaskStatus, number>;
|
||||
withSubtasks: number;
|
||||
blocked: number;
|
||||
storageType: 'file' | 'api';
|
||||
storageType: StorageType;
|
||||
}> {
|
||||
const result = await this.getTaskList({
|
||||
tag,
|
||||
@@ -334,8 +339,12 @@ export class TaskService {
|
||||
/**
|
||||
* Get current storage type
|
||||
*/
|
||||
getStorageType(): 'file' | 'api' {
|
||||
return this.configManager.getStorageConfig().type;
|
||||
getStorageType(): StorageType {
|
||||
// Prefer the runtime storage type if available to avoid exposing 'auto'
|
||||
const s = this.storage as { getType?: () => 'file' | 'api' } | null;
|
||||
const runtimeType = s?.getType?.();
|
||||
return (runtimeType ??
|
||||
this.configManager.getStorageConfig().type) as StorageType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,12 @@ import {
|
||||
} from './services/task-service.js';
|
||||
import { ERROR_CODES, TaskMasterError } from './errors/task-master-error.js';
|
||||
import type { IConfiguration } from './interfaces/configuration.interface.js';
|
||||
import type { Task, TaskStatus, TaskFilter } from './types/index.js';
|
||||
import type {
|
||||
Task,
|
||||
TaskStatus,
|
||||
TaskFilter,
|
||||
StorageType
|
||||
} from './types/index.js';
|
||||
|
||||
/**
|
||||
* Options for creating TaskMasterCore instance
|
||||
@@ -152,7 +157,7 @@ export class TaskMasterCore {
|
||||
/**
|
||||
* Get current storage type
|
||||
*/
|
||||
getStorageType(): 'file' | 'api' {
|
||||
getStorageType(): StorageType {
|
||||
return this.taskService.getStorageType();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
* Core type definitions for Task Master
|
||||
*/
|
||||
|
||||
/**
|
||||
* Storage type options
|
||||
* - 'file': Local file system storage
|
||||
* - 'api': Remote API storage (Hamster integration)
|
||||
* - 'auto': Automatically detect based on auth status
|
||||
*/
|
||||
export type StorageType = 'file' | 'api' | 'auto';
|
||||
|
||||
// ============================================================================
|
||||
// Type Literals
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user