Batch fixes before release (#1011)

* fix: improve projectRoot

* fix: improve task-master lang command

* feat: add documentation to the readme so more people can access it

* fix: expand command subtask dependency validation

* fix: update command more reliable with perplexity and other models

* chore: fix CI

* chore: implement requested changes

* chore: fix CI
This commit is contained in:
Ralph Khreish
2025-07-19 00:57:47 +03:00
parent 858d4a1c54
commit 444aa5ae19
17 changed files with 148 additions and 83 deletions

View File

@@ -25,6 +25,10 @@ import { findConfigPath } from '../../../src/utils/path-utils.js';
import { log } from '../utils.js';
import { CUSTOM_PROVIDERS } from '../../../src/constants/providers.js';
// Constants
const CONFIG_MISSING_ERROR =
'The configuration file is missing. Run "task-master init" to create it.';
/**
* Fetches the list of models from OpenRouter API.
* @returns {Promise<Array|null>} A promise that resolves with the list of model IDs or null if fetch fails.
@@ -168,9 +172,7 @@ async function getModelConfiguration(options = {}) {
);
if (!configExists) {
throw new Error(
'The configuration file is missing. Run "task-master models --setup" to create it.'
);
throw new Error(CONFIG_MISSING_ERROR);
}
try {
@@ -298,9 +300,7 @@ async function getAvailableModelsList(options = {}) {
);
if (!configExists) {
throw new Error(
'The configuration file is missing. Run "task-master models --setup" to create it.'
);
throw new Error(CONFIG_MISSING_ERROR);
}
try {
@@ -391,9 +391,7 @@ async function setModel(role, modelId, options = {}) {
);
if (!configExists) {
throw new Error(
'The configuration file is missing. Run "task-master models --setup" to create it.'
);
throw new Error(CONFIG_MISSING_ERROR);
}
// Validate role