Compare commits
6 Commits
task-maste
...
task-maste
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc6652ccd2 | ||
|
|
518d7ea8dc | ||
|
|
ccb87a516a | ||
|
|
b8830d9508 | ||
|
|
548beb4344 | ||
|
|
555da2b5b9 |
21
.changeset/kind-lines-melt.md
Normal file
21
.changeset/kind-lines-melt.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
"task-master-ai": patch
|
||||
---
|
||||
|
||||
Fix MCP server compatibility with Draft-07 clients (Augment IDE, gemini-cli, gemini code assist)
|
||||
|
||||
- Resolves #1284
|
||||
|
||||
**Problem:**
|
||||
|
||||
- MCP tools were using Zod v4, which outputs JSON Schema Draft 2020-12
|
||||
- MCP clients only support Draft-07
|
||||
- Tools were not discoverable in gemini-cli and other clients
|
||||
|
||||
**Solution:**
|
||||
|
||||
- Updated all MCP tools to import from `zod/v3` instead of `zod`
|
||||
- Zod v3 schemas convert to Draft-07 via FastMCP's zod-to-json-schema
|
||||
- Fixed logger to use stderr instead of stdout (MCP protocol requirement)
|
||||
|
||||
This is a temporary workaround until FastMCP adds JSON Schema version configuration.
|
||||
5
.changeset/open-tips-notice.md
Normal file
5
.changeset/open-tips-notice.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"task-master-ai": minor
|
||||
---
|
||||
|
||||
Add 4.5 haiku and sonnet to supported models for claude-code and anthropic ai providers
|
||||
22
.changeset/pre.json
Normal file
22
.changeset/pre.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"mode": "pre",
|
||||
"tag": "rc",
|
||||
"initialVersions": {
|
||||
"task-master-ai": "0.29.0",
|
||||
"@tm/cli": "",
|
||||
"docs": "0.0.6",
|
||||
"extension": "0.25.6",
|
||||
"@tm/mcp": "0.28.0-rc.2",
|
||||
"@tm/ai-sdk-provider-grok-cli": "",
|
||||
"@tm/build-config": "",
|
||||
"@tm/claude-code-plugin": "0.0.2",
|
||||
"@tm/core": ""
|
||||
},
|
||||
"changesets": [
|
||||
"dirty-hairs-know",
|
||||
"fix-parent-directory-traversal",
|
||||
"fix-warning-box-alignment",
|
||||
"light-owls-stay",
|
||||
"metal-rocks-help"
|
||||
]
|
||||
}
|
||||
36
.changeset/some-dodos-wonder.md
Normal file
36
.changeset/some-dodos-wonder.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
"task-master-ai": minor
|
||||
---
|
||||
|
||||
Add autonomous TDD workflow automation system with new `tm autopilot` commands and MCP tools for AI-driven test-driven development.
|
||||
|
||||
**New CLI Commands:**
|
||||
|
||||
- `tm autopilot start <taskId>` - Initialize TDD workflow
|
||||
- `tm autopilot next` - Get next action in workflow
|
||||
- `tm autopilot status` - Check workflow progress
|
||||
- `tm autopilot complete` - Advance phase with test results
|
||||
- `tm autopilot commit` - Save progress with metadata
|
||||
- `tm autopilot resume` - Continue from checkpoint
|
||||
- `tm autopilot abort` - Cancel workflow
|
||||
|
||||
**New MCP Tools:**
|
||||
Seven new autopilot tools for programmatic control: `autopilot_start`, `autopilot_next`, `autopilot_status`, `autopilot_complete_phase`, `autopilot_commit`, `autopilot_resume`, `autopilot_abort`
|
||||
|
||||
**Features:**
|
||||
|
||||
- Complete RED → GREEN → COMMIT cycle enforcement
|
||||
- Intelligent commit message generation with metadata
|
||||
- Activity logging and state persistence
|
||||
- Configurable workflow settings via `.taskmaster/config.json`
|
||||
- Comprehensive AI agent integration documentation
|
||||
|
||||
**Documentation:**
|
||||
|
||||
- AI Agent Integration Guide (2,800+ lines)
|
||||
- TDD Quick Start Guide
|
||||
- Example prompts and integration patterns
|
||||
|
||||
> **Learn more:** [TDD Workflow Quickstart Guide](https://dev.task-master.dev/tdd-workflow/quickstart)
|
||||
|
||||
This release enables AI agents to autonomously execute test-driven development workflows with full state management and recovery capabilities.
|
||||
@@ -1,3 +1,7 @@
|
||||
reviews:
|
||||
profile: chill
|
||||
poem: false
|
||||
auto_review:
|
||||
enabled: true
|
||||
base_branches:
|
||||
- ".*"
|
||||
|
||||
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,5 +1,50 @@
|
||||
# task-master-ai
|
||||
|
||||
## 0.30.0-rc.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#1181](https://github.com/eyaltoledano/claude-task-master/pull/1181) [`a69d8c9`](https://github.com/eyaltoledano/claude-task-master/commit/a69d8c91dc9205a3fdaf9d32276144fa3bcad55d) Thanks [@karol-f](https://github.com/karol-f)! - Add configurable MCP tool loading to optimize LLM context usage
|
||||
|
||||
You can now control which Task Master MCP tools are loaded by setting the `TASK_MASTER_TOOLS` environment variable in your MCP configuration. This helps reduce context usage for LLMs by only loading the tools you need.
|
||||
|
||||
**Configuration Options:**
|
||||
- `all` (default): Load all 36 tools
|
||||
- `core` or `lean`: Load only 7 essential tools for daily development
|
||||
- Includes: `get_tasks`, `next_task`, `get_task`, `set_task_status`, `update_subtask`, `parse_prd`, `expand_task`
|
||||
- `standard`: Load 15 commonly used tools (all core tools plus 8 more)
|
||||
- Additional tools: `initialize_project`, `analyze_project_complexity`, `expand_all`, `add_subtask`, `remove_task`, `generate`, `add_task`, `complexity_report`
|
||||
- Custom list: Comma-separated tool names (e.g., `get_tasks,next_task,set_task_status`)
|
||||
|
||||
**Example .mcp.json configuration:**
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"task-master-ai": {
|
||||
"command": "npx",
|
||||
"args": ["-y", "task-master-ai"],
|
||||
"env": {
|
||||
"TASK_MASTER_TOOLS": "standard",
|
||||
"ANTHROPIC_API_KEY": "your_key_here"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For complete details on all available tools, configuration examples, and usage guidelines, see the [MCP Tools documentation](https://docs.task-master.dev/capabilities/mcp#configurable-tool-loading).
|
||||
|
||||
- [#1312](https://github.com/eyaltoledano/claude-task-master/pull/1312) [`d7fca18`](https://github.com/eyaltoledano/claude-task-master/commit/d7fca1844f24ad8ce079c21d9799a3c4b4413381) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Improve next command to work with remote
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#1314](https://github.com/eyaltoledano/claude-task-master/pull/1314) [`6bc75c0`](https://github.com/eyaltoledano/claude-task-master/commit/6bc75c0ac68b59cb10cee70574a689f83e4de768) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Improve auth token refresh flow
|
||||
|
||||
- [#1302](https://github.com/eyaltoledano/claude-task-master/pull/1302) [`3283506`](https://github.com/eyaltoledano/claude-task-master/commit/3283506444d59896ecb97721ef2e96e290eb84d3) Thanks [@bjcoombs](https://github.com/bjcoombs)! - Enable Task Master commands to traverse parent directories to find project root from nested paths
|
||||
|
||||
Fixes #1301
|
||||
|
||||
## 0.29.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
"tailwindcss": "4.1.11",
|
||||
"typescript": "^5.9.2",
|
||||
"@tm/core": "*",
|
||||
"task-master-ai": "*"
|
||||
"task-master-ai": "0.30.0-rc.0"
|
||||
},
|
||||
"overrides": {
|
||||
"glob@<8": "^10.4.5",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"description": "Task Master MCP Tools - TypeScript MCP server tools for AI agent integration",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"version": "0.28.0-rc.2",
|
||||
"version": "",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
|
||||
70
apps/mcp/src/tools/README-ZOD-V3.md
Normal file
70
apps/mcp/src/tools/README-ZOD-V3.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Why MCP Tools Use Zod v3
|
||||
|
||||
## Problem
|
||||
|
||||
- **FastMCP** uses `xsschema` to convert schemas → outputs JSON Schema **Draft 2020-12**
|
||||
- **MCP clients** (Augment IDE, gemini-cli, etc.) only support **Draft-07**
|
||||
- Using Zod v4 in tools causes "vendor undefined" errors and tool discovery failures
|
||||
|
||||
## Temporary Solution
|
||||
|
||||
All MCP tool files import from `zod/v3` instead of `zod`:
|
||||
|
||||
```typescript
|
||||
import { z } from 'zod/v3'; // ✅ Draft-07 compatible
|
||||
// NOT: import { z } from 'zod'; // ❌ Would use Draft 2020-12
|
||||
```
|
||||
|
||||
### Why This Works
|
||||
|
||||
- Zod v4 ships with v3 compatibility at `zod/v3`
|
||||
- FastMCP + zod-to-json-schema converts Zod v3 schemas → **Draft-07**
|
||||
- This ensures MCP clients can discover and use our tools
|
||||
|
||||
### What This Means
|
||||
|
||||
- ✅ **MCP tools** → use `zod/v3` (apps/mcp & mcp-server/src/tools)
|
||||
- ✅ **Rest of codebase** → uses `zod` (Zod v4)
|
||||
- ✅ **No conflicts** → they're from the same package, just different versions
|
||||
|
||||
## When Can We Remove This?
|
||||
|
||||
This workaround can be removed when **either**:
|
||||
|
||||
1. **FastMCP adds JSON Schema version configuration**
|
||||
- e.g., `new FastMCP({ jsonSchema: { target: 'draft-07' } })`
|
||||
- Tracking: https://github.com/punkpeye/fastmcp/issues/189
|
||||
|
||||
2. **MCP spec adds Draft 2020-12 support**
|
||||
- Unlikely in the short term
|
||||
|
||||
3. **xsschema adds version targeting**
|
||||
- Would allow FastMCP to use Draft-07
|
||||
|
||||
## How to Maintain
|
||||
|
||||
When adding new MCP tools:
|
||||
|
||||
```typescript
|
||||
// ✅ CORRECT
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
export function registerMyTool(server: FastMCP) {
|
||||
server.addTool({
|
||||
name: 'my_tool',
|
||||
parameters: z.object({ ... }), // Will use Draft-07
|
||||
execute: async (args, context) => { ... }
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
```typescript
|
||||
// ❌ WRONG - Will break MCP client compatibility
|
||||
import { z } from 'zod'; // Don't do this in apps/mcp/src/tools/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** 2025-10-18
|
||||
**Affects:** All files in `apps/mcp/src/tools/`
|
||||
**See Also:** `mcp-server/src/tools/README-ZOD-V3.md` (same workaround)
|
||||
@@ -3,7 +3,9 @@
|
||||
* Abort a running TDD workflow and clean up state
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Create a git commit with automatic staging and message generation
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Complete the current TDD phase with test result validation
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Finalize and complete the workflow with working tree validation
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Get the next action to perform in the TDD workflow
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Resume a previously started TDD workflow from saved state
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Initialize and start a new TDD workflow for a task
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Get comprehensive workflow status and progress information
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Available Models as of October 5, 2025
|
||||
# Available Models as of October 18, 2025
|
||||
|
||||
## Main Models
|
||||
|
||||
@@ -8,8 +8,11 @@
|
||||
| anthropic | claude-opus-4-20250514 | 0.725 | 15 | 75 |
|
||||
| anthropic | claude-3-7-sonnet-20250219 | 0.623 | 3 | 15 |
|
||||
| anthropic | claude-3-5-sonnet-20241022 | 0.49 | 3 | 15 |
|
||||
| anthropic | claude-sonnet-4-5-20250929 | 0.73 | 3 | 15 |
|
||||
| anthropic | claude-haiku-4-5-20251001 | 0.45 | 1 | 5 |
|
||||
| claude-code | opus | 0.725 | 0 | 0 |
|
||||
| claude-code | sonnet | 0.727 | 0 | 0 |
|
||||
| claude-code | haiku | 0.45 | 0 | 0 |
|
||||
| codex-cli | gpt-5 | 0.749 | 0 | 0 |
|
||||
| codex-cli | gpt-5-codex | 0.749 | 0 | 0 |
|
||||
| mcp | mcp-sampling | — | 0 | 0 |
|
||||
@@ -102,6 +105,7 @@
|
||||
| ----------- | -------------------------------------------- | --------- | ---------- | ----------- |
|
||||
| claude-code | opus | 0.725 | 0 | 0 |
|
||||
| claude-code | sonnet | 0.727 | 0 | 0 |
|
||||
| claude-code | haiku | 0.45 | 0 | 0 |
|
||||
| codex-cli | gpt-5 | 0.749 | 0 | 0 |
|
||||
| codex-cli | gpt-5-codex | 0.749 | 0 | 0 |
|
||||
| mcp | mcp-sampling | — | 0 | 0 |
|
||||
@@ -142,8 +146,11 @@
|
||||
| anthropic | claude-opus-4-20250514 | 0.725 | 15 | 75 |
|
||||
| anthropic | claude-3-7-sonnet-20250219 | 0.623 | 3 | 15 |
|
||||
| anthropic | claude-3-5-sonnet-20241022 | 0.49 | 3 | 15 |
|
||||
| anthropic | claude-sonnet-4-5-20250929 | 0.73 | 3 | 15 |
|
||||
| anthropic | claude-haiku-4-5-20251001 | 0.45 | 1 | 5 |
|
||||
| claude-code | opus | 0.725 | 0 | 0 |
|
||||
| claude-code | sonnet | 0.727 | 0 | 0 |
|
||||
| claude-code | haiku | 0.45 | 0 | 0 |
|
||||
| codex-cli | gpt-5 | 0.749 | 0 | 0 |
|
||||
| codex-cli | gpt-5-codex | 0.749 | 0 | 0 |
|
||||
| mcp | mcp-sampling | — | 0 | 0 |
|
||||
|
||||
@@ -78,7 +78,7 @@ function log(level, ...args) {
|
||||
// is responsible for directing logs correctly (e.g., to stderr)
|
||||
// during tool execution without upsetting the client connection.
|
||||
// Logs outside of tool execution (like startup) will go to stdout.
|
||||
console.log(prefix, ...coloredArgs);
|
||||
console.error(prefix, ...coloredArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
67
mcp-server/src/tools/README-ZOD-V3.md
Normal file
67
mcp-server/src/tools/README-ZOD-V3.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# Why MCP Tools Use Zod v3
|
||||
|
||||
## Problem
|
||||
|
||||
- **FastMCP** uses `xsschema` to convert schemas → outputs JSON Schema **Draft 2020-12**
|
||||
- **MCP clients** (Augment IDE, gemini-cli, etc.) only support **Draft-07**
|
||||
- Using Zod v4 in tools causes "vendor undefined" errors and tool discovery failures
|
||||
|
||||
## Temporary Solution
|
||||
|
||||
All MCP tool files import from `zod/v3` instead of `zod`:
|
||||
|
||||
```javascript
|
||||
import { z } from 'zod/v3'; // ✅ Draft-07 compatible
|
||||
// NOT: import { z } from 'zod'; // ❌ Would use Draft 2020-12
|
||||
```
|
||||
|
||||
### Why This Works
|
||||
|
||||
- Zod v4 ships with v3 compatibility at `zod/v3`
|
||||
- FastMCP + zod-to-json-schema converts Zod v3 schemas → **Draft-07**
|
||||
- This ensures MCP clients can discover and use our tools
|
||||
|
||||
### What This Means
|
||||
|
||||
- ✅ **MCP tools** → use `zod/v3` (this directory)
|
||||
- ✅ **Rest of codebase** → uses `zod` (Zod v4)
|
||||
- ✅ **No conflicts** → they're from the same package, just different versions
|
||||
|
||||
## When Can We Remove This?
|
||||
|
||||
This workaround can be removed when **either**:
|
||||
|
||||
1. **FastMCP adds JSON Schema version configuration**
|
||||
- e.g., `new FastMCP({ jsonSchema: { target: 'draft-07' } })`
|
||||
- Tracking: https://github.com/punkpeye/fastmcp/issues/189
|
||||
|
||||
2. **MCP spec adds Draft 2020-12 support**
|
||||
- Unlikely in the short term
|
||||
|
||||
3. **xsschema adds version targeting**
|
||||
- Would allow FastMCP to use Draft-07
|
||||
|
||||
## How to Maintain
|
||||
|
||||
When adding new MCP tools:
|
||||
|
||||
```javascript
|
||||
// ✅ CORRECT
|
||||
import { z } from 'zod/v3';
|
||||
|
||||
server.addTool({
|
||||
name: 'my_tool',
|
||||
parameters: z.object({ ... }), // Will use Draft-07
|
||||
execute: async (args) => { ... }
|
||||
});
|
||||
```
|
||||
|
||||
```javascript
|
||||
// ❌ WRONG - Will break MCP client compatibility
|
||||
import { z } from 'zod'; // Don't do this in mcp-server/src/tools/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Last Updated:** 2025-10-18
|
||||
**Affects:** All files in `mcp-server/src/tools/`
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for adding a dependency to a task
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for adding subtasks to existing tasks
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to create a new tag
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to add a new task using AI
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for analyzing task complexity and generating recommendations
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import path from 'path';
|
||||
import fs from 'fs'; // Import fs for directory check/creation
|
||||
import {
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for clearing subtasks from parent tasks
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for displaying the complexity analysis report
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to copy an existing tag to a new tag
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to delete an existing tag
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for expanding all pending tasks with subtasks
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to expand a task into subtasks
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for automatically fixing invalid task dependencies
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to generate individual task files from tasks.json
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// mcp-server/src/tools/get-operation-status.js
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import { createErrorResponse, createContentResponse } from './utils.js'; // Assuming these utils exist
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to get task details by ID
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to get all tasks from Task Master
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to list all available tags
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* MCP tool for managing AI model configurations
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for moving tasks or subtasks to a new position
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to find the next task to work on based on dependencies and status
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to parse PRD document and generate tasks
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
withNormalizedProjectRoot,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for removing a dependency from a task
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for removing subtasks from parent tasks
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to remove a task by ID
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to rename an existing tag
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to perform AI-powered research queries with project context
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to add or remove rules from a project (MCP server)
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to scope down task complexity
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to scope up task complexity
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to set the status of a task
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to append additional information to a specific subtask
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to update a single task by ID with new information
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to update tasks based on new context/prompt
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool to switch to a different tag context
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
createErrorResponse,
|
||||
handleApiResult,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
* Tool for validating task dependencies
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// TEMPORARY: Using zod/v3 for Draft-07 JSON Schema compatibility with FastMCP's zod-to-json-schema
|
||||
// TODO: Revert to 'zod' when MCP spec issue is resolved (see PR #1323)
|
||||
import { z } from 'zod/v3';
|
||||
import {
|
||||
handleApiResult,
|
||||
createErrorResponse,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "task-master-ai",
|
||||
"version": "0.29.0",
|
||||
"version": "0.30.0-rc.0",
|
||||
"description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.",
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
|
||||
@@ -25,7 +25,7 @@ export interface LoggerConfig {
|
||||
export class Logger {
|
||||
private config: Required<LoggerConfig>;
|
||||
private static readonly DEFAULT_CONFIG: Required<LoggerConfig> = {
|
||||
level: LogLevel.WARN,
|
||||
level: LogLevel.SILENT,
|
||||
silent: false,
|
||||
prefix: '',
|
||||
timestamp: false,
|
||||
|
||||
@@ -307,6 +307,20 @@ function validateProviderModelCombination(providerName, modelId) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of supported model IDs for a given provider from supported-models.json
|
||||
* @param {string} providerName - The name of the provider (e.g., 'claude-code', 'anthropic')
|
||||
* @returns {string[]} Array of supported model IDs, or empty array if provider not found
|
||||
*/
|
||||
export function getSupportedModelsForProvider(providerName) {
|
||||
if (!MODEL_MAP[providerName]) {
|
||||
return [];
|
||||
}
|
||||
return MODEL_MAP[providerName]
|
||||
.filter((model) => model.supported !== false)
|
||||
.map((model) => model.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates Claude Code AI provider custom settings
|
||||
* @param {object} settings The settings to validate
|
||||
|
||||
@@ -43,6 +43,28 @@
|
||||
"allowed_roles": ["main", "fallback"],
|
||||
"max_tokens": 8192,
|
||||
"supported": true
|
||||
},
|
||||
{
|
||||
"id": "claude-sonnet-4-5-20250929",
|
||||
"swe_score": 0.73,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 3.0,
|
||||
"output": 15.0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback"],
|
||||
"max_tokens": 64000,
|
||||
"supported": true
|
||||
},
|
||||
{
|
||||
"id": "claude-haiku-4-5-20251001",
|
||||
"swe_score": 0.45,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 1.0,
|
||||
"output": 5.0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback"],
|
||||
"max_tokens": 200000,
|
||||
"supported": true
|
||||
}
|
||||
],
|
||||
"claude-code": [
|
||||
@@ -67,6 +89,17 @@
|
||||
"allowed_roles": ["main", "fallback", "research"],
|
||||
"max_tokens": 64000,
|
||||
"supported": true
|
||||
},
|
||||
{
|
||||
"id": "haiku",
|
||||
"swe_score": 0.45,
|
||||
"cost_per_1m_tokens": {
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
"allowed_roles": ["main", "fallback", "research"],
|
||||
"max_tokens": 200000,
|
||||
"supported": true
|
||||
}
|
||||
],
|
||||
"codex-cli": [
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
|
||||
import { createClaudeCode } from 'ai-sdk-provider-claude-code';
|
||||
import { BaseAIProvider } from './base-provider.js';
|
||||
import { getClaudeCodeSettingsForCommand } from '../../scripts/modules/config-manager.js';
|
||||
import {
|
||||
getClaudeCodeSettingsForCommand,
|
||||
getSupportedModelsForProvider
|
||||
} from '../../scripts/modules/config-manager.js';
|
||||
import { execSync } from 'child_process';
|
||||
import { log } from '../../scripts/modules/utils.js';
|
||||
|
||||
@@ -24,14 +27,24 @@ let _claudeCliAvailable = null;
|
||||
*
|
||||
* Features:
|
||||
* - No API key required (uses local Claude Code CLI)
|
||||
* - Supports 'sonnet' and 'opus' models
|
||||
* - Supported models loaded from supported-models.json
|
||||
* - Command-specific configuration support
|
||||
*/
|
||||
export class ClaudeCodeProvider extends BaseAIProvider {
|
||||
constructor() {
|
||||
super();
|
||||
this.name = 'Claude Code';
|
||||
this.supportedModels = ['sonnet', 'opus'];
|
||||
// Load supported models from supported-models.json
|
||||
this.supportedModels = getSupportedModelsForProvider('claude-code');
|
||||
|
||||
// Validate that models were loaded successfully
|
||||
if (this.supportedModels.length === 0) {
|
||||
log(
|
||||
'warn',
|
||||
'No supported models found for claude-code provider. Check supported-models.json configuration.'
|
||||
);
|
||||
}
|
||||
|
||||
// Claude Code requires explicit JSON schema mode
|
||||
this.needsExplicitJsonSchema = true;
|
||||
// Claude Code does not support temperature parameter
|
||||
|
||||
@@ -10,7 +10,10 @@ import { createCodexCli } from 'ai-sdk-provider-codex-cli';
|
||||
import { BaseAIProvider } from './base-provider.js';
|
||||
import { execSync } from 'child_process';
|
||||
import { log } from '../../scripts/modules/utils.js';
|
||||
import { getCodexCliSettingsForCommand } from '../../scripts/modules/config-manager.js';
|
||||
import {
|
||||
getCodexCliSettingsForCommand,
|
||||
getSupportedModelsForProvider
|
||||
} from '../../scripts/modules/config-manager.js';
|
||||
|
||||
export class CodexCliProvider extends BaseAIProvider {
|
||||
constructor() {
|
||||
@@ -20,8 +23,17 @@ export class CodexCliProvider extends BaseAIProvider {
|
||||
this.needsExplicitJsonSchema = false;
|
||||
// Codex CLI does not support temperature parameter
|
||||
this.supportsTemperature = false;
|
||||
// Restrict to supported models for OAuth subscription usage
|
||||
this.supportedModels = ['gpt-5', 'gpt-5-codex'];
|
||||
// Load supported models from supported-models.json
|
||||
this.supportedModels = getSupportedModelsForProvider('codex-cli');
|
||||
|
||||
// Validate that models were loaded successfully
|
||||
if (this.supportedModels.length === 0) {
|
||||
log(
|
||||
'warn',
|
||||
'No supported models found for codex-cli provider. Check supported-models.json configuration.'
|
||||
);
|
||||
}
|
||||
|
||||
// CLI availability check cache
|
||||
this._codexCliChecked = false;
|
||||
this._codexCliAvailable = null;
|
||||
|
||||
@@ -43,9 +43,9 @@ describe('Claude Code Error Handling', () => {
|
||||
|
||||
// These should work even if CLI is not available
|
||||
expect(provider.name).toBe('Claude Code');
|
||||
expect(provider.getSupportedModels()).toEqual(['sonnet', 'opus']);
|
||||
expect(provider.getSupportedModels()).toEqual(['opus', 'sonnet', 'haiku']);
|
||||
expect(provider.isModelSupported('sonnet')).toBe(true);
|
||||
expect(provider.isModelSupported('haiku')).toBe(false);
|
||||
expect(provider.isModelSupported('haiku')).toBe(true);
|
||||
expect(provider.isRequiredApiKey()).toBe(false);
|
||||
expect(() => provider.validateAuth()).not.toThrow();
|
||||
});
|
||||
|
||||
@@ -40,14 +40,14 @@ describe('Claude Code Integration (Optional)', () => {
|
||||
it('should create a working provider instance', () => {
|
||||
const provider = new ClaudeCodeProvider();
|
||||
expect(provider.name).toBe('Claude Code');
|
||||
expect(provider.getSupportedModels()).toEqual(['sonnet', 'opus']);
|
||||
expect(provider.getSupportedModels()).toEqual(['opus', 'sonnet', 'haiku']);
|
||||
});
|
||||
|
||||
it('should support model validation', () => {
|
||||
const provider = new ClaudeCodeProvider();
|
||||
expect(provider.isModelSupported('sonnet')).toBe(true);
|
||||
expect(provider.isModelSupported('opus')).toBe(true);
|
||||
expect(provider.isModelSupported('haiku')).toBe(false);
|
||||
expect(provider.isModelSupported('haiku')).toBe(true);
|
||||
expect(provider.isModelSupported('unknown')).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ jest.unstable_mockModule('../../../src/ai-providers/base-provider.js', () => ({
|
||||
}
|
||||
}));
|
||||
|
||||
// Mock config getters
|
||||
jest.unstable_mockModule('../../../scripts/modules/config-manager.js', () => ({
|
||||
getClaudeCodeSettingsForCommand: jest.fn(() => ({})),
|
||||
getSupportedModelsForProvider: jest.fn(() => ['opus', 'sonnet', 'haiku']),
|
||||
getDebugFlag: jest.fn(() => false),
|
||||
getLogLevel: jest.fn(() => 'info')
|
||||
}));
|
||||
|
||||
// Import after mocking
|
||||
const { ClaudeCodeProvider } = await import(
|
||||
'../../../src/ai-providers/claude-code.js'
|
||||
@@ -96,13 +104,13 @@ describe('ClaudeCodeProvider', () => {
|
||||
describe('model support', () => {
|
||||
it('should return supported models', () => {
|
||||
const models = provider.getSupportedModels();
|
||||
expect(models).toEqual(['sonnet', 'opus']);
|
||||
expect(models).toEqual(['opus', 'sonnet', 'haiku']);
|
||||
});
|
||||
|
||||
it('should check if model is supported', () => {
|
||||
expect(provider.isModelSupported('sonnet')).toBe(true);
|
||||
expect(provider.isModelSupported('opus')).toBe(true);
|
||||
expect(provider.isModelSupported('haiku')).toBe(false);
|
||||
expect(provider.isModelSupported('haiku')).toBe(true);
|
||||
expect(provider.isModelSupported('unknown')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@ jest.unstable_mockModule('ai-sdk-provider-codex-cli', () => ({
|
||||
// Mock config getters
|
||||
jest.unstable_mockModule('../../../scripts/modules/config-manager.js', () => ({
|
||||
getCodexCliSettingsForCommand: jest.fn(() => ({ allowNpx: true })),
|
||||
getSupportedModelsForProvider: jest.fn(() => ['gpt-5', 'gpt-5-codex']),
|
||||
// Provide commonly imported getters to satisfy other module imports if any
|
||||
getDebugFlag: jest.fn(() => false),
|
||||
getLogLevel: jest.fn(() => 'info')
|
||||
|
||||
Reference in New Issue
Block a user