Compare commits
4 Commits
257135bac0
...
ccc8296418
| Author | SHA1 | Date | |
|---|---|---|---|
| ccc8296418 | |||
| 2cd54118a1 | |||
| d3474b0f8b | |||
| 0170eb7fef |
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# Virtual environments
|
||||
.venv/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Testing
|
||||
.pytest_cache/
|
||||
.coverage
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
|
||||
# XER files (may contain sensitive project data)
|
||||
*.xer
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
1
.python-version
Normal file
1
.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3.14
|
||||
29
CLAUDE.md
Normal file
29
CLAUDE.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# xer-mcp Development Guidelines
|
||||
|
||||
Auto-generated from all feature plans. Last updated: 2026-01-06
|
||||
|
||||
## Active Technologies
|
||||
|
||||
- Python 3.14 + mcp (MCP SDK), sqlite3 (stdlib) (001-schedule-tools)
|
||||
|
||||
## Project Structure
|
||||
|
||||
```text
|
||||
src/
|
||||
tests/
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
cd src [ONLY COMMANDS FOR ACTIVE TECHNOLOGIES][ONLY COMMANDS FOR ACTIVE TECHNOLOGIES] pytest [ONLY COMMANDS FOR ACTIVE TECHNOLOGIES][ONLY COMMANDS FOR ACTIVE TECHNOLOGIES] ruff check .
|
||||
|
||||
## Code Style
|
||||
|
||||
Python 3.14: Follow standard conventions
|
||||
|
||||
## Recent Changes
|
||||
|
||||
- 001-schedule-tools: Added Python 3.14 + mcp (MCP SDK), sqlite3 (stdlib)
|
||||
|
||||
<!-- MANUAL ADDITIONS START -->
|
||||
<!-- MANUAL ADDITIONS END -->
|
||||
50
pyproject.toml
Normal file
50
pyproject.toml
Normal file
@@ -0,0 +1,50 @@
|
||||
[project]
|
||||
name = "xer-mcp"
|
||||
version = "0.1.0"
|
||||
description = "MCP server for querying Primavera P6 XER schedule data"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.14"
|
||||
dependencies = [
|
||||
"mcp>=1.0.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=8.0.0",
|
||||
"pytest-asyncio>=0.24.0",
|
||||
"ruff>=0.8.0",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/xer_mcp"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
target-version = "py314"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # Pyflakes
|
||||
"I", # isort
|
||||
"B", # flake8-bugbear
|
||||
"C4", # flake8-comprehensions
|
||||
"UP", # pyupgrade
|
||||
]
|
||||
ignore = [
|
||||
"E501", # line too long (handled by formatter)
|
||||
]
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "double"
|
||||
indent-style = "space"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
asyncio_mode = "auto"
|
||||
testpaths = ["tests"]
|
||||
pythonpath = ["src"]
|
||||
42
specs/001-schedule-tools/checklists/requirements.md
Normal file
42
specs/001-schedule-tools/checklists/requirements.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Specification Quality Checklist: Project Schedule Tools
|
||||
|
||||
**Purpose**: Validate specification completeness and quality before proceeding to planning
|
||||
**Created**: 2026-01-06
|
||||
**Feature**: [spec.md](../spec.md)
|
||||
|
||||
## Content Quality
|
||||
|
||||
- [x] No implementation details (languages, frameworks, APIs)
|
||||
- [x] Focused on user value and business needs
|
||||
- [x] Written for non-technical stakeholders
|
||||
- [x] All mandatory sections completed
|
||||
|
||||
## Requirement Completeness
|
||||
|
||||
- [x] No [NEEDS CLARIFICATION] markers remain
|
||||
- [x] Requirements are testable and unambiguous
|
||||
- [x] Success criteria are measurable
|
||||
- [x] Success criteria are technology-agnostic (no implementation details)
|
||||
- [x] All acceptance scenarios are defined
|
||||
- [x] Edge cases are identified
|
||||
- [x] Scope is clearly bounded
|
||||
- [x] Dependencies and assumptions identified
|
||||
|
||||
## Feature Readiness
|
||||
|
||||
- [x] All functional requirements have clear acceptance criteria
|
||||
- [x] User scenarios cover primary flows
|
||||
- [x] Feature meets measurable outcomes defined in Success Criteria
|
||||
- [x] No implementation details leak into specification
|
||||
|
||||
## Notes
|
||||
|
||||
- Specification passed all validation checks
|
||||
- Clarification session completed 2026-01-06 (4 questions resolved)
|
||||
- Ready for `/speckit.plan`
|
||||
- 4 user stories defined (2 P1, 1 P2, 1 P3)
|
||||
- 14 functional requirements specified (added FR-013, FR-014 for pagination)
|
||||
- 7 measurable success criteria defined
|
||||
- 5 edge cases documented
|
||||
- Pagination limits (100 default) added to User Stories 2 and 3
|
||||
- Multi-project handling clarified in User Story 1
|
||||
365
specs/001-schedule-tools/contracts/mcp-tools.json
Normal file
365
specs/001-schedule-tools/contracts/mcp-tools.json
Normal file
@@ -0,0 +1,365 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "XER MCP Server Tools",
|
||||
"description": "MCP tool definitions for Primavera P6 XER file analysis",
|
||||
"version": "0.1.0",
|
||||
"tools": [
|
||||
{
|
||||
"name": "load_xer",
|
||||
"description": "Load a Primavera P6 XER file and parse its schedule data. For multi-project files, specify project_id to select a project.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file_path": {
|
||||
"type": "string",
|
||||
"description": "Absolute path to the XER file"
|
||||
},
|
||||
"project_id": {
|
||||
"type": "string",
|
||||
"description": "Project ID to select (required for multi-project files)"
|
||||
}
|
||||
},
|
||||
"required": ["file_path"]
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"success": { "type": "boolean" },
|
||||
"project": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"proj_id": { "type": "string" },
|
||||
"proj_short_name": { "type": "string" },
|
||||
"plan_start_date": { "type": "string", "format": "date-time" },
|
||||
"plan_end_date": { "type": "string", "format": "date-time" }
|
||||
}
|
||||
},
|
||||
"activity_count": { "type": "integer" },
|
||||
"relationship_count": { "type": "integer" },
|
||||
"available_projects": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"proj_id": { "type": "string" },
|
||||
"proj_short_name": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"description": "Only present for multi-project files without selection"
|
||||
},
|
||||
"warnings": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "list_activities",
|
||||
"description": "List activities from the loaded XER file with optional filtering and pagination.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_date": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"description": "Filter activities starting on or after this date (YYYY-MM-DD)"
|
||||
},
|
||||
"end_date": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"description": "Filter activities ending on or before this date (YYYY-MM-DD)"
|
||||
},
|
||||
"wbs_id": {
|
||||
"type": "string",
|
||||
"description": "Filter by WBS element ID"
|
||||
},
|
||||
"activity_type": {
|
||||
"type": "string",
|
||||
"enum": ["TT_Task", "TT_Mile", "TT_LOE", "TT_WBS", "TT_Rsrc"],
|
||||
"description": "Filter by activity type"
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"minimum": 1,
|
||||
"maximum": 1000,
|
||||
"description": "Maximum number of activities to return"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"minimum": 0,
|
||||
"description": "Number of activities to skip"
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activities": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/ActivitySummary"
|
||||
}
|
||||
},
|
||||
"pagination": { "$ref": "#/$defs/Pagination" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_activity",
|
||||
"description": "Get detailed information for a specific activity by ID.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": {
|
||||
"type": "string",
|
||||
"description": "The task_id of the activity"
|
||||
}
|
||||
},
|
||||
"required": ["activity_id"]
|
||||
},
|
||||
"outputSchema": {
|
||||
"$ref": "#/$defs/ActivityDetail"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "list_relationships",
|
||||
"description": "List all relationships (dependencies) with pagination.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"minimum": 1,
|
||||
"maximum": 1000
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"relationships": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/Relationship" }
|
||||
},
|
||||
"pagination": { "$ref": "#/$defs/Pagination" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_predecessors",
|
||||
"description": "Get all predecessor activities for a given activity.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": {
|
||||
"type": "string",
|
||||
"description": "The task_id of the activity"
|
||||
}
|
||||
},
|
||||
"required": ["activity_id"]
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": { "type": "string" },
|
||||
"predecessors": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/RelatedActivity" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_successors",
|
||||
"description": "Get all successor activities for a given activity.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": {
|
||||
"type": "string",
|
||||
"description": "The task_id of the activity"
|
||||
}
|
||||
},
|
||||
"required": ["activity_id"]
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": { "type": "string" },
|
||||
"successors": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/RelatedActivity" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_project_summary",
|
||||
"description": "Get high-level summary of the loaded project.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"project": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"proj_id": { "type": "string" },
|
||||
"proj_short_name": { "type": "string" },
|
||||
"plan_start_date": { "type": "string", "format": "date-time" },
|
||||
"plan_end_date": { "type": "string", "format": "date-time" }
|
||||
}
|
||||
},
|
||||
"activity_count": { "type": "integer" },
|
||||
"milestone_count": { "type": "integer" },
|
||||
"relationship_count": { "type": "integer" },
|
||||
"wbs_element_count": { "type": "integer" },
|
||||
"critical_activity_count": { "type": "integer" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "list_milestones",
|
||||
"description": "List all milestone activities with pagination.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"minimum": 1,
|
||||
"maximum": 1000
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"milestones": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/ActivitySummary" }
|
||||
},
|
||||
"pagination": { "$ref": "#/$defs/Pagination" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get_critical_path",
|
||||
"description": "Get activities on the critical path (using P6's stored critical flags).",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"minimum": 1,
|
||||
"maximum": 1000
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"outputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"critical_activities": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/ActivitySummary" }
|
||||
},
|
||||
"pagination": { "$ref": "#/$defs/Pagination" }
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"$defs": {
|
||||
"ActivitySummary": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"task_id": { "type": "string" },
|
||||
"task_code": { "type": "string" },
|
||||
"task_name": { "type": "string" },
|
||||
"task_type": { "type": "string" },
|
||||
"target_start_date": { "type": "string", "format": "date-time" },
|
||||
"target_end_date": { "type": "string", "format": "date-time" },
|
||||
"status_code": { "type": "string" },
|
||||
"driving_path_flag": { "type": "boolean" }
|
||||
}
|
||||
},
|
||||
"ActivityDetail": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"task_id": { "type": "string" },
|
||||
"task_code": { "type": "string" },
|
||||
"task_name": { "type": "string" },
|
||||
"task_type": { "type": "string" },
|
||||
"wbs_id": { "type": "string" },
|
||||
"wbs_name": { "type": "string" },
|
||||
"target_start_date": { "type": "string", "format": "date-time" },
|
||||
"target_end_date": { "type": "string", "format": "date-time" },
|
||||
"act_start_date": { "type": "string", "format": "date-time" },
|
||||
"act_end_date": { "type": "string", "format": "date-time" },
|
||||
"total_float_hr_cnt": { "type": "number" },
|
||||
"status_code": { "type": "string" },
|
||||
"driving_path_flag": { "type": "boolean" },
|
||||
"predecessor_count": { "type": "integer" },
|
||||
"successor_count": { "type": "integer" }
|
||||
}
|
||||
},
|
||||
"Relationship": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"task_pred_id": { "type": "string" },
|
||||
"task_id": { "type": "string" },
|
||||
"task_name": { "type": "string" },
|
||||
"pred_task_id": { "type": "string" },
|
||||
"pred_task_name": { "type": "string" },
|
||||
"pred_type": {
|
||||
"type": "string",
|
||||
"enum": ["FS", "SS", "FF", "SF"]
|
||||
},
|
||||
"lag_hr_cnt": { "type": "number" }
|
||||
}
|
||||
},
|
||||
"RelatedActivity": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"task_id": { "type": "string" },
|
||||
"task_code": { "type": "string" },
|
||||
"task_name": { "type": "string" },
|
||||
"relationship_type": {
|
||||
"type": "string",
|
||||
"enum": ["FS", "SS", "FF", "SF"]
|
||||
},
|
||||
"lag_hr_cnt": { "type": "number" }
|
||||
}
|
||||
},
|
||||
"Pagination": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total_count": { "type": "integer" },
|
||||
"offset": { "type": "integer" },
|
||||
"limit": { "type": "integer" },
|
||||
"has_more": { "type": "boolean" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
234
specs/001-schedule-tools/data-model.md
Normal file
234
specs/001-schedule-tools/data-model.md
Normal file
@@ -0,0 +1,234 @@
|
||||
# Data Model: Project Schedule Tools
|
||||
|
||||
**Date**: 2026-01-06
|
||||
**Branch**: `001-schedule-tools`
|
||||
|
||||
## Entity Overview
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐
|
||||
│ Project │───────│ WBS │
|
||||
└─────────────┘ └─────────────┘
|
||||
│ │
|
||||
│ │
|
||||
▼ ▼
|
||||
┌─────────────┐ ┌─────────────┐
|
||||
│ Activity │◄──────│ Relationship│
|
||||
└─────────────┘ └─────────────┘
|
||||
│
|
||||
▼
|
||||
┌─────────────┐
|
||||
│ Calendar │ (internal only)
|
||||
└─────────────┘
|
||||
```
|
||||
|
||||
## Entities
|
||||
|
||||
### Project
|
||||
|
||||
Top-level container representing a P6 project.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| proj_id | string | Yes | Unique project identifier from P6 |
|
||||
| proj_short_name | string | Yes | Short display name |
|
||||
| plan_start_date | datetime | No | Planned start date |
|
||||
| plan_end_date | datetime | No | Planned end date |
|
||||
| loaded_at | datetime | Yes | When file was loaded into server |
|
||||
|
||||
**XER Source**: `PROJECT` table
|
||||
|
||||
**Validation Rules**:
|
||||
- proj_id must be unique within loaded data
|
||||
- proj_short_name must not be empty
|
||||
|
||||
### Activity
|
||||
|
||||
A unit of work in the schedule.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| task_id | string | Yes | Unique activity identifier |
|
||||
| proj_id | string | Yes | Parent project reference |
|
||||
| wbs_id | string | No | WBS element reference |
|
||||
| task_code | string | Yes | User-visible activity code |
|
||||
| task_name | string | Yes | Activity description |
|
||||
| task_type | enum | Yes | TT_Task, TT_Mile, TT_LOE, TT_WBS, TT_Rsrc |
|
||||
| target_start_date | datetime | No | Planned start |
|
||||
| target_end_date | datetime | No | Planned finish |
|
||||
| act_start_date | datetime | No | Actual start |
|
||||
| act_end_date | datetime | No | Actual finish |
|
||||
| total_float_hr_cnt | float | No | Total float in hours |
|
||||
| driving_path_flag | boolean | No | True if on critical path |
|
||||
| status_code | enum | No | TK_NotStart, TK_Active, TK_Complete |
|
||||
|
||||
**XER Source**: `TASK` table
|
||||
|
||||
**Validation Rules**:
|
||||
- task_id must be unique
|
||||
- task_code must not be empty
|
||||
- task_name must not be empty
|
||||
- If act_start_date exists, target_start_date should exist
|
||||
- If act_end_date exists, act_start_date must exist
|
||||
|
||||
**State Transitions**:
|
||||
```
|
||||
TK_NotStart ──[actual start recorded]──► TK_Active
|
||||
TK_Active ──[actual finish recorded]──► TK_Complete
|
||||
```
|
||||
|
||||
### Relationship
|
||||
|
||||
A dependency link between two activities.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| task_pred_id | string | Yes | Unique relationship identifier |
|
||||
| task_id | string | Yes | Successor activity (the one being constrained) |
|
||||
| pred_task_id | string | Yes | Predecessor activity (the one constraining) |
|
||||
| pred_type | enum | Yes | PR_FS, PR_SS, PR_FF, PR_SF |
|
||||
| lag_hr_cnt | float | No | Lag time in hours (can be negative) |
|
||||
|
||||
**XER Source**: `TASKPRED` table
|
||||
|
||||
**Relationship Types**:
|
||||
| Code | Name | Meaning |
|
||||
|------|------|---------|
|
||||
| PR_FS | Finish-to-Start | Successor starts after predecessor finishes |
|
||||
| PR_SS | Start-to-Start | Successor starts after predecessor starts |
|
||||
| PR_FF | Finish-to-Finish | Successor finishes after predecessor finishes |
|
||||
| PR_SF | Start-to-Finish | Successor finishes after predecessor starts |
|
||||
|
||||
**Validation Rules**:
|
||||
- task_id and pred_task_id must reference existing activities
|
||||
- task_id must not equal pred_task_id (no self-reference)
|
||||
- pred_type must be one of the four valid types
|
||||
|
||||
### WBS (Work Breakdown Structure)
|
||||
|
||||
Hierarchical organization of activities.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| wbs_id | string | Yes | Unique WBS identifier |
|
||||
| proj_id | string | Yes | Parent project reference |
|
||||
| parent_wbs_id | string | No | Parent WBS element (null for root) |
|
||||
| wbs_short_name | string | Yes | Short code |
|
||||
| wbs_name | string | No | Full description |
|
||||
| wbs_level | integer | No | Hierarchy depth (0 = root) |
|
||||
|
||||
**XER Source**: `PROJWBS` table
|
||||
|
||||
**Validation Rules**:
|
||||
- wbs_id must be unique
|
||||
- parent_wbs_id must reference existing WBS or be null
|
||||
- No circular parent references
|
||||
|
||||
### Calendar (Internal)
|
||||
|
||||
Work schedule definition. Not exposed via MCP tools.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| clndr_id | string | Yes | Unique calendar identifier |
|
||||
| clndr_name | string | Yes | Calendar name |
|
||||
| day_hr_cnt | float | No | Hours per work day |
|
||||
| week_hr_cnt | float | No | Hours per work week |
|
||||
|
||||
**XER Source**: `CALENDAR` table
|
||||
|
||||
**Note**: Parsed and stored but not exposed as queryable. Used internally if duration calculations are needed in future.
|
||||
|
||||
### PaginationMetadata
|
||||
|
||||
Response wrapper for paginated queries.
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| total_count | integer | Yes | Total items matching query |
|
||||
| offset | integer | Yes | Current offset (0-based) |
|
||||
| limit | integer | Yes | Items per page |
|
||||
| has_more | boolean | Yes | True if more items exist |
|
||||
|
||||
## SQLite Schema
|
||||
|
||||
```sql
|
||||
-- Projects
|
||||
CREATE TABLE projects (
|
||||
proj_id TEXT PRIMARY KEY,
|
||||
proj_short_name TEXT NOT NULL,
|
||||
plan_start_date TEXT,
|
||||
plan_end_date TEXT,
|
||||
loaded_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- Activities
|
||||
CREATE TABLE activities (
|
||||
task_id TEXT PRIMARY KEY,
|
||||
proj_id TEXT NOT NULL,
|
||||
wbs_id TEXT,
|
||||
task_code TEXT NOT NULL,
|
||||
task_name TEXT NOT NULL,
|
||||
task_type TEXT NOT NULL,
|
||||
target_start_date TEXT,
|
||||
target_end_date TEXT,
|
||||
act_start_date TEXT,
|
||||
act_end_date TEXT,
|
||||
total_float_hr_cnt REAL,
|
||||
driving_path_flag INTEGER DEFAULT 0,
|
||||
status_code TEXT,
|
||||
FOREIGN KEY (proj_id) REFERENCES projects(proj_id),
|
||||
FOREIGN KEY (wbs_id) REFERENCES wbs(wbs_id)
|
||||
);
|
||||
|
||||
-- Relationships
|
||||
CREATE TABLE relationships (
|
||||
task_pred_id TEXT PRIMARY KEY,
|
||||
task_id TEXT NOT NULL,
|
||||
pred_task_id TEXT NOT NULL,
|
||||
pred_type TEXT NOT NULL,
|
||||
lag_hr_cnt REAL DEFAULT 0,
|
||||
FOREIGN KEY (task_id) REFERENCES activities(task_id),
|
||||
FOREIGN KEY (pred_task_id) REFERENCES activities(task_id)
|
||||
);
|
||||
|
||||
-- WBS
|
||||
CREATE TABLE wbs (
|
||||
wbs_id TEXT PRIMARY KEY,
|
||||
proj_id TEXT NOT NULL,
|
||||
parent_wbs_id TEXT,
|
||||
wbs_short_name TEXT NOT NULL,
|
||||
wbs_name TEXT,
|
||||
FOREIGN KEY (proj_id) REFERENCES projects(proj_id),
|
||||
FOREIGN KEY (parent_wbs_id) REFERENCES wbs(wbs_id)
|
||||
);
|
||||
|
||||
-- Calendars (internal)
|
||||
CREATE TABLE calendars (
|
||||
clndr_id TEXT PRIMARY KEY,
|
||||
clndr_name TEXT NOT NULL,
|
||||
day_hr_cnt REAL,
|
||||
week_hr_cnt REAL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX idx_activities_proj ON activities(proj_id);
|
||||
CREATE INDEX idx_activities_wbs ON activities(wbs_id);
|
||||
CREATE INDEX idx_activities_type ON activities(task_type);
|
||||
CREATE INDEX idx_activities_critical ON activities(driving_path_flag) WHERE driving_path_flag = 1;
|
||||
CREATE INDEX idx_activities_dates ON activities(target_start_date, target_end_date);
|
||||
CREATE INDEX idx_relationships_task ON relationships(task_id);
|
||||
CREATE INDEX idx_relationships_pred ON relationships(pred_task_id);
|
||||
CREATE INDEX idx_wbs_parent ON wbs(parent_wbs_id);
|
||||
CREATE INDEX idx_wbs_proj ON wbs(proj_id);
|
||||
```
|
||||
|
||||
## Date Handling
|
||||
|
||||
All dates stored as ISO8601 strings in SQLite for portability:
|
||||
- Format: `YYYY-MM-DDTHH:MM:SS`
|
||||
- Timezone: Preserved from XER if present, otherwise naive
|
||||
- Comparisons: String comparison works correctly with ISO8601
|
||||
|
||||
XER date format: `YYYY-MM-DD HH:MM` (space-separated, no seconds)
|
||||
Conversion on import: Add `:00` for seconds, replace space with `T`
|
||||
127
specs/001-schedule-tools/plan.md
Normal file
127
specs/001-schedule-tools/plan.md
Normal file
@@ -0,0 +1,127 @@
|
||||
# Implementation Plan: Project Schedule Tools
|
||||
|
||||
**Branch**: `001-schedule-tools` | **Date**: 2026-01-06 | **Spec**: [spec.md](./spec.md)
|
||||
**Input**: Feature specification from `/specs/001-schedule-tools/spec.md`
|
||||
|
||||
## Summary
|
||||
|
||||
Build an MCP server that parses Primavera P6 XER files and exposes schedule data (activities, relationships, project summaries) through MCP tools. The server uses stdio transport, loads XER data into SQLite for efficient querying, and implements pagination to prevent context overflow for AI assistants.
|
||||
|
||||
## Technical Context
|
||||
|
||||
**Language/Version**: Python 3.14
|
||||
**Package Manager**: uv
|
||||
**Primary Dependencies**: mcp (MCP SDK), sqlite3 (stdlib)
|
||||
**Storage**: SQLite (in-memory or file-based per session)
|
||||
**Testing**: pytest with pytest-asyncio for async MCP handlers
|
||||
**Target Platform**: Linux/macOS/Windows (cross-platform CLI)
|
||||
**Transport**: stdio (standard input/output)
|
||||
**Project Type**: Single project
|
||||
**Performance Goals**: Load 10,000 activities in <5 seconds; query response <1 second
|
||||
**Constraints**: Default 100-item pagination limit; single-user operation
|
||||
**Scale/Scope**: Files up to 50,000 activities
|
||||
|
||||
## Constitution Check
|
||||
|
||||
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
|
||||
|
||||
| Principle | Requirement | Status | Notes |
|
||||
|-----------|-------------|--------|-------|
|
||||
| I. Test-First Development | TDD mandatory; tests fail before implementation | ✅ PASS | Plan includes contract tests for MCP tools, integration tests for XER parsing |
|
||||
| II. Extensibility Architecture | Pluggable handlers; separated concerns | ✅ PASS | XER parser separated from MCP layer; table handlers pluggable |
|
||||
| III. MCP Protocol Compliance | Complete JSON schemas; proper error format | ✅ PASS | All tools will have full schemas; errors follow MCP format |
|
||||
| IV. XER Format Fidelity | No data loss; preserve precision | ✅ PASS | SQLite preserves all parsed data; unknown tables stored |
|
||||
| V. Semantic Versioning | SemVer for releases | ✅ PASS | Will use 0.1.0 for initial release |
|
||||
|
||||
**Technical Standards Compliance**:
|
||||
- Python 3.14 ✅
|
||||
- Type hints throughout ✅
|
||||
- Formatting via ruff ✅
|
||||
- Dependencies pinned in pyproject.toml ✅
|
||||
- Console logging ✅
|
||||
|
||||
## Project Structure
|
||||
|
||||
### Documentation (this feature)
|
||||
|
||||
```text
|
||||
specs/001-schedule-tools/
|
||||
├── plan.md # This file
|
||||
├── research.md # Phase 0 output
|
||||
├── data-model.md # Phase 1 output
|
||||
├── quickstart.md # Phase 1 output
|
||||
├── contracts/ # Phase 1 output (MCP tool schemas)
|
||||
└── tasks.md # Phase 2 output (/speckit.tasks command)
|
||||
```
|
||||
|
||||
### Source Code (repository root)
|
||||
|
||||
```text
|
||||
src/
|
||||
├── xer_mcp/
|
||||
│ ├── __init__.py
|
||||
│ ├── server.py # MCP server entry point (stdio)
|
||||
│ ├── tools/ # MCP tool implementations
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── load_xer.py
|
||||
│ │ ├── list_activities.py
|
||||
│ │ ├── get_activity.py
|
||||
│ │ ├── list_relationships.py
|
||||
│ │ ├── get_predecessors.py
|
||||
│ │ ├── get_successors.py
|
||||
│ │ ├── get_project_summary.py
|
||||
│ │ ├── list_milestones.py
|
||||
│ │ └── get_critical_path.py
|
||||
│ ├── parser/ # XER file parsing
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── xer_parser.py # Main parser
|
||||
│ │ └── table_handlers/ # Pluggable table handlers
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── base.py # Abstract base class
|
||||
│ │ ├── project.py
|
||||
│ │ ├── task.py
|
||||
│ │ ├── taskpred.py
|
||||
│ │ ├── projwbs.py
|
||||
│ │ └── calendar.py
|
||||
│ ├── db/ # SQLite database layer
|
||||
│ │ ├── __init__.py
|
||||
│ │ ├── schema.py # Table definitions
|
||||
│ │ ├── loader.py # Load parsed data into SQLite
|
||||
│ │ └── queries.py # Query functions with pagination
|
||||
│ └── models/ # Data models (dataclasses)
|
||||
│ ├── __init__.py
|
||||
│ ├── project.py
|
||||
│ ├── activity.py
|
||||
│ ├── relationship.py
|
||||
│ └── pagination.py
|
||||
|
||||
tests/
|
||||
├── conftest.py # Shared fixtures (sample XER files)
|
||||
├── contract/ # MCP tool contract tests
|
||||
│ ├── test_load_xer.py
|
||||
│ ├── test_list_activities.py
|
||||
│ ├── test_get_activity.py
|
||||
│ ├── test_list_relationships.py
|
||||
│ ├── test_get_predecessors.py
|
||||
│ ├── test_get_successors.py
|
||||
│ ├── test_get_project_summary.py
|
||||
│ ├── test_list_milestones.py
|
||||
│ └── test_get_critical_path.py
|
||||
├── integration/ # End-to-end XER parsing tests
|
||||
│ ├── test_xer_parsing.py
|
||||
│ ├── test_multi_project.py
|
||||
│ └── test_edge_cases.py
|
||||
└── unit/ # Unit tests for parser, db, models
|
||||
├── test_parser.py
|
||||
├── test_table_handlers.py
|
||||
├── test_db_queries.py
|
||||
└── test_models.py
|
||||
|
||||
pyproject.toml # Project config with uv
|
||||
```
|
||||
|
||||
**Structure Decision**: Single project structure with clear separation between MCP tools, XER parsing, and SQLite database layers. The parser/table_handlers/ directory enables extensibility for future XER table types.
|
||||
|
||||
## Complexity Tracking
|
||||
|
||||
No constitution violations requiring justification. Design follows all principles.
|
||||
270
specs/001-schedule-tools/quickstart.md
Normal file
270
specs/001-schedule-tools/quickstart.md
Normal file
@@ -0,0 +1,270 @@
|
||||
# Quickstart: XER MCP Server
|
||||
|
||||
This guide shows how to set up and use the XER MCP Server for querying Primavera P6 schedule data.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3.14+
|
||||
- uv package manager
|
||||
- An XER file exported from Primavera P6
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone <repo-url>
|
||||
cd xer-mcp
|
||||
|
||||
# Install dependencies with uv
|
||||
uv sync
|
||||
|
||||
# Verify installation
|
||||
uv run python -m xer_mcp --help
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Add the server to your MCP client configuration (e.g., Claude Desktop):
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"xer-mcp": {
|
||||
"command": "uv",
|
||||
"args": ["run", "python", "-m", "xer_mcp"],
|
||||
"cwd": "/path/to/xer-mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
### 1. Load an XER File
|
||||
|
||||
```
|
||||
Use the load_xer tool with file_path="/path/to/schedule.xer"
|
||||
```
|
||||
|
||||
**Response** (single project):
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"project": {
|
||||
"proj_id": "P001",
|
||||
"proj_short_name": "Construction Phase 1",
|
||||
"plan_start_date": "2026-01-15T00:00:00",
|
||||
"plan_end_date": "2026-06-30T00:00:00"
|
||||
},
|
||||
"activity_count": 450,
|
||||
"relationship_count": 520
|
||||
}
|
||||
```
|
||||
|
||||
**Response** (multi-project, no selection):
|
||||
```json
|
||||
{
|
||||
"success": false,
|
||||
"available_projects": [
|
||||
{"proj_id": "P001", "proj_short_name": "Phase 1"},
|
||||
{"proj_id": "P002", "proj_short_name": "Phase 2"}
|
||||
],
|
||||
"message": "Multiple projects found. Please specify project_id."
|
||||
}
|
||||
```
|
||||
|
||||
### 2. List Activities
|
||||
|
||||
```
|
||||
Use the list_activities tool
|
||||
```
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"activities": [
|
||||
{
|
||||
"task_id": "A1000",
|
||||
"task_code": "A1000",
|
||||
"task_name": "Site Preparation",
|
||||
"task_type": "TT_Task",
|
||||
"target_start_date": "2026-01-15T08:00:00",
|
||||
"target_end_date": "2026-01-22T17:00:00",
|
||||
"status_code": "TK_NotStart",
|
||||
"driving_path_flag": true
|
||||
}
|
||||
],
|
||||
"pagination": {
|
||||
"total_count": 450,
|
||||
"offset": 0,
|
||||
"limit": 100,
|
||||
"has_more": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Filter Activities by Date Range
|
||||
|
||||
```
|
||||
Use the list_activities tool with start_date="2026-02-01" and end_date="2026-02-28"
|
||||
```
|
||||
|
||||
### 4. Get Activity Details
|
||||
|
||||
```
|
||||
Use the get_activity tool with activity_id="A1000"
|
||||
```
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"task_id": "A1000",
|
||||
"task_code": "A1000",
|
||||
"task_name": "Site Preparation",
|
||||
"task_type": "TT_Task",
|
||||
"wbs_id": "WBS001",
|
||||
"wbs_name": "Pre-Construction",
|
||||
"target_start_date": "2026-01-15T08:00:00",
|
||||
"target_end_date": "2026-01-22T17:00:00",
|
||||
"act_start_date": null,
|
||||
"act_end_date": null,
|
||||
"total_float_hr_cnt": 0,
|
||||
"status_code": "TK_NotStart",
|
||||
"driving_path_flag": true,
|
||||
"predecessor_count": 0,
|
||||
"successor_count": 5
|
||||
}
|
||||
```
|
||||
|
||||
### 5. Query Predecessors/Successors
|
||||
|
||||
```
|
||||
Use the get_predecessors tool with activity_id="A1050"
|
||||
```
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"activity_id": "A1050",
|
||||
"predecessors": [
|
||||
{
|
||||
"task_id": "A1000",
|
||||
"task_code": "A1000",
|
||||
"task_name": "Site Preparation",
|
||||
"relationship_type": "FS",
|
||||
"lag_hr_cnt": 0
|
||||
},
|
||||
{
|
||||
"task_id": "A1010",
|
||||
"task_code": "A1010",
|
||||
"task_name": "Permits Approved",
|
||||
"relationship_type": "FS",
|
||||
"lag_hr_cnt": 8
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Get Project Summary
|
||||
|
||||
```
|
||||
Use the get_project_summary tool
|
||||
```
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"project": {
|
||||
"proj_id": "P001",
|
||||
"proj_short_name": "Construction Phase 1",
|
||||
"plan_start_date": "2026-01-15T00:00:00",
|
||||
"plan_end_date": "2026-06-30T00:00:00"
|
||||
},
|
||||
"activity_count": 450,
|
||||
"milestone_count": 25,
|
||||
"relationship_count": 520,
|
||||
"wbs_element_count": 30,
|
||||
"critical_activity_count": 85
|
||||
}
|
||||
```
|
||||
|
||||
### 7. Get Critical Path
|
||||
|
||||
```
|
||||
Use the get_critical_path tool
|
||||
```
|
||||
|
||||
**Response**:
|
||||
```json
|
||||
{
|
||||
"critical_activities": [
|
||||
{
|
||||
"task_id": "A1000",
|
||||
"task_code": "A1000",
|
||||
"task_name": "Site Preparation",
|
||||
"task_type": "TT_Task",
|
||||
"target_start_date": "2026-01-15T08:00:00",
|
||||
"target_end_date": "2026-01-22T17:00:00"
|
||||
}
|
||||
],
|
||||
"pagination": {
|
||||
"total_count": 85,
|
||||
"offset": 0,
|
||||
"limit": 100,
|
||||
"has_more": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 8. List Milestones
|
||||
|
||||
```
|
||||
Use the list_milestones tool
|
||||
```
|
||||
|
||||
## Pagination
|
||||
|
||||
All list operations support pagination:
|
||||
|
||||
```
|
||||
Use the list_activities tool with limit=50 and offset=100
|
||||
```
|
||||
|
||||
This returns activities 101-150 (0-indexed).
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Error | Meaning | Solution |
|
||||
|-------|---------|----------|
|
||||
| FILE_NOT_FOUND | XER file path doesn't exist | Check file path |
|
||||
| PARSE_ERROR | XER file is malformed | Verify file is valid P6 export |
|
||||
| NO_FILE_LOADED | Query before load_xer | Call load_xer first |
|
||||
| PROJECT_SELECTION_REQUIRED | Multi-project file | Specify project_id in load_xer |
|
||||
| ACTIVITY_NOT_FOUND | Invalid activity_id | Check activity exists |
|
||||
|
||||
## Relationship Types
|
||||
|
||||
| Code | Name | Meaning |
|
||||
|------|------|---------|
|
||||
| FS | Finish-to-Start | B starts after A finishes |
|
||||
| SS | Start-to-Start | B starts after A starts |
|
||||
| FF | Finish-to-Finish | B finishes after A finishes |
|
||||
| SF | Start-to-Finish | B finishes after A starts |
|
||||
|
||||
## Activity Types
|
||||
|
||||
| Code | Name | Description |
|
||||
|------|------|-------------|
|
||||
| TT_Task | Task | Normal work activity with duration |
|
||||
| TT_Mile | Milestone | Zero-duration marker |
|
||||
| TT_LOE | Level of Effort | Duration spans linked activities |
|
||||
| TT_WBS | WBS Summary | Summary of child activities |
|
||||
| TT_Rsrc | Resource Dependent | Duration from resource assignment |
|
||||
|
||||
## Tips for AI Assistants
|
||||
|
||||
1. **Start with summary**: Call `get_project_summary` first to understand scope
|
||||
2. **Use pagination**: Large schedules may have thousands of activities
|
||||
3. **Filter early**: Use date ranges and WBS filters to reduce results
|
||||
4. **Check critical path**: `get_critical_path` identifies schedule-driving work
|
||||
5. **Follow relationships**: Use `get_predecessors`/`get_successors` to trace dependencies
|
||||
200
specs/001-schedule-tools/research.md
Normal file
200
specs/001-schedule-tools/research.md
Normal file
@@ -0,0 +1,200 @@
|
||||
# Research: Project Schedule Tools
|
||||
|
||||
**Date**: 2026-01-06
|
||||
**Branch**: `001-schedule-tools`
|
||||
|
||||
## XER File Format
|
||||
|
||||
### Decision: Parse tab-delimited format with %T table headers
|
||||
|
||||
**Rationale**: XER is Primavera P6's native export format. It uses a simple text-based structure that's straightforward to parse without external libraries.
|
||||
|
||||
**Format Structure**:
|
||||
```
|
||||
ERMHDR ...header info...
|
||||
%T TABLE_NAME
|
||||
%F field1 field2 field3 ...
|
||||
%R value1 value2 value3 ...
|
||||
%R value1 value2 value3 ...
|
||||
%T NEXT_TABLE
|
||||
...
|
||||
%E
|
||||
```
|
||||
|
||||
**Key Tables for Schedule Tools**:
|
||||
| Table | Purpose | Key Fields |
|
||||
|-------|---------|------------|
|
||||
| PROJECT | Project metadata | proj_id, proj_short_name, plan_start_date, plan_end_date |
|
||||
| TASK | Activities | task_id, task_code, task_name, task_type, target_start_date, target_end_date, act_start_date, act_end_date, driving_path_flag |
|
||||
| TASKPRED | Relationships | task_pred_id, task_id, pred_task_id, pred_type, lag_hr_cnt |
|
||||
| PROJWBS | WBS structure | wbs_id, wbs_short_name, wbs_name, parent_wbs_id, proj_id |
|
||||
| CALENDAR | Work calendars | clndr_id, clndr_name, day_hr_cnt |
|
||||
|
||||
**Alternatives Considered**:
|
||||
- XML export: More complex to parse, larger file sizes
|
||||
- Database direct access: Requires P6 installation, not portable
|
||||
|
||||
## MCP Python SDK
|
||||
|
||||
### Decision: Use `mcp` package with stdio transport
|
||||
|
||||
**Rationale**: The official MCP Python SDK provides a clean async interface for building MCP servers. Stdio transport is simplest for local tools.
|
||||
|
||||
**Implementation Pattern**:
|
||||
```python
|
||||
from mcp.server import Server
|
||||
from mcp.server.stdio import stdio_server
|
||||
|
||||
server = Server("xer-mcp")
|
||||
|
||||
@server.tool()
|
||||
async def load_xer(file_path: str, project_id: str | None = None) -> dict:
|
||||
"""Load an XER file and optionally select a project."""
|
||||
...
|
||||
|
||||
async def main():
|
||||
async with stdio_server() as (read_stream, write_stream):
|
||||
await server.run(read_stream, write_stream, server.create_initialization_options())
|
||||
```
|
||||
|
||||
**Key Considerations**:
|
||||
- All tools are async functions decorated with `@server.tool()`
|
||||
- Tool parameters use Python type hints for JSON schema generation
|
||||
- Return values are automatically serialized to JSON
|
||||
- Errors should raise `McpError` with appropriate error codes
|
||||
|
||||
**Alternatives Considered**:
|
||||
- SSE transport: Adds complexity, not needed for local use
|
||||
- Custom protocol: Would break MCP compatibility
|
||||
|
||||
## SQLite Schema Design
|
||||
|
||||
### Decision: In-memory SQLite with normalized tables
|
||||
|
||||
**Rationale**: SQLite in-memory mode provides fast queries without file I/O overhead. Normalized tables map directly to XER structure while enabling efficient JOINs for relationship queries.
|
||||
|
||||
**Schema Design**:
|
||||
```sql
|
||||
-- Project table
|
||||
CREATE TABLE projects (
|
||||
proj_id TEXT PRIMARY KEY,
|
||||
proj_short_name TEXT NOT NULL,
|
||||
plan_start_date TEXT, -- ISO8601
|
||||
plan_end_date TEXT,
|
||||
loaded_at TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- Activities table
|
||||
CREATE TABLE activities (
|
||||
task_id TEXT PRIMARY KEY,
|
||||
proj_id TEXT NOT NULL REFERENCES projects(proj_id),
|
||||
wbs_id TEXT,
|
||||
task_code TEXT NOT NULL,
|
||||
task_name TEXT NOT NULL,
|
||||
task_type TEXT, -- TT_Task, TT_Mile, TT_LOE, etc.
|
||||
target_start_date TEXT,
|
||||
target_end_date TEXT,
|
||||
act_start_date TEXT,
|
||||
act_end_date TEXT,
|
||||
total_float_hr_cnt REAL,
|
||||
driving_path_flag TEXT, -- 'Y' or 'N'
|
||||
status_code TEXT
|
||||
);
|
||||
|
||||
-- Relationships table
|
||||
CREATE TABLE relationships (
|
||||
task_pred_id TEXT PRIMARY KEY,
|
||||
task_id TEXT NOT NULL REFERENCES activities(task_id),
|
||||
pred_task_id TEXT NOT NULL REFERENCES activities(task_id),
|
||||
pred_type TEXT NOT NULL, -- PR_FS, PR_SS, PR_FF, PR_SF
|
||||
lag_hr_cnt REAL DEFAULT 0
|
||||
);
|
||||
|
||||
-- WBS table
|
||||
CREATE TABLE wbs (
|
||||
wbs_id TEXT PRIMARY KEY,
|
||||
proj_id TEXT NOT NULL REFERENCES projects(proj_id),
|
||||
parent_wbs_id TEXT REFERENCES wbs(wbs_id),
|
||||
wbs_short_name TEXT NOT NULL,
|
||||
wbs_name TEXT
|
||||
);
|
||||
|
||||
-- Indexes for common queries
|
||||
CREATE INDEX idx_activities_proj ON activities(proj_id);
|
||||
CREATE INDEX idx_activities_wbs ON activities(wbs_id);
|
||||
CREATE INDEX idx_activities_type ON activities(task_type);
|
||||
CREATE INDEX idx_activities_dates ON activities(target_start_date, target_end_date);
|
||||
CREATE INDEX idx_relationships_task ON relationships(task_id);
|
||||
CREATE INDEX idx_relationships_pred ON relationships(pred_task_id);
|
||||
CREATE INDEX idx_wbs_parent ON wbs(parent_wbs_id);
|
||||
```
|
||||
|
||||
**Query Patterns**:
|
||||
- Pagination: `LIMIT ? OFFSET ?` with `COUNT(*)` for total
|
||||
- Date filtering: `WHERE target_start_date >= ? AND target_end_date <= ?`
|
||||
- Critical path: `WHERE driving_path_flag = 'Y'`
|
||||
- Predecessors: `SELECT * FROM relationships WHERE task_id = ?`
|
||||
- Successors: `SELECT * FROM relationships WHERE pred_task_id = ?`
|
||||
|
||||
**Alternatives Considered**:
|
||||
- File-based SQLite: Adds complexity for file management, not needed for single-session use
|
||||
- In-memory dictionaries: Would require custom indexing for efficient queries
|
||||
- DuckDB: Overkill for this use case, larger dependency
|
||||
|
||||
## XER Parsing Strategy
|
||||
|
||||
### Decision: Streaming line-by-line parser with table handler registry
|
||||
|
||||
**Rationale**: XER files can be large (50K+ activities). Streaming avoids loading entire file into memory. Table handler registry enables extensibility per constitution.
|
||||
|
||||
**Implementation Approach**:
|
||||
1. Read file line by line
|
||||
2. Track current table context (%T lines)
|
||||
3. Parse %F lines as field headers
|
||||
4. Parse %R lines as records using current field map
|
||||
5. Dispatch to registered table handler
|
||||
6. Handler converts to model and inserts into SQLite
|
||||
|
||||
**Encoding Handling**:
|
||||
- XER files use Windows-1252 encoding by default
|
||||
- Attempt UTF-8 first, fallback to Windows-1252
|
||||
- Log encoding detection result
|
||||
|
||||
## Pagination Implementation
|
||||
|
||||
### Decision: Offset-based pagination with metadata
|
||||
|
||||
**Rationale**: Simple to implement with SQLite's LIMIT/OFFSET. Metadata enables clients to navigate results.
|
||||
|
||||
**Response Format**:
|
||||
```python
|
||||
@dataclass
|
||||
class PaginatedResponse:
|
||||
items: list[dict]
|
||||
pagination: PaginationMetadata
|
||||
|
||||
@dataclass
|
||||
class PaginationMetadata:
|
||||
total_count: int
|
||||
offset: int
|
||||
limit: int
|
||||
has_more: bool
|
||||
```
|
||||
|
||||
**Default Limit**: 100 items (per spec clarification)
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Decision: Structured MCP errors with codes
|
||||
|
||||
**Rationale**: MCP protocol defines error format. Consistent error codes help clients handle failures.
|
||||
|
||||
**Error Codes**:
|
||||
| Code | Name | When Used |
|
||||
|------|------|-----------|
|
||||
| -32001 | FILE_NOT_FOUND | XER file path doesn't exist |
|
||||
| -32002 | PARSE_ERROR | XER file is malformed |
|
||||
| -32003 | NO_FILE_LOADED | Query attempted before load |
|
||||
| -32004 | PROJECT_SELECTION_REQUIRED | Multi-project file without selection |
|
||||
| -32005 | ACTIVITY_NOT_FOUND | Requested activity ID doesn't exist |
|
||||
| -32006 | INVALID_PARAMETER | Bad filter/pagination parameters |
|
||||
149
specs/001-schedule-tools/spec.md
Normal file
149
specs/001-schedule-tools/spec.md
Normal file
@@ -0,0 +1,149 @@
|
||||
# Feature Specification: Project Schedule Tools
|
||||
|
||||
**Feature Branch**: `001-schedule-tools`
|
||||
**Created**: 2026-01-06
|
||||
**Status**: Draft
|
||||
**Input**: User description: "MCP tools to query activities, relationships, and schedules from XER data"
|
||||
|
||||
## User Scenarios & Testing *(mandatory)*
|
||||
|
||||
### User Story 1 - Load XER File (Priority: P1)
|
||||
|
||||
As an AI assistant user, I want to load an XER file into the MCP server so that I can query its schedule data.
|
||||
|
||||
**Why this priority**: This is a prerequisite for all other functionality - no queries are possible without first loading data.
|
||||
|
||||
**Independent Test**: Can be tested by providing a file path and verifying the file is successfully parsed and available for queries.
|
||||
|
||||
**Acceptance Scenarios**:
|
||||
|
||||
1. **Given** a valid XER file path with a single project, **When** I request to load the file, **Then** the file is parsed, the project is auto-selected, and a success confirmation is returned with basic file info (project name, activity count)
|
||||
2. **Given** a valid XER file path with multiple projects, **When** I request to load the file without specifying a project, **Then** I receive a list of available projects and a prompt to select one
|
||||
3. **Given** a valid XER file path with multiple projects, **When** I request to load the file with a specific project ID, **Then** that project is selected and loaded
|
||||
4. **Given** an invalid file path, **When** I request to load the file, **Then** I receive a clear error message indicating the file was not found
|
||||
5. **Given** a corrupted or invalid XER file, **When** I request to load the file, **Then** I receive a clear error message describing the parsing failure
|
||||
6. **Given** a file is already loaded, **When** I load a new file, **Then** the previous data is replaced with the new file's data
|
||||
|
||||
---
|
||||
|
||||
### User Story 2 - Query Project Activities (Priority: P1)
|
||||
|
||||
As an AI assistant user, I want to query activities from a loaded XER file so that I can understand what work is planned in the project schedule.
|
||||
|
||||
**Why this priority**: Activities are the fundamental building blocks of any P6 schedule. Without the ability to query activities, no other schedule analysis is possible.
|
||||
|
||||
**Independent Test**: Can be fully tested by loading an XER file and querying for activities. Delivers immediate value by exposing schedule data to AI assistants.
|
||||
|
||||
**Acceptance Scenarios**:
|
||||
|
||||
1. **Given** an XER file is loaded, **When** I request all activities, **Then** I receive a list of activities with their names, IDs, and dates (limited to 100 by default)
|
||||
2. **Given** an XER file is loaded, **When** I request activities filtered by date range, **Then** I receive only activities that fall within that range (limited to 100 by default)
|
||||
3. **Given** an XER file is loaded, **When** I request a specific activity by ID, **Then** I receive the complete details for that activity
|
||||
4. **Given** no XER file is loaded, **When** I request activities, **Then** I receive a clear error message indicating no file is loaded
|
||||
5. **Given** an XER file with more than 100 activities, **When** I request activities without specifying a limit, **Then** I receive the first 100 activities plus pagination metadata (total count, has_more flag)
|
||||
6. **Given** an XER file is loaded, **When** I request activities with offset and limit parameters, **Then** I receive the specified page of results
|
||||
|
||||
---
|
||||
|
||||
### User Story 3 - Query Activity Relationships (Priority: P2)
|
||||
|
||||
As an AI assistant user, I want to query the relationships (dependencies) between activities so that I can understand the logical sequence of work and identify critical paths.
|
||||
|
||||
**Why this priority**: Relationships define the logical flow of work and are essential for schedule analysis, but require activities to be queryable first.
|
||||
|
||||
**Independent Test**: Can be tested by loading an XER file and querying predecessor/successor relationships for any activity.
|
||||
|
||||
**Acceptance Scenarios**:
|
||||
|
||||
1. **Given** an XER file is loaded, **When** I request predecessors for an activity, **Then** I receive a list of predecessor activities with their relationship types (FS, SS, FF, SF) and lag values
|
||||
2. **Given** an XER file is loaded, **When** I request successors for an activity, **Then** I receive a list of successor activities with their relationship types and lag values
|
||||
3. **Given** an activity has no predecessors, **When** I request its predecessors, **Then** I receive an empty list (not an error)
|
||||
4. **Given** an XER file is loaded, **When** I request all relationships, **Then** I receive the dependency network (limited to 100 by default) with pagination metadata
|
||||
5. **Given** an XER file is loaded, **When** I request relationships with offset and limit parameters, **Then** I receive the specified page of results
|
||||
6. **Given** no XER file is loaded, **When** I request relationships or predecessors/successors, **Then** I receive a clear error message indicating no file is loaded
|
||||
|
||||
---
|
||||
|
||||
### User Story 4 - Query Project Summary (Priority: P3)
|
||||
|
||||
As an AI assistant user, I want to get a high-level summary of the project schedule so that I can quickly understand project scope, timeline, and key milestones.
|
||||
|
||||
**Why this priority**: Provides valuable context for AI analysis but depends on activity and relationship data being accessible first.
|
||||
|
||||
**Independent Test**: Can be tested by loading an XER file and requesting project summary information.
|
||||
|
||||
**Acceptance Scenarios**:
|
||||
|
||||
1. **Given** an XER file is loaded, **When** I request the project summary, **Then** I receive project name, start date, finish date, and total activity count
|
||||
2. **Given** an XER file with milestones, **When** I request milestones, **Then** I receive a list of milestone activities with their target dates
|
||||
3. **Given** an XER file is loaded, **When** I request the critical path, **Then** I receive the sequence of activities that determine the project end date
|
||||
4. **Given** no XER file is loaded, **When** I request project summary, milestones, or critical path, **Then** I receive a clear error message indicating no file is loaded
|
||||
|
||||
---
|
||||
|
||||
### Edge Cases
|
||||
|
||||
- What happens when an XER file contains no activities? Return empty results with a clear indication that the file has no schedule data.
|
||||
- What happens when activity IDs are duplicated in the XER file? Use the last occurrence and log a warning.
|
||||
- What happens when relationship references point to non-existent activities? Skip invalid relationships and include them in a warnings list.
|
||||
- What happens when date fields are missing or malformed? Use null values for missing dates and report parsing warnings.
|
||||
- What happens when the XER file uses an unsupported version format? Attempt best-effort parsing and report version compatibility warnings.
|
||||
|
||||
## Requirements *(mandatory)*
|
||||
|
||||
### Functional Requirements
|
||||
|
||||
- **FR-001**: System MUST parse standard Primavera P6 XER file format and extract schedule data
|
||||
- **FR-002**: System MUST expose an MCP tool to load an XER file from a specified file path
|
||||
- **FR-003**: System MUST expose an MCP tool to list all activities with filtering options (by date range, by WBS, by activity type)
|
||||
- **FR-004**: System MUST expose an MCP tool to retrieve detailed information for a specific activity by ID
|
||||
- **FR-005**: System MUST expose an MCP tool to query predecessor and successor relationships for any activity
|
||||
- **FR-006**: System MUST expose an MCP tool to retrieve project summary information (name, dates, activity count)
|
||||
- **FR-007**: System MUST expose an MCP tool to list milestone activities
|
||||
- **FR-008**: System MUST expose an MCP tool to identify the critical path
|
||||
- **FR-009**: System MUST return structured data that AI assistants can process and present to users
|
||||
- **FR-010**: System MUST provide clear, actionable error messages when operations fail
|
||||
- **FR-011**: System MUST preserve all date/time precision from the original XER file
|
||||
- **FR-012**: System MUST handle XER files with multiple projects by requiring explicit project selection; single-project files auto-select the only project
|
||||
- **FR-013**: System MUST implement pagination for list queries with a default limit of 100 items, supporting offset and limit parameters
|
||||
- **FR-014**: System MUST return pagination metadata (total_count, has_more, offset, limit) with all paginated responses
|
||||
- **FR-015**: System MUST return an informative error (NO_FILE_LOADED) when any query tool is invoked before an XER file has been successfully loaded
|
||||
|
||||
### Key Entities
|
||||
|
||||
- **Project**: The top-level container representing a P6 project with name, ID, start/finish dates, and calendar assignments
|
||||
- **Activity**: A unit of work with ID, name, type (task/milestone/LOE), planned dates, actual dates, duration, and status
|
||||
- **Relationship**: A dependency link between two activities with type (FS/SS/FF/SF), lag value, and driving flag
|
||||
- **WBS (Work Breakdown Structure)**: Hierarchical organization of activities with ID, name, parent reference, and level
|
||||
- **Calendar**: Work schedule definition that determines working days and hours for activities (internal use only; not exposed as queryable entity)
|
||||
- **Resource**: Labor, equipment, or material assigned to activities (exposed for future resource analysis features)
|
||||
|
||||
## Success Criteria *(mandatory)*
|
||||
|
||||
### Measurable Outcomes
|
||||
|
||||
- **SC-001**: Users can load and query an XER file within 5 seconds for files up to 10,000 activities
|
||||
- **SC-002**: Users can retrieve activity details in under 1 second after file is loaded
|
||||
- **SC-003**: All standard XER table types used in schedule analysis are correctly parsed (TASK, TASKPRED, PROJECT, PROJWBS, CALENDAR)
|
||||
- **SC-004**: 100% of valid relationship types (FS, SS, FF, SF) are correctly identified and queryable
|
||||
- **SC-005**: Users receive actionable error messages that identify the specific issue when operations fail
|
||||
- **SC-006**: Critical path identification uses P6's stored critical flags, ensuring exact match with P6's own critical path
|
||||
- **SC-007**: AI assistants can successfully integrate with the MCP server and execute all exposed tools
|
||||
|
||||
## Clarifications
|
||||
|
||||
### Session 2026-01-06
|
||||
|
||||
- Q: What should be the default result limit for activity/relationship queries? → A: 100 items default limit per query
|
||||
- Q: How should critical path be determined? → A: Use P6's stored critical flags from XER data
|
||||
- Q: How should multi-project XER files be handled? → A: Require explicit project selection if multiple exist
|
||||
- Q: Should calendar data be exposed as queryable? → A: Internal use only (not exposed as queryable)
|
||||
- Q: What happens when any query tool is called without a file loaded? → A: Return informative error indicating no XER file is loaded; applies to all tools except load_xer
|
||||
|
||||
## Assumptions
|
||||
|
||||
- XER files follow the standard Primavera P6 export format (tab-delimited with %T headers)
|
||||
- The MCP server runs locally and has file system access to read XER files
|
||||
- Users have valid XER files exported from P6 (versions 6.0 through current)
|
||||
- Single-user operation - no concurrent access handling required for MVP
|
||||
- Memory is sufficient to hold parsed schedule data for typical project sizes (up to 50,000 activities)
|
||||
281
specs/001-schedule-tools/tasks.md
Normal file
281
specs/001-schedule-tools/tasks.md
Normal file
@@ -0,0 +1,281 @@
|
||||
# Tasks: Project Schedule Tools
|
||||
|
||||
**Input**: Design documents from `/specs/001-schedule-tools/`
|
||||
**Prerequisites**: plan.md, spec.md, research.md, data-model.md, contracts/
|
||||
|
||||
**Tests**: TDD is mandated by constitution - tests MUST be written and fail before implementation.
|
||||
|
||||
**Organization**: Tasks are grouped by user story to enable independent implementation and testing.
|
||||
|
||||
## Format: `[ID] [P?] [Story] Description`
|
||||
|
||||
- **[P]**: Can run in parallel (different files, no dependencies)
|
||||
- **[Story]**: Which user story this task belongs to (US1, US2, US3, US4)
|
||||
- Include exact file paths in descriptions
|
||||
|
||||
## Path Conventions
|
||||
|
||||
- **Source**: `src/xer_mcp/`
|
||||
- **Tests**: `tests/`
|
||||
- **Config**: `pyproject.toml`
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Setup (Shared Infrastructure)
|
||||
|
||||
**Purpose**: Project initialization and basic structure
|
||||
|
||||
- [ ] T001 Create project directory structure per plan.md in src/xer_mcp/
|
||||
- [ ] T002 Initialize Python project with uv and create pyproject.toml with dependencies (mcp, pytest, pytest-asyncio, ruff)
|
||||
- [ ] T003 [P] Configure ruff for linting and formatting in pyproject.toml
|
||||
- [ ] T004 [P] Create src/xer_mcp/__init__.py with version 0.1.0
|
||||
- [ ] T005 [P] Create tests/conftest.py with sample XER file fixtures
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: Foundational (Blocking Prerequisites)
|
||||
|
||||
**Purpose**: Core infrastructure that MUST be complete before ANY user story can be implemented
|
||||
|
||||
**⚠️ CRITICAL**: No user story work can begin until this phase is complete
|
||||
|
||||
- [ ] T006 Create data models in src/xer_mcp/models/__init__.py (export all models)
|
||||
- [ ] T007 [P] Create Project dataclass in src/xer_mcp/models/project.py
|
||||
- [ ] T008 [P] Create Activity dataclass in src/xer_mcp/models/activity.py
|
||||
- [ ] T009 [P] Create Relationship dataclass in src/xer_mcp/models/relationship.py
|
||||
- [ ] T010 [P] Create PaginationMetadata dataclass in src/xer_mcp/models/pagination.py
|
||||
- [ ] T011 Create SQLite schema in src/xer_mcp/db/schema.py with all tables and indexes
|
||||
- [ ] T012 Create database connection manager in src/xer_mcp/db/__init__.py
|
||||
- [ ] T013 Create MCP server skeleton in src/xer_mcp/server.py with stdio transport
|
||||
- [ ] T014 Create base table handler abstract class in src/xer_mcp/parser/table_handlers/base.py
|
||||
- [ ] T015 Create error types and NO_FILE_LOADED error in src/xer_mcp/errors.py
|
||||
|
||||
**Checkpoint**: Foundation ready - user story implementation can now begin
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: User Story 1 - Load XER File (Priority: P1) 🎯 MVP
|
||||
|
||||
**Goal**: Parse XER files and load schedule data into SQLite database
|
||||
|
||||
**Independent Test**: Load a sample XER file and verify projects, activities, relationships are stored in SQLite
|
||||
|
||||
### Tests for User Story 1
|
||||
|
||||
> **NOTE: Write these tests FIRST, ensure they FAIL before implementation**
|
||||
|
||||
- [ ] T016 [P] [US1] Contract test for load_xer tool in tests/contract/test_load_xer.py
|
||||
- [ ] T017 [P] [US1] Integration test for XER parsing in tests/integration/test_xer_parsing.py
|
||||
- [ ] T018 [P] [US1] Integration test for multi-project handling in tests/integration/test_multi_project.py
|
||||
- [ ] T019 [P] [US1] Unit test for XER parser in tests/unit/test_parser.py
|
||||
- [ ] T020 [P] [US1] Unit test for table handlers in tests/unit/test_table_handlers.py
|
||||
|
||||
### Implementation for User Story 1
|
||||
|
||||
- [ ] T021 [US1] Create XER parser main class in src/xer_mcp/parser/xer_parser.py
|
||||
- [ ] T022 [P] [US1] Create PROJECT table handler in src/xer_mcp/parser/table_handlers/project.py
|
||||
- [ ] T023 [P] [US1] Create TASK table handler in src/xer_mcp/parser/table_handlers/task.py
|
||||
- [ ] T024 [P] [US1] Create TASKPRED table handler in src/xer_mcp/parser/table_handlers/taskpred.py
|
||||
- [ ] T025 [P] [US1] Create PROJWBS table handler in src/xer_mcp/parser/table_handlers/projwbs.py
|
||||
- [ ] T026 [P] [US1] Create CALENDAR table handler in src/xer_mcp/parser/table_handlers/calendar.py
|
||||
- [ ] T027 [US1] Create table handler registry in src/xer_mcp/parser/table_handlers/__init__.py
|
||||
- [ ] T028 [US1] Create database loader in src/xer_mcp/db/loader.py to insert parsed data into SQLite
|
||||
- [ ] T029 [US1] Implement load_xer MCP tool in src/xer_mcp/tools/load_xer.py
|
||||
- [ ] T030 [US1] Register load_xer tool in src/xer_mcp/server.py
|
||||
- [ ] T031 [US1] Add file-not-found and parse-error handling in src/xer_mcp/tools/load_xer.py
|
||||
- [ ] T032 [US1] Add multi-project detection and selection logic in src/xer_mcp/tools/load_xer.py
|
||||
|
||||
**Checkpoint**: User Story 1 complete - XER files can be loaded and parsed
|
||||
|
||||
---
|
||||
|
||||
## Phase 4: User Story 2 - Query Project Activities (Priority: P1)
|
||||
|
||||
**Goal**: List and filter activities, get activity details with pagination
|
||||
|
||||
**Independent Test**: Load XER file, query activities with filters, verify pagination metadata
|
||||
|
||||
### Tests for User Story 2
|
||||
|
||||
> **NOTE: Write these tests FIRST, ensure they FAIL before implementation**
|
||||
|
||||
- [ ] T033 [P] [US2] Contract test for list_activities tool in tests/contract/test_list_activities.py
|
||||
- [ ] T034 [P] [US2] Contract test for get_activity tool in tests/contract/test_get_activity.py
|
||||
- [ ] T035 [P] [US2] Unit test for activity queries in tests/unit/test_db_queries.py
|
||||
|
||||
### Implementation for User Story 2
|
||||
|
||||
- [ ] T036 [US2] Create activity query functions with pagination in src/xer_mcp/db/queries.py
|
||||
- [ ] T037 [US2] Implement list_activities MCP tool in src/xer_mcp/tools/list_activities.py
|
||||
- [ ] T038 [US2] Implement get_activity MCP tool in src/xer_mcp/tools/get_activity.py
|
||||
- [ ] T039 [US2] Register list_activities and get_activity tools in src/xer_mcp/server.py
|
||||
- [ ] T040 [US2] Add NO_FILE_LOADED error check to activity tools in src/xer_mcp/tools/list_activities.py
|
||||
- [ ] T041 [US2] Add date range filtering to list_activities in src/xer_mcp/tools/list_activities.py
|
||||
- [ ] T042 [US2] Add WBS and activity_type filtering to list_activities in src/xer_mcp/tools/list_activities.py
|
||||
|
||||
**Checkpoint**: User Stories 1 AND 2 complete - activities are queryable
|
||||
|
||||
---
|
||||
|
||||
## Phase 5: User Story 3 - Query Activity Relationships (Priority: P2)
|
||||
|
||||
**Goal**: Query predecessors, successors, and full relationship network
|
||||
|
||||
**Independent Test**: Load XER file, query relationships for an activity, verify types and lags
|
||||
|
||||
### Tests for User Story 3
|
||||
|
||||
> **NOTE: Write these tests FIRST, ensure they FAIL before implementation**
|
||||
|
||||
- [ ] T043 [P] [US3] Contract test for list_relationships tool in tests/contract/test_list_relationships.py
|
||||
- [ ] T044 [P] [US3] Contract test for get_predecessors tool in tests/contract/test_get_predecessors.py
|
||||
- [ ] T045 [P] [US3] Contract test for get_successors tool in tests/contract/test_get_successors.py
|
||||
|
||||
### Implementation for User Story 3
|
||||
|
||||
- [ ] T046 [US3] Create relationship query functions in src/xer_mcp/db/queries.py
|
||||
- [ ] T047 [US3] Implement list_relationships MCP tool in src/xer_mcp/tools/list_relationships.py
|
||||
- [ ] T048 [US3] Implement get_predecessors MCP tool in src/xer_mcp/tools/get_predecessors.py
|
||||
- [ ] T049 [US3] Implement get_successors MCP tool in src/xer_mcp/tools/get_successors.py
|
||||
- [ ] T050 [US3] Register relationship tools in src/xer_mcp/server.py
|
||||
- [ ] T051 [US3] Add NO_FILE_LOADED error check to relationship tools
|
||||
|
||||
**Checkpoint**: User Stories 1, 2, AND 3 complete - relationships are queryable
|
||||
|
||||
---
|
||||
|
||||
## Phase 6: User Story 4 - Query Project Summary (Priority: P3)
|
||||
|
||||
**Goal**: Get project overview, milestones, and critical path activities
|
||||
|
||||
**Independent Test**: Load XER file, get summary, list milestones, get critical path
|
||||
|
||||
### Tests for User Story 4
|
||||
|
||||
> **NOTE: Write these tests FIRST, ensure they FAIL before implementation**
|
||||
|
||||
- [ ] T052 [P] [US4] Contract test for get_project_summary tool in tests/contract/test_get_project_summary.py
|
||||
- [ ] T053 [P] [US4] Contract test for list_milestones tool in tests/contract/test_list_milestones.py
|
||||
- [ ] T054 [P] [US4] Contract test for get_critical_path tool in tests/contract/test_get_critical_path.py
|
||||
|
||||
### Implementation for User Story 4
|
||||
|
||||
- [ ] T055 [US4] Create summary query functions in src/xer_mcp/db/queries.py
|
||||
- [ ] T056 [US4] Implement get_project_summary MCP tool in src/xer_mcp/tools/get_project_summary.py
|
||||
- [ ] T057 [US4] Implement list_milestones MCP tool in src/xer_mcp/tools/list_milestones.py
|
||||
- [ ] T058 [US4] Implement get_critical_path MCP tool in src/xer_mcp/tools/get_critical_path.py
|
||||
- [ ] T059 [US4] Register summary tools in src/xer_mcp/server.py
|
||||
- [ ] T060 [US4] Add NO_FILE_LOADED error check to summary tools
|
||||
|
||||
**Checkpoint**: All user stories complete - full MCP server functional
|
||||
|
||||
---
|
||||
|
||||
## Phase 7: Polish & Cross-Cutting Concerns
|
||||
|
||||
**Purpose**: Improvements that affect multiple user stories
|
||||
|
||||
- [ ] T061 [P] Integration test for edge cases in tests/integration/test_edge_cases.py
|
||||
- [ ] T062 [P] Unit test for models in tests/unit/test_models.py
|
||||
- [ ] T063 Add logging throughout src/xer_mcp/ modules
|
||||
- [ ] T064 Run quickstart.md validation - test all documented examples
|
||||
- [ ] T065 Add __main__.py entry point in src/xer_mcp/__main__.py
|
||||
- [ ] T066 Final type checking with mypy and fix any issues
|
||||
- [ ] T067 Run ruff format and fix any linting issues
|
||||
|
||||
---
|
||||
|
||||
## Dependencies & Execution Order
|
||||
|
||||
### Phase Dependencies
|
||||
|
||||
- **Setup (Phase 1)**: No dependencies - can start immediately
|
||||
- **Foundational (Phase 2)**: Depends on Setup completion - BLOCKS all user stories
|
||||
- **User Story 1 (Phase 3)**: Depends on Foundational - BLOCKS US2, US3, US4 (they need load_xer)
|
||||
- **User Story 2 (Phase 4)**: Depends on US1 (needs loaded data to query)
|
||||
- **User Story 3 (Phase 5)**: Depends on US1 (needs loaded data to query)
|
||||
- **User Story 4 (Phase 6)**: Depends on US1 (needs loaded data to query)
|
||||
- **Polish (Phase 7)**: Depends on all user stories being complete
|
||||
|
||||
### User Story Dependencies
|
||||
|
||||
- **US1 (Load XER)**: Foundation for all others - MUST complete first
|
||||
- **US2 (Activities)**: Can start after US1 - independent of US3, US4
|
||||
- **US3 (Relationships)**: Can start after US1 - independent of US2, US4
|
||||
- **US4 (Summary)**: Can start after US1 - independent of US2, US3
|
||||
|
||||
### Within Each User Story
|
||||
|
||||
- Tests MUST be written and FAIL before implementation
|
||||
- Models before services/queries
|
||||
- Queries before MCP tools
|
||||
- Core implementation before error handling
|
||||
- Register tools in server.py after implementation
|
||||
|
||||
### Parallel Opportunities
|
||||
|
||||
**Phase 2 (Foundational)**:
|
||||
```bash
|
||||
# These can run in parallel:
|
||||
Task T007: "Create Project dataclass"
|
||||
Task T008: "Create Activity dataclass"
|
||||
Task T009: "Create Relationship dataclass"
|
||||
Task T010: "Create PaginationMetadata dataclass"
|
||||
```
|
||||
|
||||
**Phase 3 (US1 - Table Handlers)**:
|
||||
```bash
|
||||
# These can run in parallel:
|
||||
Task T022: "Create PROJECT table handler"
|
||||
Task T023: "Create TASK table handler"
|
||||
Task T024: "Create TASKPRED table handler"
|
||||
Task T025: "Create PROJWBS table handler"
|
||||
Task T026: "Create CALENDAR table handler"
|
||||
```
|
||||
|
||||
**After US1 Complete (US2, US3, US4 can start in parallel)**:
|
||||
```bash
|
||||
# Developer A: User Story 2 (Activities)
|
||||
# Developer B: User Story 3 (Relationships)
|
||||
# Developer C: User Story 4 (Summary)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Implementation Strategy
|
||||
|
||||
### MVP First (User Story 1 + 2)
|
||||
|
||||
1. Complete Phase 1: Setup
|
||||
2. Complete Phase 2: Foundational
|
||||
3. Complete Phase 3: User Story 1 (Load XER)
|
||||
4. **STOP and VALIDATE**: Can load XER files successfully
|
||||
5. Complete Phase 4: User Story 2 (Activities)
|
||||
6. **MVP COMPLETE**: Can load XER and query activities
|
||||
|
||||
### Incremental Delivery
|
||||
|
||||
1. Setup + Foundational → Project ready
|
||||
2. User Story 1 → XER files load → Demo loading
|
||||
3. User Story 2 → Activities queryable → Demo activity queries
|
||||
4. User Story 3 → Relationships queryable → Demo dependency analysis
|
||||
5. User Story 4 → Summary available → Demo project overview
|
||||
6. Polish → Production ready
|
||||
|
||||
### Parallel Team Strategy
|
||||
|
||||
With multiple developers after US1:
|
||||
- Developer A: User Story 2 (list_activities, get_activity)
|
||||
- Developer B: User Story 3 (relationships, predecessors, successors)
|
||||
- Developer C: User Story 4 (summary, milestones, critical_path)
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- [P] tasks = different files, no dependencies on incomplete tasks
|
||||
- [Story] label maps task to specific user story for traceability
|
||||
- Constitution mandates TDD: write tests first, verify they fail, then implement
|
||||
- Commit after each task or logical group
|
||||
- Stop at any checkpoint to validate story independently
|
||||
- All query tools must check for NO_FILE_LOADED condition
|
||||
3
src/xer_mcp/__init__.py
Normal file
3
src/xer_mcp/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""XER MCP Server - MCP tools for querying Primavera P6 XER schedule data."""
|
||||
|
||||
__version__ = "0.1.0"
|
||||
14
src/xer_mcp/__main__.py
Normal file
14
src/xer_mcp/__main__.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Main entry point for the XER MCP Server."""
|
||||
|
||||
import asyncio
|
||||
|
||||
from xer_mcp.server import run_server
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Run the XER MCP Server."""
|
||||
asyncio.run(run_server())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
66
src/xer_mcp/db/__init__.py
Normal file
66
src/xer_mcp/db/__init__.py
Normal file
@@ -0,0 +1,66 @@
|
||||
"""Database connection management for XER MCP Server."""
|
||||
|
||||
import sqlite3
|
||||
from collections.abc import Generator
|
||||
from contextlib import contextmanager
|
||||
|
||||
from xer_mcp.db.schema import get_schema
|
||||
|
||||
|
||||
class DatabaseManager:
|
||||
"""Manages SQLite database connections and schema initialization."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
"""Initialize database manager with in-memory database."""
|
||||
self._connection: sqlite3.Connection | None = None
|
||||
|
||||
def initialize(self) -> None:
|
||||
"""Initialize the in-memory database with schema."""
|
||||
self._connection = sqlite3.connect(":memory:", check_same_thread=False)
|
||||
self._connection.row_factory = sqlite3.Row
|
||||
self._connection.executescript(get_schema())
|
||||
|
||||
def clear(self) -> None:
|
||||
"""Clear all data from the database."""
|
||||
if self._connection is None:
|
||||
return
|
||||
|
||||
tables = ["relationships", "activities", "wbs", "calendars", "projects"]
|
||||
for table in tables:
|
||||
self._connection.execute(f"DELETE FROM {table}") # noqa: S608
|
||||
self._connection.commit()
|
||||
|
||||
@property
|
||||
def connection(self) -> sqlite3.Connection:
|
||||
"""Get the database connection."""
|
||||
if self._connection is None:
|
||||
raise RuntimeError("Database not initialized. Call initialize() first.")
|
||||
return self._connection
|
||||
|
||||
@contextmanager
|
||||
def cursor(self) -> Generator[sqlite3.Cursor]:
|
||||
"""Get a cursor for executing queries."""
|
||||
cur = self.connection.cursor()
|
||||
try:
|
||||
yield cur
|
||||
finally:
|
||||
cur.close()
|
||||
|
||||
def commit(self) -> None:
|
||||
"""Commit the current transaction."""
|
||||
self.connection.commit()
|
||||
|
||||
def close(self) -> None:
|
||||
"""Close the database connection."""
|
||||
if self._connection is not None:
|
||||
self._connection.close()
|
||||
self._connection = None
|
||||
|
||||
@property
|
||||
def is_initialized(self) -> bool:
|
||||
"""Check if the database is initialized."""
|
||||
return self._connection is not None
|
||||
|
||||
|
||||
# Global database manager instance
|
||||
db = DatabaseManager()
|
||||
140
src/xer_mcp/db/loader.py
Normal file
140
src/xer_mcp/db/loader.py
Normal file
@@ -0,0 +1,140 @@
|
||||
"""Database loader for parsed XER data."""
|
||||
|
||||
from xer_mcp.db import db
|
||||
from xer_mcp.parser.xer_parser import ParsedXer
|
||||
|
||||
|
||||
def load_parsed_data(parsed: ParsedXer, project_id: str) -> None:
|
||||
"""Load parsed XER data into the database.
|
||||
|
||||
Only loads data for the specified project.
|
||||
|
||||
Args:
|
||||
parsed: Parsed XER data
|
||||
project_id: ID of the project to load
|
||||
"""
|
||||
# Find the project
|
||||
project = next((p for p in parsed.projects if p["proj_id"] == project_id), None)
|
||||
if project is None:
|
||||
raise ValueError(f"Project {project_id} not found in parsed data")
|
||||
|
||||
# Clear existing data
|
||||
db.clear()
|
||||
|
||||
with db.cursor() as cur:
|
||||
# Insert project
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO projects (proj_id, proj_short_name, plan_start_date, plan_end_date)
|
||||
VALUES (?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
project["proj_id"],
|
||||
project["proj_short_name"],
|
||||
project["plan_start_date"],
|
||||
project["plan_end_date"],
|
||||
),
|
||||
)
|
||||
|
||||
# Insert WBS elements for this project
|
||||
for wbs in parsed.projwbs:
|
||||
if wbs["proj_id"] == project_id:
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO wbs (wbs_id, proj_id, parent_wbs_id, wbs_short_name, wbs_name)
|
||||
VALUES (?, ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
wbs["wbs_id"],
|
||||
wbs["proj_id"],
|
||||
wbs["parent_wbs_id"] or None,
|
||||
wbs["wbs_short_name"],
|
||||
wbs["wbs_name"],
|
||||
),
|
||||
)
|
||||
|
||||
# Insert calendars (all calendars, they may be shared)
|
||||
for cal in parsed.calendars:
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT OR IGNORE INTO calendars (clndr_id, clndr_name, day_hr_cnt, week_hr_cnt)
|
||||
VALUES (?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
cal["clndr_id"],
|
||||
cal["clndr_name"],
|
||||
cal["day_hr_cnt"],
|
||||
cal["week_hr_cnt"],
|
||||
),
|
||||
)
|
||||
|
||||
# Insert activities for this project
|
||||
for task in parsed.tasks:
|
||||
if task["proj_id"] == project_id:
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO activities (
|
||||
task_id, proj_id, wbs_id, task_code, task_name, task_type,
|
||||
target_start_date, target_end_date, act_start_date, act_end_date,
|
||||
total_float_hr_cnt, driving_path_flag, status_code
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
task["task_id"],
|
||||
task["proj_id"],
|
||||
task["wbs_id"],
|
||||
task["task_code"],
|
||||
task["task_name"],
|
||||
task["task_type"],
|
||||
task["target_start_date"],
|
||||
task["target_end_date"],
|
||||
task["act_start_date"],
|
||||
task["act_end_date"],
|
||||
task["total_float_hr_cnt"],
|
||||
1 if task["driving_path_flag"] else 0,
|
||||
task["status_code"],
|
||||
),
|
||||
)
|
||||
|
||||
# Build set of task IDs in this project
|
||||
project_task_ids = {t["task_id"] for t in parsed.tasks if t["proj_id"] == project_id}
|
||||
|
||||
# Insert relationships where both tasks are in this project
|
||||
for rel in parsed.taskpreds:
|
||||
if (
|
||||
rel.get("proj_id") == project_id
|
||||
and rel["task_id"] in project_task_ids
|
||||
and rel["pred_task_id"] in project_task_ids
|
||||
):
|
||||
cur.execute(
|
||||
"""
|
||||
INSERT INTO relationships (
|
||||
task_pred_id, task_id, pred_task_id, pred_type, lag_hr_cnt
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
rel["task_pred_id"],
|
||||
rel["task_id"],
|
||||
rel["pred_task_id"],
|
||||
rel["pred_type"],
|
||||
rel["lag_hr_cnt"],
|
||||
),
|
||||
)
|
||||
|
||||
db.commit()
|
||||
|
||||
|
||||
def get_activity_count() -> int:
|
||||
"""Get the count of activities in the database."""
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities")
|
||||
return cur.fetchone()[0]
|
||||
|
||||
|
||||
def get_relationship_count() -> int:
|
||||
"""Get the count of relationships in the database."""
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM relationships")
|
||||
return cur.fetchone()[0]
|
||||
392
src/xer_mcp/db/queries.py
Normal file
392
src/xer_mcp/db/queries.py
Normal file
@@ -0,0 +1,392 @@
|
||||
"""Database query functions for XER data."""
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
def query_activities(
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
start_date: str | None = None,
|
||||
end_date: str | None = None,
|
||||
wbs_id: str | None = None,
|
||||
activity_type: str | None = None,
|
||||
) -> tuple[list[dict], int]:
|
||||
"""Query activities with pagination and filtering.
|
||||
|
||||
Args:
|
||||
limit: Maximum number of results to return
|
||||
offset: Number of results to skip
|
||||
start_date: Filter activities starting on or after this date (YYYY-MM-DD)
|
||||
end_date: Filter activities ending on or before this date (YYYY-MM-DD)
|
||||
wbs_id: Filter by WBS ID
|
||||
activity_type: Filter by task type (TT_Task, TT_Mile, etc.)
|
||||
|
||||
Returns:
|
||||
Tuple of (list of activity dicts, total count matching filters)
|
||||
"""
|
||||
# Build WHERE clause
|
||||
conditions = []
|
||||
params: list = []
|
||||
|
||||
if start_date:
|
||||
conditions.append("target_start_date >= ?")
|
||||
params.append(f"{start_date}T00:00:00")
|
||||
|
||||
if end_date:
|
||||
conditions.append("target_end_date <= ?")
|
||||
params.append(f"{end_date}T23:59:59")
|
||||
|
||||
if wbs_id:
|
||||
conditions.append("wbs_id = ?")
|
||||
params.append(wbs_id)
|
||||
|
||||
if activity_type:
|
||||
conditions.append("task_type = ?")
|
||||
params.append(activity_type)
|
||||
|
||||
where_clause = " AND ".join(conditions) if conditions else "1=1"
|
||||
|
||||
# Get total count
|
||||
with db.cursor() as cur:
|
||||
cur.execute(f"SELECT COUNT(*) FROM activities WHERE {where_clause}", params) # noqa: S608
|
||||
total = cur.fetchone()[0]
|
||||
|
||||
# Get paginated results
|
||||
query = f"""
|
||||
SELECT task_id, task_code, task_name, task_type,
|
||||
target_start_date, target_end_date, status_code,
|
||||
driving_path_flag, wbs_id, total_float_hr_cnt
|
||||
FROM activities
|
||||
WHERE {where_clause}
|
||||
ORDER BY target_start_date, task_code
|
||||
LIMIT ? OFFSET ?
|
||||
""" # noqa: S608
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query, [*params, limit, offset])
|
||||
rows = cur.fetchall()
|
||||
|
||||
activities = [
|
||||
{
|
||||
"task_id": row[0],
|
||||
"task_code": row[1],
|
||||
"task_name": row[2],
|
||||
"task_type": row[3],
|
||||
"target_start_date": row[4],
|
||||
"target_end_date": row[5],
|
||||
"status_code": row[6],
|
||||
"driving_path_flag": bool(row[7]),
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
|
||||
return activities, total
|
||||
|
||||
|
||||
def get_activity_by_id(activity_id: str) -> dict | None:
|
||||
"""Get a single activity by ID with full details.
|
||||
|
||||
Args:
|
||||
activity_id: The task_id to look up
|
||||
|
||||
Returns:
|
||||
Activity dict with all fields, or None if not found
|
||||
"""
|
||||
query = """
|
||||
SELECT a.task_id, a.task_code, a.task_name, a.task_type,
|
||||
a.wbs_id, w.wbs_name,
|
||||
a.target_start_date, a.target_end_date,
|
||||
a.act_start_date, a.act_end_date,
|
||||
a.total_float_hr_cnt, a.status_code, a.driving_path_flag
|
||||
FROM activities a
|
||||
LEFT JOIN wbs w ON a.wbs_id = w.wbs_id
|
||||
WHERE a.task_id = ?
|
||||
"""
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query, (activity_id,))
|
||||
row = cur.fetchone()
|
||||
|
||||
if row is None:
|
||||
return None
|
||||
|
||||
# Count predecessors and successors
|
||||
with db.cursor() as cur:
|
||||
cur.execute(
|
||||
"SELECT COUNT(*) FROM relationships WHERE task_id = ?",
|
||||
(activity_id,),
|
||||
)
|
||||
predecessor_count = cur.fetchone()[0]
|
||||
|
||||
cur.execute(
|
||||
"SELECT COUNT(*) FROM relationships WHERE pred_task_id = ?",
|
||||
(activity_id,),
|
||||
)
|
||||
successor_count = cur.fetchone()[0]
|
||||
|
||||
return {
|
||||
"task_id": row[0],
|
||||
"task_code": row[1],
|
||||
"task_name": row[2],
|
||||
"task_type": row[3],
|
||||
"wbs_id": row[4],
|
||||
"wbs_name": row[5],
|
||||
"target_start_date": row[6],
|
||||
"target_end_date": row[7],
|
||||
"act_start_date": row[8],
|
||||
"act_end_date": row[9],
|
||||
"total_float_hr_cnt": row[10],
|
||||
"status_code": row[11],
|
||||
"driving_path_flag": bool(row[12]),
|
||||
"predecessor_count": predecessor_count,
|
||||
"successor_count": successor_count,
|
||||
}
|
||||
|
||||
|
||||
def query_relationships(
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
) -> tuple[list[dict], int]:
|
||||
"""Query relationships with pagination.
|
||||
|
||||
Args:
|
||||
limit: Maximum number of results to return
|
||||
offset: Number of results to skip
|
||||
|
||||
Returns:
|
||||
Tuple of (list of relationship dicts, total count)
|
||||
"""
|
||||
# Get total count
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM relationships")
|
||||
total = cur.fetchone()[0]
|
||||
|
||||
# Get paginated results with activity names
|
||||
query = """
|
||||
SELECT r.task_pred_id, r.task_id, a1.task_name,
|
||||
r.pred_task_id, a2.task_name,
|
||||
r.pred_type, r.lag_hr_cnt
|
||||
FROM relationships r
|
||||
LEFT JOIN activities a1 ON r.task_id = a1.task_id
|
||||
LEFT JOIN activities a2 ON r.pred_task_id = a2.task_id
|
||||
ORDER BY r.task_pred_id
|
||||
LIMIT ? OFFSET ?
|
||||
"""
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query, (limit, offset))
|
||||
rows = cur.fetchall()
|
||||
|
||||
# Convert pred_type from internal format (PR_FS) to API format (FS)
|
||||
def format_pred_type(pred_type: str) -> str:
|
||||
if pred_type.startswith("PR_"):
|
||||
return pred_type[3:]
|
||||
return pred_type
|
||||
|
||||
relationships = [
|
||||
{
|
||||
"task_pred_id": row[0],
|
||||
"task_id": row[1],
|
||||
"task_name": row[2],
|
||||
"pred_task_id": row[3],
|
||||
"pred_task_name": row[4],
|
||||
"pred_type": format_pred_type(row[5]),
|
||||
"lag_hr_cnt": row[6],
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
|
||||
return relationships, total
|
||||
|
||||
|
||||
def get_predecessors(activity_id: str) -> list[dict]:
|
||||
"""Get predecessor activities for a given activity.
|
||||
|
||||
Args:
|
||||
activity_id: The task_id to find predecessors for
|
||||
|
||||
Returns:
|
||||
List of predecessor activity dicts with relationship info
|
||||
"""
|
||||
query = """
|
||||
SELECT a.task_id, a.task_code, a.task_name,
|
||||
r.pred_type, r.lag_hr_cnt
|
||||
FROM relationships r
|
||||
JOIN activities a ON r.pred_task_id = a.task_id
|
||||
WHERE r.task_id = ?
|
||||
ORDER BY a.task_code
|
||||
"""
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query, (activity_id,))
|
||||
rows = cur.fetchall()
|
||||
|
||||
def format_pred_type(pred_type: str) -> str:
|
||||
if pred_type.startswith("PR_"):
|
||||
return pred_type[3:]
|
||||
return pred_type
|
||||
|
||||
return [
|
||||
{
|
||||
"task_id": row[0],
|
||||
"task_code": row[1],
|
||||
"task_name": row[2],
|
||||
"relationship_type": format_pred_type(row[3]),
|
||||
"lag_hr_cnt": row[4],
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
|
||||
|
||||
def get_successors(activity_id: str) -> list[dict]:
|
||||
"""Get successor activities for a given activity.
|
||||
|
||||
Args:
|
||||
activity_id: The task_id to find successors for
|
||||
|
||||
Returns:
|
||||
List of successor activity dicts with relationship info
|
||||
"""
|
||||
query = """
|
||||
SELECT a.task_id, a.task_code, a.task_name,
|
||||
r.pred_type, r.lag_hr_cnt
|
||||
FROM relationships r
|
||||
JOIN activities a ON r.task_id = a.task_id
|
||||
WHERE r.pred_task_id = ?
|
||||
ORDER BY a.task_code
|
||||
"""
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query, (activity_id,))
|
||||
rows = cur.fetchall()
|
||||
|
||||
def format_pred_type(pred_type: str) -> str:
|
||||
if pred_type.startswith("PR_"):
|
||||
return pred_type[3:]
|
||||
return pred_type
|
||||
|
||||
return [
|
||||
{
|
||||
"task_id": row[0],
|
||||
"task_code": row[1],
|
||||
"task_name": row[2],
|
||||
"relationship_type": format_pred_type(row[3]),
|
||||
"lag_hr_cnt": row[4],
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
|
||||
|
||||
def get_project_summary(project_id: str) -> dict | None:
|
||||
"""Get project summary information.
|
||||
|
||||
Args:
|
||||
project_id: The project ID to get summary for
|
||||
|
||||
Returns:
|
||||
Dictionary with project summary or None if not found
|
||||
"""
|
||||
# Get project info
|
||||
with db.cursor() as cur:
|
||||
cur.execute(
|
||||
"""
|
||||
SELECT proj_id, proj_short_name, plan_start_date, plan_end_date
|
||||
FROM projects
|
||||
WHERE proj_id = ?
|
||||
""",
|
||||
(project_id,),
|
||||
)
|
||||
project_row = cur.fetchone()
|
||||
|
||||
if project_row is None:
|
||||
return None
|
||||
|
||||
# Get activity count
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities")
|
||||
activity_count = cur.fetchone()[0]
|
||||
|
||||
# Get milestone count
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities WHERE task_type = 'TT_Mile'")
|
||||
milestone_count = cur.fetchone()[0]
|
||||
|
||||
# Get critical activity count
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities WHERE driving_path_flag = 1")
|
||||
critical_count = cur.fetchone()[0]
|
||||
|
||||
return {
|
||||
"project_id": project_row[0],
|
||||
"project_name": project_row[1],
|
||||
"plan_start_date": project_row[2],
|
||||
"plan_end_date": project_row[3],
|
||||
"activity_count": activity_count,
|
||||
"milestone_count": milestone_count,
|
||||
"critical_activity_count": critical_count,
|
||||
}
|
||||
|
||||
|
||||
def query_milestones() -> list[dict]:
|
||||
"""Query all milestone activities.
|
||||
|
||||
Returns:
|
||||
List of milestone activity dicts
|
||||
"""
|
||||
query = """
|
||||
SELECT task_id, task_code, task_name,
|
||||
target_start_date, target_end_date, status_code
|
||||
FROM activities
|
||||
WHERE task_type = 'TT_Mile'
|
||||
ORDER BY target_start_date, task_code
|
||||
"""
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query)
|
||||
rows = cur.fetchall()
|
||||
|
||||
return [
|
||||
{
|
||||
"task_id": row[0],
|
||||
"task_code": row[1],
|
||||
"task_name": row[2],
|
||||
"target_start_date": row[3],
|
||||
"target_end_date": row[4],
|
||||
"status_code": row[5],
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
|
||||
|
||||
def query_critical_path() -> list[dict]:
|
||||
"""Query all activities on the critical path.
|
||||
|
||||
Returns:
|
||||
List of critical path activity dicts ordered by start date
|
||||
"""
|
||||
query = """
|
||||
SELECT task_id, task_code, task_name, task_type,
|
||||
target_start_date, target_end_date,
|
||||
total_float_hr_cnt, status_code
|
||||
FROM activities
|
||||
WHERE driving_path_flag = 1
|
||||
ORDER BY target_start_date, task_code
|
||||
"""
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute(query)
|
||||
rows = cur.fetchall()
|
||||
|
||||
return [
|
||||
{
|
||||
"task_id": row[0],
|
||||
"task_code": row[1],
|
||||
"task_name": row[2],
|
||||
"task_type": row[3],
|
||||
"target_start_date": row[4],
|
||||
"target_end_date": row[5],
|
||||
"total_float_hr_cnt": row[6],
|
||||
"status_code": row[7],
|
||||
}
|
||||
for row in rows
|
||||
]
|
||||
77
src/xer_mcp/db/schema.py
Normal file
77
src/xer_mcp/db/schema.py
Normal file
@@ -0,0 +1,77 @@
|
||||
"""SQLite database schema for XER MCP Server."""
|
||||
|
||||
SCHEMA_SQL = """
|
||||
-- Projects
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
proj_id TEXT PRIMARY KEY,
|
||||
proj_short_name TEXT NOT NULL,
|
||||
plan_start_date TEXT,
|
||||
plan_end_date TEXT,
|
||||
loaded_at TEXT NOT NULL DEFAULT (datetime('now'))
|
||||
);
|
||||
|
||||
-- Activities
|
||||
CREATE TABLE IF NOT EXISTS activities (
|
||||
task_id TEXT PRIMARY KEY,
|
||||
proj_id TEXT NOT NULL,
|
||||
wbs_id TEXT,
|
||||
task_code TEXT NOT NULL,
|
||||
task_name TEXT NOT NULL,
|
||||
task_type TEXT NOT NULL,
|
||||
target_start_date TEXT,
|
||||
target_end_date TEXT,
|
||||
act_start_date TEXT,
|
||||
act_end_date TEXT,
|
||||
total_float_hr_cnt REAL,
|
||||
driving_path_flag INTEGER DEFAULT 0,
|
||||
status_code TEXT,
|
||||
FOREIGN KEY (proj_id) REFERENCES projects(proj_id)
|
||||
);
|
||||
|
||||
-- Relationships
|
||||
CREATE TABLE IF NOT EXISTS relationships (
|
||||
task_pred_id TEXT PRIMARY KEY,
|
||||
task_id TEXT NOT NULL,
|
||||
pred_task_id TEXT NOT NULL,
|
||||
pred_type TEXT NOT NULL,
|
||||
lag_hr_cnt REAL DEFAULT 0,
|
||||
FOREIGN KEY (task_id) REFERENCES activities(task_id),
|
||||
FOREIGN KEY (pred_task_id) REFERENCES activities(task_id)
|
||||
);
|
||||
|
||||
-- WBS (Work Breakdown Structure)
|
||||
CREATE TABLE IF NOT EXISTS wbs (
|
||||
wbs_id TEXT PRIMARY KEY,
|
||||
proj_id TEXT NOT NULL,
|
||||
parent_wbs_id TEXT,
|
||||
wbs_short_name TEXT NOT NULL,
|
||||
wbs_name TEXT,
|
||||
FOREIGN KEY (proj_id) REFERENCES projects(proj_id),
|
||||
FOREIGN KEY (parent_wbs_id) REFERENCES wbs(wbs_id)
|
||||
);
|
||||
|
||||
-- Calendars (internal use only)
|
||||
CREATE TABLE IF NOT EXISTS calendars (
|
||||
clndr_id TEXT PRIMARY KEY,
|
||||
clndr_name TEXT NOT NULL,
|
||||
day_hr_cnt REAL,
|
||||
week_hr_cnt REAL
|
||||
);
|
||||
|
||||
-- Indexes for performance
|
||||
CREATE INDEX IF NOT EXISTS idx_activities_proj ON activities(proj_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_activities_wbs ON activities(wbs_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_activities_type ON activities(task_type);
|
||||
CREATE INDEX IF NOT EXISTS idx_activities_critical ON activities(driving_path_flag)
|
||||
WHERE driving_path_flag = 1;
|
||||
CREATE INDEX IF NOT EXISTS idx_activities_dates ON activities(target_start_date, target_end_date);
|
||||
CREATE INDEX IF NOT EXISTS idx_relationships_task ON relationships(task_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_relationships_pred ON relationships(pred_task_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_wbs_parent ON wbs(parent_wbs_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_wbs_proj ON wbs(proj_id);
|
||||
"""
|
||||
|
||||
|
||||
def get_schema() -> str:
|
||||
"""Return the complete SQLite schema."""
|
||||
return SCHEMA_SQL
|
||||
58
src/xer_mcp/errors.py
Normal file
58
src/xer_mcp/errors.py
Normal file
@@ -0,0 +1,58 @@
|
||||
"""Error types for XER MCP Server."""
|
||||
|
||||
|
||||
class XerMcpError(Exception):
|
||||
"""Base exception for XER MCP Server."""
|
||||
|
||||
def __init__(self, code: str, message: str) -> None:
|
||||
self.code = code
|
||||
self.message = message
|
||||
super().__init__(f"{code}: {message}")
|
||||
|
||||
|
||||
class FileNotFoundError(XerMcpError):
|
||||
"""Raised when the specified XER file does not exist."""
|
||||
|
||||
def __init__(self, file_path: str) -> None:
|
||||
super().__init__(
|
||||
"FILE_NOT_FOUND",
|
||||
f"XER file not found: {file_path}",
|
||||
)
|
||||
|
||||
|
||||
class ParseError(XerMcpError):
|
||||
"""Raised when the XER file cannot be parsed."""
|
||||
|
||||
def __init__(self, message: str) -> None:
|
||||
super().__init__("PARSE_ERROR", message)
|
||||
|
||||
|
||||
class NoFileLoadedError(XerMcpError):
|
||||
"""Raised when a query is attempted before loading an XER file."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
"NO_FILE_LOADED",
|
||||
"No XER file is loaded. Use the load_xer tool first.",
|
||||
)
|
||||
|
||||
|
||||
class ProjectSelectionRequiredError(XerMcpError):
|
||||
"""Raised when a multi-project file requires explicit project selection."""
|
||||
|
||||
def __init__(self, available_projects: list[dict]) -> None:
|
||||
self.available_projects = available_projects
|
||||
super().__init__(
|
||||
"PROJECT_SELECTION_REQUIRED",
|
||||
"Multiple projects found. Please specify project_id.",
|
||||
)
|
||||
|
||||
|
||||
class ActivityNotFoundError(XerMcpError):
|
||||
"""Raised when the specified activity does not exist."""
|
||||
|
||||
def __init__(self, activity_id: str) -> None:
|
||||
super().__init__(
|
||||
"ACTIVITY_NOT_FOUND",
|
||||
f"Activity not found: {activity_id}",
|
||||
)
|
||||
17
src/xer_mcp/models/__init__.py
Normal file
17
src/xer_mcp/models/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""Data models for XER MCP Server."""
|
||||
|
||||
from xer_mcp.models.activity import Activity
|
||||
from xer_mcp.models.calendar import Calendar
|
||||
from xer_mcp.models.pagination import PaginationMetadata
|
||||
from xer_mcp.models.project import Project
|
||||
from xer_mcp.models.relationship import Relationship
|
||||
from xer_mcp.models.wbs import WBS
|
||||
|
||||
__all__ = [
|
||||
"Activity",
|
||||
"Calendar",
|
||||
"PaginationMetadata",
|
||||
"Project",
|
||||
"Relationship",
|
||||
"WBS",
|
||||
]
|
||||
23
src/xer_mcp/models/activity.py
Normal file
23
src/xer_mcp/models/activity.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Activity data model."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class Activity:
|
||||
"""A unit of work in the schedule."""
|
||||
|
||||
task_id: str
|
||||
proj_id: str
|
||||
task_code: str
|
||||
task_name: str
|
||||
task_type: str
|
||||
wbs_id: str | None = None
|
||||
target_start_date: datetime | None = None
|
||||
target_end_date: datetime | None = None
|
||||
act_start_date: datetime | None = None
|
||||
act_end_date: datetime | None = None
|
||||
total_float_hr_cnt: float | None = None
|
||||
driving_path_flag: bool = False
|
||||
status_code: str | None = None
|
||||
13
src/xer_mcp/models/calendar.py
Normal file
13
src/xer_mcp/models/calendar.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""Calendar data model (internal use only)."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class Calendar:
|
||||
"""Work schedule definition. Not exposed via MCP tools."""
|
||||
|
||||
clndr_id: str
|
||||
clndr_name: str
|
||||
day_hr_cnt: float | None = None
|
||||
week_hr_cnt: float | None = None
|
||||
13
src/xer_mcp/models/pagination.py
Normal file
13
src/xer_mcp/models/pagination.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""Pagination metadata model."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class PaginationMetadata:
|
||||
"""Response wrapper for paginated queries."""
|
||||
|
||||
total_count: int
|
||||
offset: int
|
||||
limit: int
|
||||
has_more: bool
|
||||
15
src/xer_mcp/models/project.py
Normal file
15
src/xer_mcp/models/project.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Project data model."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
@dataclass
|
||||
class Project:
|
||||
"""Top-level container representing a P6 project."""
|
||||
|
||||
proj_id: str
|
||||
proj_short_name: str
|
||||
plan_start_date: datetime | None = None
|
||||
plan_end_date: datetime | None = None
|
||||
loaded_at: datetime | None = None
|
||||
14
src/xer_mcp/models/relationship.py
Normal file
14
src/xer_mcp/models/relationship.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Relationship data model."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class Relationship:
|
||||
"""A dependency link between two activities."""
|
||||
|
||||
task_pred_id: str
|
||||
task_id: str
|
||||
pred_task_id: str
|
||||
pred_type: str
|
||||
lag_hr_cnt: float = 0.0
|
||||
14
src/xer_mcp/models/wbs.py
Normal file
14
src/xer_mcp/models/wbs.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Work Breakdown Structure (WBS) data model."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class WBS:
|
||||
"""Hierarchical organization of activities."""
|
||||
|
||||
wbs_id: str
|
||||
proj_id: str
|
||||
wbs_short_name: str
|
||||
parent_wbs_id: str | None = None
|
||||
wbs_name: str | None = None
|
||||
1
src/xer_mcp/parser/__init__.py
Normal file
1
src/xer_mcp/parser/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""XER file parser module."""
|
||||
27
src/xer_mcp/parser/table_handlers/__init__.py
Normal file
27
src/xer_mcp/parser/table_handlers/__init__.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""XER table handlers module."""
|
||||
|
||||
from xer_mcp.parser.table_handlers.base import TableHandler
|
||||
from xer_mcp.parser.table_handlers.calendar import CalendarHandler
|
||||
from xer_mcp.parser.table_handlers.project import ProjectHandler
|
||||
from xer_mcp.parser.table_handlers.projwbs import ProjwbsHandler
|
||||
from xer_mcp.parser.table_handlers.task import TaskHandler
|
||||
from xer_mcp.parser.table_handlers.taskpred import TaskpredHandler
|
||||
|
||||
# Registry mapping table names to handlers
|
||||
TABLE_HANDLERS: dict[str, type[TableHandler]] = {
|
||||
"PROJECT": ProjectHandler,
|
||||
"TASK": TaskHandler,
|
||||
"TASKPRED": TaskpredHandler,
|
||||
"PROJWBS": ProjwbsHandler,
|
||||
"CALENDAR": CalendarHandler,
|
||||
}
|
||||
|
||||
__all__ = [
|
||||
"CalendarHandler",
|
||||
"ProjectHandler",
|
||||
"ProjwbsHandler",
|
||||
"TABLE_HANDLERS",
|
||||
"TableHandler",
|
||||
"TaskHandler",
|
||||
"TaskpredHandler",
|
||||
]
|
||||
30
src/xer_mcp/parser/table_handlers/base.py
Normal file
30
src/xer_mcp/parser/table_handlers/base.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""Base class for XER table handlers."""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class TableHandler(ABC):
|
||||
"""Abstract base class for XER table handlers.
|
||||
|
||||
Each handler is responsible for parsing a specific table type
|
||||
from the XER file and returning structured data.
|
||||
"""
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def table_name(self) -> str:
|
||||
"""Return the XER table name this handler processes (e.g., 'PROJECT', 'TASK')."""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def parse_row(self, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a single row of data from the XER file.
|
||||
|
||||
Args:
|
||||
fields: List of column names from the %F line
|
||||
values: List of values from the %R line
|
||||
|
||||
Returns:
|
||||
Dictionary of parsed data, or None if the row should be skipped
|
||||
"""
|
||||
...
|
||||
32
src/xer_mcp/parser/table_handlers/calendar.py
Normal file
32
src/xer_mcp/parser/table_handlers/calendar.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""CALENDAR table handler."""
|
||||
|
||||
from xer_mcp.parser.table_handlers.base import TableHandler
|
||||
|
||||
|
||||
class CalendarHandler(TableHandler):
|
||||
"""Handler for CALENDAR table in XER files."""
|
||||
|
||||
@property
|
||||
def table_name(self) -> str:
|
||||
return "CALENDAR"
|
||||
|
||||
def parse_row(self, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a CALENDAR row."""
|
||||
if len(values) < len(fields):
|
||||
values = values + [""] * (len(fields) - len(values))
|
||||
|
||||
data = dict(zip(fields, values, strict=False))
|
||||
|
||||
# Parse numeric fields
|
||||
day_hr_str = data.get("day_hr_cnt", "")
|
||||
day_hr = float(day_hr_str) if day_hr_str else None
|
||||
|
||||
week_hr_str = data.get("week_hr_cnt", "")
|
||||
week_hr = float(week_hr_str) if week_hr_str else None
|
||||
|
||||
return {
|
||||
"clndr_id": data.get("clndr_id", ""),
|
||||
"clndr_name": data.get("clndr_name", ""),
|
||||
"day_hr_cnt": day_hr,
|
||||
"week_hr_cnt": week_hr,
|
||||
}
|
||||
38
src/xer_mcp/parser/table_handlers/project.py
Normal file
38
src/xer_mcp/parser/table_handlers/project.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""PROJECT table handler."""
|
||||
|
||||
from xer_mcp.parser.table_handlers.base import TableHandler
|
||||
|
||||
|
||||
def convert_date(date_str: str | None) -> str | None:
|
||||
"""Convert XER date format to ISO8601.
|
||||
|
||||
XER format: "YYYY-MM-DD HH:MM"
|
||||
ISO8601 format: "YYYY-MM-DDTHH:MM:SS"
|
||||
"""
|
||||
if not date_str or date_str.strip() == "":
|
||||
return None
|
||||
# Replace space with T and add seconds
|
||||
return date_str.replace(" ", "T") + ":00"
|
||||
|
||||
|
||||
class ProjectHandler(TableHandler):
|
||||
"""Handler for PROJECT table in XER files."""
|
||||
|
||||
@property
|
||||
def table_name(self) -> str:
|
||||
return "PROJECT"
|
||||
|
||||
def parse_row(self, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a PROJECT row."""
|
||||
if len(values) < len(fields):
|
||||
# Pad with empty strings if needed
|
||||
values = values + [""] * (len(fields) - len(values))
|
||||
|
||||
data = dict(zip(fields, values, strict=False))
|
||||
|
||||
return {
|
||||
"proj_id": data.get("proj_id", ""),
|
||||
"proj_short_name": data.get("proj_short_name", ""),
|
||||
"plan_start_date": convert_date(data.get("plan_start_date")),
|
||||
"plan_end_date": convert_date(data.get("plan_end_date")),
|
||||
}
|
||||
26
src/xer_mcp/parser/table_handlers/projwbs.py
Normal file
26
src/xer_mcp/parser/table_handlers/projwbs.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""PROJWBS table handler."""
|
||||
|
||||
from xer_mcp.parser.table_handlers.base import TableHandler
|
||||
|
||||
|
||||
class ProjwbsHandler(TableHandler):
|
||||
"""Handler for PROJWBS (WBS) table in XER files."""
|
||||
|
||||
@property
|
||||
def table_name(self) -> str:
|
||||
return "PROJWBS"
|
||||
|
||||
def parse_row(self, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a PROJWBS row."""
|
||||
if len(values) < len(fields):
|
||||
values = values + [""] * (len(fields) - len(values))
|
||||
|
||||
data = dict(zip(fields, values, strict=False))
|
||||
|
||||
return {
|
||||
"wbs_id": data.get("wbs_id", ""),
|
||||
"proj_id": data.get("proj_id", ""),
|
||||
"parent_wbs_id": data.get("parent_wbs_id", ""),
|
||||
"wbs_short_name": data.get("wbs_short_name", ""),
|
||||
"wbs_name": data.get("wbs_name") or None,
|
||||
}
|
||||
43
src/xer_mcp/parser/table_handlers/task.py
Normal file
43
src/xer_mcp/parser/table_handlers/task.py
Normal file
@@ -0,0 +1,43 @@
|
||||
"""TASK table handler."""
|
||||
|
||||
from xer_mcp.parser.table_handlers.base import TableHandler
|
||||
from xer_mcp.parser.table_handlers.project import convert_date
|
||||
|
||||
|
||||
class TaskHandler(TableHandler):
|
||||
"""Handler for TASK table in XER files."""
|
||||
|
||||
@property
|
||||
def table_name(self) -> str:
|
||||
return "TASK"
|
||||
|
||||
def parse_row(self, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a TASK row."""
|
||||
if len(values) < len(fields):
|
||||
values = values + [""] * (len(fields) - len(values))
|
||||
|
||||
data = dict(zip(fields, values, strict=False))
|
||||
|
||||
# Parse driving_path_flag (Y/N -> bool)
|
||||
driving_flag = data.get("driving_path_flag", "N")
|
||||
driving_path = driving_flag.upper() == "Y" if driving_flag else False
|
||||
|
||||
# Parse total_float_hr_cnt
|
||||
float_str = data.get("total_float_hr_cnt", "")
|
||||
total_float = float(float_str) if float_str else None
|
||||
|
||||
return {
|
||||
"task_id": data.get("task_id", ""),
|
||||
"proj_id": data.get("proj_id", ""),
|
||||
"wbs_id": data.get("wbs_id") or None,
|
||||
"task_code": data.get("task_code", ""),
|
||||
"task_name": data.get("task_name", ""),
|
||||
"task_type": data.get("task_type", ""),
|
||||
"status_code": data.get("status_code") or None,
|
||||
"target_start_date": convert_date(data.get("target_start_date")),
|
||||
"target_end_date": convert_date(data.get("target_end_date")),
|
||||
"act_start_date": convert_date(data.get("act_start_date")),
|
||||
"act_end_date": convert_date(data.get("act_end_date")),
|
||||
"total_float_hr_cnt": total_float,
|
||||
"driving_path_flag": driving_path,
|
||||
}
|
||||
31
src/xer_mcp/parser/table_handlers/taskpred.py
Normal file
31
src/xer_mcp/parser/table_handlers/taskpred.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""TASKPRED table handler."""
|
||||
|
||||
from xer_mcp.parser.table_handlers.base import TableHandler
|
||||
|
||||
|
||||
class TaskpredHandler(TableHandler):
|
||||
"""Handler for TASKPRED (relationships) table in XER files."""
|
||||
|
||||
@property
|
||||
def table_name(self) -> str:
|
||||
return "TASKPRED"
|
||||
|
||||
def parse_row(self, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a TASKPRED row."""
|
||||
if len(values) < len(fields):
|
||||
values = values + [""] * (len(fields) - len(values))
|
||||
|
||||
data = dict(zip(fields, values, strict=False))
|
||||
|
||||
# Parse lag_hr_cnt
|
||||
lag_str = data.get("lag_hr_cnt", "0")
|
||||
lag_hr = float(lag_str) if lag_str else 0.0
|
||||
|
||||
return {
|
||||
"task_pred_id": data.get("task_pred_id", ""),
|
||||
"task_id": data.get("task_id", ""),
|
||||
"pred_task_id": data.get("pred_task_id", ""),
|
||||
"proj_id": data.get("proj_id", ""),
|
||||
"pred_type": data.get("pred_type", ""),
|
||||
"lag_hr_cnt": lag_hr,
|
||||
}
|
||||
127
src/xer_mcp/parser/xer_parser.py
Normal file
127
src/xer_mcp/parser/xer_parser.py
Normal file
@@ -0,0 +1,127 @@
|
||||
"""XER file parser."""
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
|
||||
from xer_mcp.errors import FileNotFoundError, ParseError
|
||||
from xer_mcp.parser.table_handlers import TABLE_HANDLERS
|
||||
|
||||
|
||||
@dataclass
|
||||
class ParsedXer:
|
||||
"""Container for parsed XER data."""
|
||||
|
||||
projects: list[dict] = field(default_factory=list)
|
||||
tasks: list[dict] = field(default_factory=list)
|
||||
taskpreds: list[dict] = field(default_factory=list)
|
||||
projwbs: list[dict] = field(default_factory=list)
|
||||
calendars: list[dict] = field(default_factory=list)
|
||||
|
||||
|
||||
class XerParser:
|
||||
"""Parser for Primavera P6 XER files.
|
||||
|
||||
XER files are tab-delimited with the following structure:
|
||||
- ERMHDR line: header with version info
|
||||
- %T lines: table name declarations
|
||||
- %F lines: field (column) names
|
||||
- %R lines: data rows
|
||||
"""
|
||||
|
||||
def parse(self, file_path: Path | str) -> ParsedXer:
|
||||
"""Parse an XER file and return structured data.
|
||||
|
||||
Args:
|
||||
file_path: Path to the XER file
|
||||
|
||||
Returns:
|
||||
ParsedXer containing all parsed tables
|
||||
|
||||
Raises:
|
||||
FileNotFoundError: If file doesn't exist
|
||||
ParseError: If file is invalid or cannot be parsed
|
||||
"""
|
||||
path = Path(file_path)
|
||||
if not path.exists():
|
||||
raise FileNotFoundError(str(path))
|
||||
|
||||
try:
|
||||
content = path.read_text(encoding="utf-8", errors="replace")
|
||||
except OSError as e:
|
||||
raise ParseError(f"Cannot read file: {e}") from e
|
||||
|
||||
return self._parse_content(content)
|
||||
|
||||
def _parse_content(self, content: str) -> ParsedXer:
|
||||
"""Parse XER content string."""
|
||||
lines = content.split("\n")
|
||||
if not lines:
|
||||
raise ParseError("Empty file")
|
||||
|
||||
# Check for ERMHDR line
|
||||
first_line = lines[0].strip()
|
||||
if not first_line.startswith("ERMHDR"):
|
||||
raise ParseError("Invalid XER file: missing ERMHDR header")
|
||||
|
||||
result = ParsedXer()
|
||||
current_table: str | None = None
|
||||
current_fields: list[str] = []
|
||||
|
||||
for line in lines[1:]:
|
||||
line = line.rstrip("\r\n")
|
||||
if not line:
|
||||
continue
|
||||
|
||||
parts = line.split("\t")
|
||||
if not parts:
|
||||
continue
|
||||
|
||||
marker = parts[0]
|
||||
|
||||
if marker == "%T":
|
||||
# Table declaration
|
||||
if len(parts) < 2:
|
||||
continue
|
||||
current_table = parts[1]
|
||||
current_fields = []
|
||||
|
||||
elif marker == "%F":
|
||||
# Field names
|
||||
current_fields = parts[1:]
|
||||
|
||||
elif marker == "%R":
|
||||
# Data row
|
||||
if current_table and current_fields:
|
||||
values = parts[1:]
|
||||
row_data = self._parse_row(current_table, current_fields, values)
|
||||
if row_data:
|
||||
self._add_to_result(result, current_table, row_data)
|
||||
|
||||
# Validate we got at least some data
|
||||
if not result.projects:
|
||||
raise ParseError("No PROJECT data found in XER file")
|
||||
|
||||
return result
|
||||
|
||||
def _parse_row(self, table_name: str, fields: list[str], values: list[str]) -> dict | None:
|
||||
"""Parse a single data row using the appropriate handler."""
|
||||
handler_class = TABLE_HANDLERS.get(table_name)
|
||||
if handler_class is None:
|
||||
# Unknown table, skip
|
||||
return None
|
||||
|
||||
handler = handler_class()
|
||||
return handler.parse_row(fields, values)
|
||||
|
||||
def _add_to_result(self, result: ParsedXer, table_name: str, row_data: dict) -> None:
|
||||
"""Add parsed row to the appropriate result list."""
|
||||
if table_name == "PROJECT":
|
||||
result.projects.append(row_data)
|
||||
elif table_name == "TASK":
|
||||
result.tasks.append(row_data)
|
||||
elif table_name == "TASKPRED":
|
||||
result.taskpreds.append(row_data)
|
||||
elif table_name == "PROJWBS":
|
||||
result.projwbs.append(row_data)
|
||||
elif table_name == "CALENDAR":
|
||||
result.calendars.append(row_data)
|
||||
273
src/xer_mcp/server.py
Normal file
273
src/xer_mcp/server.py
Normal file
@@ -0,0 +1,273 @@
|
||||
"""MCP Server for XER file analysis."""
|
||||
|
||||
from mcp.server import Server
|
||||
from mcp.server.stdio import stdio_server
|
||||
from mcp.types import TextContent, Tool
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
# Create MCP server instance
|
||||
server = Server("xer-mcp")
|
||||
|
||||
# Server state
|
||||
_file_loaded: bool = False
|
||||
_current_project_id: str | None = None
|
||||
|
||||
|
||||
def is_file_loaded() -> bool:
|
||||
"""Check if an XER file has been loaded."""
|
||||
return _file_loaded
|
||||
|
||||
|
||||
def get_current_project_id() -> str | None:
|
||||
"""Get the currently selected project ID."""
|
||||
return _current_project_id
|
||||
|
||||
|
||||
def set_file_loaded(loaded: bool, project_id: str | None = None) -> None:
|
||||
"""Set the file loaded state."""
|
||||
global _file_loaded, _current_project_id
|
||||
_file_loaded = loaded
|
||||
_current_project_id = project_id
|
||||
|
||||
|
||||
@server.list_tools()
|
||||
async def list_tools() -> list[Tool]:
|
||||
"""List available MCP tools."""
|
||||
return [
|
||||
Tool(
|
||||
name="load_xer",
|
||||
description="Load a Primavera P6 XER file and parse its schedule data. "
|
||||
"For multi-project files, specify project_id to select a project.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file_path": {
|
||||
"type": "string",
|
||||
"description": "Absolute path to the XER file",
|
||||
},
|
||||
"project_id": {
|
||||
"type": "string",
|
||||
"description": "Project ID to select (required for multi-project files)",
|
||||
},
|
||||
},
|
||||
"required": ["file_path"],
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="list_activities",
|
||||
description="List activities from the loaded XER file with optional filtering and pagination.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"start_date": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"description": "Filter activities starting on or after this date (YYYY-MM-DD)",
|
||||
},
|
||||
"end_date": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"description": "Filter activities ending on or before this date (YYYY-MM-DD)",
|
||||
},
|
||||
"wbs_id": {
|
||||
"type": "string",
|
||||
"description": "Filter by WBS element ID",
|
||||
},
|
||||
"activity_type": {
|
||||
"type": "string",
|
||||
"enum": ["TT_Task", "TT_Mile", "TT_LOE", "TT_WBS", "TT_Rsrc"],
|
||||
"description": "Filter by activity type",
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"minimum": 1,
|
||||
"maximum": 1000,
|
||||
"description": "Maximum number of activities to return",
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"minimum": 0,
|
||||
"description": "Number of activities to skip",
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="get_activity",
|
||||
description="Get detailed information for a specific activity by ID.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": {
|
||||
"type": "string",
|
||||
"description": "The task_id of the activity",
|
||||
},
|
||||
},
|
||||
"required": ["activity_id"],
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="list_relationships",
|
||||
description="List all activity relationships (dependencies) with pagination.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"minimum": 1,
|
||||
"maximum": 1000,
|
||||
"description": "Maximum number of relationships to return",
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"default": 0,
|
||||
"minimum": 0,
|
||||
"description": "Number of relationships to skip",
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="get_predecessors",
|
||||
description="Get all predecessor activities for a given activity.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": {
|
||||
"type": "string",
|
||||
"description": "The task_id of the activity",
|
||||
},
|
||||
},
|
||||
"required": ["activity_id"],
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="get_successors",
|
||||
description="Get all successor activities for a given activity.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"activity_id": {
|
||||
"type": "string",
|
||||
"description": "The task_id of the activity",
|
||||
},
|
||||
},
|
||||
"required": ["activity_id"],
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="get_project_summary",
|
||||
description="Get a summary of the loaded project including dates and activity counts.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="list_milestones",
|
||||
description="List all milestone activities in the loaded project.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
},
|
||||
),
|
||||
Tool(
|
||||
name="get_critical_path",
|
||||
description="Get all activities on the critical path that determine project duration.",
|
||||
inputSchema={
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
},
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
@server.call_tool()
|
||||
async def call_tool(name: str, arguments: dict) -> list[TextContent]:
|
||||
"""Handle MCP tool calls."""
|
||||
import json
|
||||
|
||||
if name == "load_xer":
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(
|
||||
file_path=arguments["file_path"],
|
||||
project_id=arguments.get("project_id"),
|
||||
)
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "list_activities":
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
|
||||
result = await list_activities(
|
||||
start_date=arguments.get("start_date"),
|
||||
end_date=arguments.get("end_date"),
|
||||
wbs_id=arguments.get("wbs_id"),
|
||||
activity_type=arguments.get("activity_type"),
|
||||
limit=arguments.get("limit", 100),
|
||||
offset=arguments.get("offset", 0),
|
||||
)
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "get_activity":
|
||||
from xer_mcp.tools.get_activity import get_activity
|
||||
|
||||
result = await get_activity(activity_id=arguments["activity_id"])
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "list_relationships":
|
||||
from xer_mcp.tools.list_relationships import list_relationships
|
||||
|
||||
result = await list_relationships(
|
||||
limit=arguments.get("limit", 100),
|
||||
offset=arguments.get("offset", 0),
|
||||
)
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "get_predecessors":
|
||||
from xer_mcp.tools.get_predecessors import get_predecessors
|
||||
|
||||
result = await get_predecessors(activity_id=arguments["activity_id"])
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "get_successors":
|
||||
from xer_mcp.tools.get_successors import get_successors
|
||||
|
||||
result = await get_successors(activity_id=arguments["activity_id"])
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "get_project_summary":
|
||||
from xer_mcp.tools.get_project_summary import get_project_summary
|
||||
|
||||
result = await get_project_summary()
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "list_milestones":
|
||||
from xer_mcp.tools.list_milestones import list_milestones
|
||||
|
||||
result = await list_milestones()
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
if name == "get_critical_path":
|
||||
from xer_mcp.tools.get_critical_path import get_critical_path
|
||||
|
||||
result = await get_critical_path()
|
||||
return [TextContent(type="text", text=json.dumps(result, indent=2))]
|
||||
|
||||
raise ValueError(f"Unknown tool: {name}")
|
||||
|
||||
|
||||
async def run_server() -> None:
|
||||
"""Run the MCP server with stdio transport."""
|
||||
db.initialize()
|
||||
|
||||
async with stdio_server() as (read_stream, write_stream):
|
||||
await server.run(
|
||||
read_stream,
|
||||
write_stream,
|
||||
server.create_initialization_options(),
|
||||
)
|
||||
1
src/xer_mcp/tools/__init__.py
Normal file
1
src/xer_mcp/tools/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""MCP tools for XER file analysis."""
|
||||
34
src/xer_mcp/tools/get_activity.py
Normal file
34
src/xer_mcp/tools/get_activity.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""get_activity MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import get_activity_by_id
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def get_activity(activity_id: str) -> dict:
|
||||
"""Get detailed information for a specific activity by ID.
|
||||
|
||||
Args:
|
||||
activity_id: The task_id of the activity
|
||||
|
||||
Returns:
|
||||
Dictionary with complete activity details or error
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
activity = get_activity_by_id(activity_id)
|
||||
|
||||
if activity is None:
|
||||
return {
|
||||
"error": {
|
||||
"code": "ACTIVITY_NOT_FOUND",
|
||||
"message": f"Activity not found: {activity_id}",
|
||||
}
|
||||
}
|
||||
|
||||
return activity
|
||||
36
src/xer_mcp/tools/get_critical_path.py
Normal file
36
src/xer_mcp/tools/get_critical_path.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""get_critical_path MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import query_critical_path
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def get_critical_path() -> dict:
|
||||
"""Get all activities on the critical path.
|
||||
|
||||
Returns activities where driving_path_flag is set, ordered by target start date.
|
||||
The critical path determines the minimum project duration.
|
||||
|
||||
Returns:
|
||||
Dictionary with list of critical path activities, each containing:
|
||||
- task_id: Activity ID
|
||||
- task_code: Activity code
|
||||
- task_name: Activity name
|
||||
- task_type: Activity type (TT_Task, TT_Mile, etc.)
|
||||
- target_start_date: Target start date
|
||||
- target_end_date: Target end date
|
||||
- total_float_hr_cnt: Total float in hours
|
||||
- status_code: Activity status
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
critical_activities = query_critical_path()
|
||||
|
||||
return {
|
||||
"critical_activities": critical_activities,
|
||||
}
|
||||
29
src/xer_mcp/tools/get_predecessors.py
Normal file
29
src/xer_mcp/tools/get_predecessors.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""get_predecessors MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import get_predecessors as query_predecessors
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def get_predecessors(activity_id: str) -> dict:
|
||||
"""Get predecessor activities for a given activity.
|
||||
|
||||
Args:
|
||||
activity_id: The task_id to find predecessors for
|
||||
|
||||
Returns:
|
||||
Dictionary with activity_id and list of predecessor activities
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
predecessors = query_predecessors(activity_id)
|
||||
|
||||
return {
|
||||
"activity_id": activity_id,
|
||||
"predecessors": predecessors,
|
||||
}
|
||||
45
src/xer_mcp/tools/get_project_summary.py
Normal file
45
src/xer_mcp/tools/get_project_summary.py
Normal file
@@ -0,0 +1,45 @@
|
||||
"""get_project_summary MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import get_project_summary as query_project_summary
|
||||
from xer_mcp.server import get_current_project_id, is_file_loaded
|
||||
|
||||
|
||||
async def get_project_summary() -> dict:
|
||||
"""Get a summary of the loaded project.
|
||||
|
||||
Returns:
|
||||
Dictionary with project summary information including:
|
||||
- project_name: Name of the project
|
||||
- plan_start_date: Planned start date
|
||||
- plan_end_date: Planned end date
|
||||
- activity_count: Total number of activities
|
||||
- milestone_count: Number of milestone activities
|
||||
- critical_activity_count: Number of activities on critical path
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
project_id = get_current_project_id()
|
||||
if project_id is None:
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_PROJECT_SELECTED",
|
||||
"message": "No project is selected.",
|
||||
}
|
||||
}
|
||||
|
||||
summary = query_project_summary(project_id)
|
||||
if summary is None:
|
||||
return {
|
||||
"error": {
|
||||
"code": "PROJECT_NOT_FOUND",
|
||||
"message": f"Project with ID {project_id} not found.",
|
||||
}
|
||||
}
|
||||
|
||||
return summary
|
||||
29
src/xer_mcp/tools/get_successors.py
Normal file
29
src/xer_mcp/tools/get_successors.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""get_successors MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import get_successors as query_successors
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def get_successors(activity_id: str) -> dict:
|
||||
"""Get successor activities for a given activity.
|
||||
|
||||
Args:
|
||||
activity_id: The task_id to find successors for
|
||||
|
||||
Returns:
|
||||
Dictionary with activity_id and list of successor activities
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
successors = query_successors(activity_id)
|
||||
|
||||
return {
|
||||
"activity_id": activity_id,
|
||||
"successors": successors,
|
||||
}
|
||||
55
src/xer_mcp/tools/list_activities.py
Normal file
55
src/xer_mcp/tools/list_activities.py
Normal file
@@ -0,0 +1,55 @@
|
||||
"""list_activities MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import query_activities
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def list_activities(
|
||||
start_date: str | None = None,
|
||||
end_date: str | None = None,
|
||||
wbs_id: str | None = None,
|
||||
activity_type: str | None = None,
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
) -> dict:
|
||||
"""List activities from the loaded XER file with optional filtering.
|
||||
|
||||
Args:
|
||||
start_date: Filter activities starting on or after this date (YYYY-MM-DD)
|
||||
end_date: Filter activities ending on or before this date (YYYY-MM-DD)
|
||||
wbs_id: Filter by WBS element ID
|
||||
activity_type: Filter by activity type (TT_Task, TT_Mile, etc.)
|
||||
limit: Maximum number of activities to return (default 100)
|
||||
offset: Number of activities to skip (default 0)
|
||||
|
||||
Returns:
|
||||
Dictionary with activities list and pagination metadata
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
activities, total_count = query_activities(
|
||||
limit=limit,
|
||||
offset=offset,
|
||||
start_date=start_date,
|
||||
end_date=end_date,
|
||||
wbs_id=wbs_id,
|
||||
activity_type=activity_type,
|
||||
)
|
||||
|
||||
has_more = (offset + len(activities)) < total_count
|
||||
|
||||
return {
|
||||
"activities": activities,
|
||||
"pagination": {
|
||||
"total_count": total_count,
|
||||
"offset": offset,
|
||||
"limit": limit,
|
||||
"has_more": has_more,
|
||||
},
|
||||
}
|
||||
31
src/xer_mcp/tools/list_milestones.py
Normal file
31
src/xer_mcp/tools/list_milestones.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""list_milestones MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import query_milestones
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def list_milestones() -> dict:
|
||||
"""List all milestone activities in the loaded project.
|
||||
|
||||
Returns:
|
||||
Dictionary with list of milestones, each containing:
|
||||
- task_id: Activity ID
|
||||
- task_code: Activity code
|
||||
- task_name: Activity name
|
||||
- target_start_date: Target start date
|
||||
- target_end_date: Target end date
|
||||
- status_code: Activity status
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
milestones = query_milestones()
|
||||
|
||||
return {
|
||||
"milestones": milestones,
|
||||
}
|
||||
40
src/xer_mcp/tools/list_relationships.py
Normal file
40
src/xer_mcp/tools/list_relationships.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""list_relationships MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db.queries import query_relationships
|
||||
from xer_mcp.server import is_file_loaded
|
||||
|
||||
|
||||
async def list_relationships(
|
||||
limit: int = 100,
|
||||
offset: int = 0,
|
||||
) -> dict:
|
||||
"""List all relationships (dependencies) with pagination.
|
||||
|
||||
Args:
|
||||
limit: Maximum number of relationships to return (default 100)
|
||||
offset: Number of relationships to skip (default 0)
|
||||
|
||||
Returns:
|
||||
Dictionary with relationships list and pagination metadata
|
||||
"""
|
||||
if not is_file_loaded():
|
||||
return {
|
||||
"error": {
|
||||
"code": "NO_FILE_LOADED",
|
||||
"message": "No XER file is loaded. Use the load_xer tool first.",
|
||||
}
|
||||
}
|
||||
|
||||
relationships, total_count = query_relationships(limit=limit, offset=offset)
|
||||
|
||||
has_more = (offset + len(relationships)) < total_count
|
||||
|
||||
return {
|
||||
"relationships": relationships,
|
||||
"pagination": {
|
||||
"total_count": total_count,
|
||||
"offset": offset,
|
||||
"limit": limit,
|
||||
"has_more": has_more,
|
||||
},
|
||||
}
|
||||
86
src/xer_mcp/tools/load_xer.py
Normal file
86
src/xer_mcp/tools/load_xer.py
Normal file
@@ -0,0 +1,86 @@
|
||||
"""load_xer MCP tool implementation."""
|
||||
|
||||
from xer_mcp.db import db
|
||||
from xer_mcp.db.loader import get_activity_count, get_relationship_count, load_parsed_data
|
||||
from xer_mcp.errors import FileNotFoundError, ParseError
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
from xer_mcp.server import set_file_loaded
|
||||
|
||||
|
||||
async def load_xer(file_path: str, project_id: str | None = None) -> dict:
|
||||
"""Load a Primavera P6 XER file and parse its schedule data.
|
||||
|
||||
Args:
|
||||
file_path: Absolute path to the XER file
|
||||
project_id: Project ID to select (required for multi-project files)
|
||||
|
||||
Returns:
|
||||
Dictionary with success status and project info or error details
|
||||
"""
|
||||
# Ensure database is initialized
|
||||
if not db.is_initialized:
|
||||
db.initialize()
|
||||
|
||||
parser = XerParser()
|
||||
|
||||
try:
|
||||
parsed = parser.parse(file_path)
|
||||
except FileNotFoundError as e:
|
||||
return {
|
||||
"success": False,
|
||||
"error": {"code": e.code, "message": e.message},
|
||||
}
|
||||
except ParseError as e:
|
||||
return {
|
||||
"success": False,
|
||||
"error": {"code": e.code, "message": e.message},
|
||||
}
|
||||
|
||||
# Handle multi-project files
|
||||
if len(parsed.projects) > 1 and project_id is None:
|
||||
available = [
|
||||
{"proj_id": p["proj_id"], "proj_short_name": p["proj_short_name"]}
|
||||
for p in parsed.projects
|
||||
]
|
||||
return {
|
||||
"success": False,
|
||||
"available_projects": available,
|
||||
"message": "Multiple projects found. Please specify project_id.",
|
||||
}
|
||||
|
||||
# Auto-select if single project
|
||||
if project_id is None:
|
||||
project_id = parsed.projects[0]["proj_id"]
|
||||
|
||||
# Find the selected project
|
||||
project = next((p for p in parsed.projects if p["proj_id"] == project_id), None)
|
||||
if project is None:
|
||||
return {
|
||||
"success": False,
|
||||
"error": {
|
||||
"code": "PROJECT_NOT_FOUND",
|
||||
"message": f"Project {project_id} not found in file",
|
||||
},
|
||||
}
|
||||
|
||||
# Load data into database
|
||||
load_parsed_data(parsed, project_id)
|
||||
|
||||
# Mark file as loaded
|
||||
set_file_loaded(True, project_id)
|
||||
|
||||
# Get counts
|
||||
activity_count = get_activity_count()
|
||||
relationship_count = get_relationship_count()
|
||||
|
||||
return {
|
||||
"success": True,
|
||||
"project": {
|
||||
"proj_id": project["proj_id"],
|
||||
"proj_short_name": project["proj_short_name"],
|
||||
"plan_start_date": project["plan_start_date"],
|
||||
"plan_end_date": project["plan_end_date"],
|
||||
},
|
||||
"activity_count": activity_count,
|
||||
"relationship_count": relationship_count,
|
||||
}
|
||||
1
tests/__init__.py
Normal file
1
tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""XER MCP Server tests."""
|
||||
129
tests/conftest.py
Normal file
129
tests/conftest.py
Normal file
@@ -0,0 +1,129 @@
|
||||
"""Pytest configuration and fixtures for XER MCP Server tests."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
# Sample XER content for testing - minimal but complete
|
||||
SAMPLE_XER_SINGLE_PROJECT = """\
|
||||
ERMHDR\t21.12\t2026-01-06\tProject\tADMIN\ttestuser\tdbTest\tProject Management\tUSD
|
||||
%T\tPROJECT
|
||||
%F\tproj_id\tfy_start_month_num\trsrc_self_add_flag\tallow_complete_flag\trsrc_multi_assign_flag\tcheckout_flag\tproject_flag\tstep_complete_flag\tcost_qty_recalc_flag\tbatch_sum_flag\tname_sep_char\tdef_complete_pct_type\tproj_short_name\tacct_id\torig_proj_id\tsource_proj_id\tbase_type_id\tclndr_id\tsum_base_proj_id\ttask_code_base\ttask_code_step\tpriority_num\twbs_max_sum_level\tstrgy_priority_num\tlast_checksum\tcritical_drtn_hr_cnt\tdef_cost_per_qty\tlast_recalc_date\tplan_start_date\tplan_end_date\tscd_end_date\tadd_date\tlast_tasksum_date\tfcst_start_date\tdef_duration_type\ttask_code_prefix\tguid\tdef_qty_type\tadd_by_name\tweb_local_root_path\tproj_url\tdef_rate_type\tadd_act_remain_flag\tact_this_per_link_flag\tdef_task_type\tact_pct_link_flag\tcritical_path_type\ttask_code_prefix_flag\tdef_rollup_dates_flag\tuse_project_baseline_flag\trem_target_link_flag\treset_planned_flag\tallow_neg_act_flag\tsum_assign_level\tlast_fin_dates_id\tfintmpl_id\tlast_baseline_update_date\tcr_external_key\tapply_actuals_date\tlocation_id\tloaded_scope_level\texport_flag\tnew_fin_dates_id\tbaselines_to_export\tbaseline_names_to_export\tnext_data_date\tclose_period_flag\tsum_refresh_date\ttrsrcsum_loaded\tsumtask_loaded
|
||||
%R\t1001\t1\tY\tY\tY\tN\tY\tN\tN\tY\t.\tCP_Drtn\tTest Project\t\t\t\t\t1\t\t1000\t10\t10\t2\t500\t\t0\t0.0000\t2026-01-06 00:00\t2026-01-01 00:00\t2026-06-30 00:00\t2026-06-30 00:00\t2026-01-06 00:00\t\t\tDT_FixedDUR2\tA\ttest-guid-1\tQT_Hour\tADMIN\t\t\tCOST_PER_QTY\tN\tY\tTT_Task\tY\tCT_TotFloat\tY\tY\tY\tY\tN\tN\tSL_Taskrsrc\t\t1\t\t\t\t\t7\tY\t\t\t\t\t\t\t
|
||||
%T\tCALENDAR
|
||||
%F\tclndr_id\tdefault_flag\tclndr_name\tproj_id\tbase_clndr_id\tlast_chng_date\tclndr_type\tday_hr_cnt\tweek_hr_cnt\tmonth_hr_cnt\tyear_hr_cnt\trsrc_private\tclndr_data
|
||||
%R\t1\tY\tStandard 5 Day\t\t\t2026-01-06 00:00\tCA_Base\t8\t40\t160\t2080\tN\t
|
||||
%T\tPROJWBS
|
||||
%F\twbs_id\tproj_id\tobs_id\tseq_num\test_wt\tproj_node_flag\tsum_data_flag\tstatus_code\twbs_short_name\twbs_name\tphase_id\tparent_wbs_id\tev_user_pct\tev_etc_user_value\torig_cost\tindep_remain_total_cost\tann_dscnt_rate_pct\tdscnt_period_type\tindep_remain_work_qty\tanticip_start_date\tanticip_end_date\tev_compute_type\tev_etc_compute_type\tguid\ttmpl_guid\tplan_open_state
|
||||
%R\t100\t1001\t\t1\t1\tY\tN\tWS_Open\tROOT\tTest Project\t\t\t6\t0.88\t0.0000\t0.0000\t\t\t\t\t\tEC_Cmp_pct\tEE_Rem_hr\twbs-guid-1\t\t
|
||||
%R\t101\t1001\t\t1\t1\tN\tN\tWS_Open\tPH1\tPhase 1\t\t100\t6\t0.88\t0.0000\t0.0000\t\t\t\t\t\tEC_Cmp_pct\tEE_Rem_hr\twbs-guid-2\t\t
|
||||
%R\t102\t1001\t\t2\t1\tN\tN\tWS_Open\tPH2\tPhase 2\t\t100\t6\t0.88\t0.0000\t0.0000\t\t\t\t\t\tEC_Cmp_pct\tEE_Rem_hr\twbs-guid-3\t\t
|
||||
%T\tTASK
|
||||
%F\ttask_id\tproj_id\twbs_id\tclndr_id\tphys_complete_pct\trev_fdbk_flag\test_wt\tlock_plan_flag\tauto_compute_act_flag\tcomplete_pct_type\ttask_type\tduration_type\tstatus_code\ttask_code\ttask_name\trsrc_id\ttotal_float_hr_cnt\tfree_float_hr_cnt\tremain_drtn_hr_cnt\tact_work_qty\tremain_work_qty\ttarget_work_qty\ttarget_drtn_hr_cnt\ttarget_equip_qty\tact_equip_qty\tremain_equip_qty\tcstr_date\tact_start_date\tact_end_date\tlate_start_date\tlate_end_date\texpect_end_date\tearly_start_date\tearly_end_date\trestart_date\treend_date\ttarget_start_date\ttarget_end_date\trem_late_start_date\trem_late_end_date\tcstr_type\tpriority_type\tsuspend_date\tresume_date\tfloat_path\tfloat_path_order\tguid\ttmpl_guid\tcstr_date2\tcstr_type2\tdriving_path_flag\tact_this_per_work_qty\tact_this_per_equip_qty\texternal_early_start_date\texternal_late_end_date\tcreate_date\tupdate_date\tcreate_user\tupdate_user\tlocation_id\tcrt_path_num
|
||||
%R\t2001\t1001\t101\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Mile\tDT_FixedDrtn\tTK_NotStart\tA1000\tProject Start\t\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t\t\t\t2026-01-01 07:00\t2026-01-01 07:00\t\t2026-01-01 07:00\t2026-01-01 07:00\t2026-01-01 07:00\t2026-01-01 07:00\t2026-01-01 07:00\t2026-01-01 07:00\t2026-01-01 07:00\t2026-01-01 07:00\t\tPT_Normal\t\t\t1\t1\ttask-guid-1\t\t\t\tY\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%R\t2002\t1001\t101\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Task\tDT_FixedDUR2\tTK_NotStart\tA1010\tSite Preparation\t\t0\t0\t40\t0\t0\t0\t40\t0\t0\t0\t\t\t\t2026-01-02 07:00\t2026-01-08 15:00\t\t2026-01-02 07:00\t2026-01-08 15:00\t2026-01-02 07:00\t2026-01-08 15:00\t2026-01-02 07:00\t2026-01-08 15:00\t2026-01-02 07:00\t2026-01-08 15:00\t\tPT_Normal\t\t\t1\t2\ttask-guid-2\t\t\t\tY\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%R\t2003\t1001\t101\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Task\tDT_FixedDUR2\tTK_NotStart\tA1020\tFoundation Work\t\t80\t0\t80\t0\t0\t0\t80\t0\t0\t0\t\t\t\t2026-01-09 07:00\t2026-01-22 15:00\t\t2026-01-09 07:00\t2026-01-22 15:00\t2026-01-09 07:00\t2026-01-22 15:00\t2026-01-09 07:00\t2026-01-22 15:00\t2026-01-09 07:00\t2026-01-22 15:00\t\tPT_Normal\t\t\t1\t3\ttask-guid-3\t\t\t\tN\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%R\t2004\t1001\t102\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Task\tDT_FixedDUR2\tTK_NotStart\tA1030\tStructural Work\t\t0\t0\t160\t0\t0\t0\t160\t0\t0\t0\t\t\t\t2026-01-23 07:00\t2026-02-19 15:00\t\t2026-01-23 07:00\t2026-02-19 15:00\t2026-01-23 07:00\t2026-02-19 15:00\t2026-01-23 07:00\t2026-02-19 15:00\t2026-01-23 07:00\t2026-02-19 15:00\t\tPT_Normal\t\t\t1\t4\ttask-guid-4\t\t\t\tY\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%R\t2005\t1001\t102\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Mile\tDT_FixedDrtn\tTK_NotStart\tA1040\tProject Complete\t\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t\t\t\t2026-02-20 07:00\t2026-02-20 07:00\t\t2026-02-20 07:00\t2026-02-20 07:00\t2026-02-20 07:00\t2026-02-20 07:00\t2026-02-20 07:00\t2026-02-20 07:00\t2026-02-20 07:00\t2026-02-20 07:00\t\tPT_Normal\t\t\t1\t5\ttask-guid-5\t\t\t\tY\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%T\tTASKPRED
|
||||
%F\ttask_pred_id\ttask_id\tpred_task_id\tproj_id\tpred_proj_id\tpred_type\tlag_hr_cnt\tcomments\tfloat_path\taref\tarls
|
||||
%R\t3001\t2002\t2001\t1001\t1001\tPR_FS\t0\t\t\t2026-01-01 07:00\t2026-01-02 07:00
|
||||
%R\t3002\t2003\t2002\t1001\t1001\tPR_FS\t0\t\t\t2026-01-08 15:00\t2026-01-09 07:00
|
||||
%R\t3003\t2004\t2003\t1001\t1001\tPR_FS\t0\t\t\t2026-01-22 15:00\t2026-01-23 07:00
|
||||
%R\t3004\t2005\t2004\t1001\t1001\tPR_FS\t0\t\t\t2026-02-19 15:00\t2026-02-20 07:00
|
||||
%R\t3005\t2004\t2002\t1001\t1001\tPR_SS\t40\t\t\t2026-01-02 07:00\t2026-01-08 07:00
|
||||
%T\tEND
|
||||
"""
|
||||
|
||||
SAMPLE_XER_MULTI_PROJECT = """\
|
||||
ERMHDR\t21.12\t2026-01-06\tProject\tADMIN\ttestuser\tdbTest\tProject Management\tUSD
|
||||
%T\tPROJECT
|
||||
%F\tproj_id\tfy_start_month_num\trsrc_self_add_flag\tallow_complete_flag\trsrc_multi_assign_flag\tcheckout_flag\tproject_flag\tstep_complete_flag\tcost_qty_recalc_flag\tbatch_sum_flag\tname_sep_char\tdef_complete_pct_type\tproj_short_name\tacct_id\torig_proj_id\tsource_proj_id\tbase_type_id\tclndr_id\tsum_base_proj_id\ttask_code_base\ttask_code_step\tpriority_num\twbs_max_sum_level\tstrgy_priority_num\tlast_checksum\tcritical_drtn_hr_cnt\tdef_cost_per_qty\tlast_recalc_date\tplan_start_date\tplan_end_date\tscd_end_date\tadd_date\tlast_tasksum_date\tfcst_start_date\tdef_duration_type\ttask_code_prefix\tguid\tdef_qty_type\tadd_by_name\tweb_local_root_path\tproj_url\tdef_rate_type\tadd_act_remain_flag\tact_this_per_link_flag\tdef_task_type\tact_pct_link_flag\tcritical_path_type\ttask_code_prefix_flag\tdef_rollup_dates_flag\tuse_project_baseline_flag\trem_target_link_flag\treset_planned_flag\tallow_neg_act_flag\tsum_assign_level\tlast_fin_dates_id\tfintmpl_id\tlast_baseline_update_date\tcr_external_key\tapply_actuals_date\tlocation_id\tloaded_scope_level\texport_flag\tnew_fin_dates_id\tbaselines_to_export\tbaseline_names_to_export\tnext_data_date\tclose_period_flag\tsum_refresh_date\ttrsrcsum_loaded\tsumtask_loaded
|
||||
%R\t1001\t1\tY\tY\tY\tN\tY\tN\tN\tY\t.\tCP_Drtn\tProject Alpha\t\t\t\t\t1\t\t1000\t10\t10\t2\t500\t\t0\t0.0000\t2026-01-06 00:00\t2026-01-01 00:00\t2026-03-31 00:00\t2026-03-31 00:00\t2026-01-06 00:00\t\t\tDT_FixedDUR2\tA\ttest-guid-1\tQT_Hour\tADMIN\t\t\tCOST_PER_QTY\tN\tY\tTT_Task\tY\tCT_TotFloat\tY\tY\tY\tY\tN\tN\tSL_Taskrsrc\t\t1\t\t\t\t\t7\tY\t\t\t\t\t\t\t
|
||||
%R\t1002\t1\tY\tY\tY\tN\tY\tN\tN\tY\t.\tCP_Drtn\tProject Beta\t\t\t\t\t1\t\t1000\t10\t10\t2\t500\t\t0\t0.0000\t2026-01-06 00:00\t2026-04-01 00:00\t2026-06-30 00:00\t2026-06-30 00:00\t2026-01-06 00:00\t\t\tDT_FixedDUR2\tB\ttest-guid-2\tQT_Hour\tADMIN\t\t\tCOST_PER_QTY\tN\tY\tTT_Task\tY\tCT_TotFloat\tY\tY\tY\tY\tN\tN\tSL_Taskrsrc\t\t1\t\t\t\t\t7\tY\t\t\t\t\t\t\t
|
||||
%T\tCALENDAR
|
||||
%F\tclndr_id\tdefault_flag\tclndr_name\tproj_id\tbase_clndr_id\tlast_chng_date\tclndr_type\tday_hr_cnt\tweek_hr_cnt\tmonth_hr_cnt\tyear_hr_cnt\trsrc_private\tclndr_data
|
||||
%R\t1\tY\tStandard 5 Day\t\t\t2026-01-06 00:00\tCA_Base\t8\t40\t160\t2080\tN\t
|
||||
%T\tPROJWBS
|
||||
%F\twbs_id\tproj_id\tobs_id\tseq_num\test_wt\tproj_node_flag\tsum_data_flag\tstatus_code\twbs_short_name\twbs_name\tphase_id\tparent_wbs_id\tev_user_pct\tev_etc_user_value\torig_cost\tindep_remain_total_cost\tann_dscnt_rate_pct\tdscnt_period_type\tindep_remain_work_qty\tanticip_start_date\tanticip_end_date\tev_compute_type\tev_etc_compute_type\tguid\ttmpl_guid\tplan_open_state
|
||||
%R\t100\t1001\t\t1\t1\tY\tN\tWS_Open\tALPHA\tProject Alpha\t\t\t6\t0.88\t0.0000\t0.0000\t\t\t\t\t\tEC_Cmp_pct\tEE_Rem_hr\twbs-guid-1\t\t
|
||||
%R\t200\t1002\t\t1\t1\tY\tN\tWS_Open\tBETA\tProject Beta\t\t\t6\t0.88\t0.0000\t0.0000\t\t\t\t\t\tEC_Cmp_pct\tEE_Rem_hr\twbs-guid-2\t\t
|
||||
%T\tTASK
|
||||
%F\ttask_id\tproj_id\twbs_id\tclndr_id\tphys_complete_pct\trev_fdbk_flag\test_wt\tlock_plan_flag\tauto_compute_act_flag\tcomplete_pct_type\ttask_type\tduration_type\tstatus_code\ttask_code\ttask_name\trsrc_id\ttotal_float_hr_cnt\tfree_float_hr_cnt\tremain_drtn_hr_cnt\tact_work_qty\tremain_work_qty\ttarget_work_qty\ttarget_drtn_hr_cnt\ttarget_equip_qty\tact_equip_qty\tremain_equip_qty\tcstr_date\tact_start_date\tact_end_date\tlate_start_date\tlate_end_date\texpect_end_date\tearly_start_date\tearly_end_date\trestart_date\treend_date\ttarget_start_date\ttarget_end_date\trem_late_start_date\trem_late_end_date\tcstr_type\tpriority_type\tsuspend_date\tresume_date\tfloat_path\tfloat_path_order\tguid\ttmpl_guid\tcstr_date2\tcstr_type2\tdriving_path_flag\tact_this_per_work_qty\tact_this_per_equip_qty\texternal_early_start_date\texternal_late_end_date\tcreate_date\tupdate_date\tcreate_user\tupdate_user\tlocation_id\tcrt_path_num
|
||||
%R\t2001\t1001\t100\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Task\tDT_FixedDUR2\tTK_NotStart\tA1000\tAlpha Task 1\t\t0\t0\t40\t0\t0\t0\t40\t0\t0\t0\t\t\t\t2026-01-01 07:00\t2026-01-08 15:00\t\t2026-01-01 07:00\t2026-01-08 15:00\t2026-01-01 07:00\t2026-01-08 15:00\t2026-01-01 07:00\t2026-01-08 15:00\t2026-01-01 07:00\t2026-01-08 15:00\t\tPT_Normal\t\t\t\t\ttask-guid-1\t\t\t\tY\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%R\t2002\t1002\t200\t1\t0\tN\t1\tN\tN\tCP_Drtn\tTT_Task\tDT_FixedDUR2\tTK_NotStart\tB1000\tBeta Task 1\t\t0\t0\t40\t0\t0\t0\t40\t0\t0\t0\t\t\t\t2026-04-01 07:00\t2026-04-08 15:00\t\t2026-04-01 07:00\t2026-04-08 15:00\t2026-04-01 07:00\t2026-04-08 15:00\t2026-04-01 07:00\t2026-04-08 15:00\t2026-04-01 07:00\t2026-04-08 15:00\t\tPT_Normal\t\t\t\t\ttask-guid-2\t\t\t\tY\t0\t0\t\t\t2026-01-06 00:00\t2026-01-06 00:00\tADMIN\tADMIN\t\t
|
||||
%T\tTASKPRED
|
||||
%F\ttask_pred_id\ttask_id\tpred_task_id\tproj_id\tpred_proj_id\tpred_type\tlag_hr_cnt\tcomments\tfloat_path\taref\tarls
|
||||
%T\tEND
|
||||
"""
|
||||
|
||||
SAMPLE_XER_EMPTY = """\
|
||||
ERMHDR\t21.12\t2026-01-06\tProject\tADMIN\ttestuser\tdbTest\tProject Management\tUSD
|
||||
%T\tPROJECT
|
||||
%F\tproj_id\tfy_start_month_num\trsrc_self_add_flag\tallow_complete_flag\trsrc_multi_assign_flag\tcheckout_flag\tproject_flag\tstep_complete_flag\tcost_qty_recalc_flag\tbatch_sum_flag\tname_sep_char\tdef_complete_pct_type\tproj_short_name\tacct_id\torig_proj_id\tsource_proj_id\tbase_type_id\tclndr_id\tsum_base_proj_id\ttask_code_base\ttask_code_step\tpriority_num\twbs_max_sum_level\tstrgy_priority_num\tlast_checksum\tcritical_drtn_hr_cnt\tdef_cost_per_qty\tlast_recalc_date\tplan_start_date\tplan_end_date\tscd_end_date\tadd_date\tlast_tasksum_date\tfcst_start_date\tdef_duration_type\ttask_code_prefix\tguid\tdef_qty_type\tadd_by_name\tweb_local_root_path\tproj_url\tdef_rate_type\tadd_act_remain_flag\tact_this_per_link_flag\tdef_task_type\tact_pct_link_flag\tcritical_path_type\ttask_code_prefix_flag\tdef_rollup_dates_flag\tuse_project_baseline_flag\trem_target_link_flag\treset_planned_flag\tallow_neg_act_flag\tsum_assign_level\tlast_fin_dates_id\tfintmpl_id\tlast_baseline_update_date\tcr_external_key\tapply_actuals_date\tlocation_id\tloaded_scope_level\texport_flag\tnew_fin_dates_id\tbaselines_to_export\tbaseline_names_to_export\tnext_data_date\tclose_period_flag\tsum_refresh_date\ttrsrcsum_loaded\tsumtask_loaded
|
||||
%R\t1001\t1\tY\tY\tY\tN\tY\tN\tN\tY\t.\tCP_Drtn\tEmpty Project\t\t\t\t\t1\t\t1000\t10\t10\t2\t500\t\t0\t0.0000\t2026-01-06 00:00\t2026-01-01 00:00\t2026-06-30 00:00\t2026-06-30 00:00\t2026-01-06 00:00\t\t\tDT_FixedDUR2\tA\ttest-guid-1\tQT_Hour\tADMIN\t\t\tCOST_PER_QTY\tN\tY\tTT_Task\tY\tCT_TotFloat\tY\tY\tY\tY\tN\tN\tSL_Taskrsrc\t\t1\t\t\t\t\t7\tY\t\t\t\t\t\t\t
|
||||
%T\tCALENDAR
|
||||
%F\tclndr_id\tdefault_flag\tclndr_name\tproj_id\tbase_clndr_id\tlast_chng_date\tclndr_type\tday_hr_cnt\tweek_hr_cnt\tmonth_hr_cnt\tyear_hr_cnt\trsrc_private\tclndr_data
|
||||
%R\t1\tY\tStandard 5 Day\t\t\t2026-01-06 00:00\tCA_Base\t8\t40\t160\t2080\tN\t
|
||||
%T\tPROJWBS
|
||||
%F\twbs_id\tproj_id\tobs_id\tseq_num\test_wt\tproj_node_flag\tsum_data_flag\tstatus_code\twbs_short_name\twbs_name\tphase_id\tparent_wbs_id\tev_user_pct\tev_etc_user_value\torig_cost\tindep_remain_total_cost\tann_dscnt_rate_pct\tdscnt_period_type\tindep_remain_work_qty\tanticip_start_date\tanticip_end_date\tev_compute_type\tev_etc_compute_type\tguid\ttmpl_guid\tplan_open_state
|
||||
%R\t100\t1001\t\t1\t1\tY\tN\tWS_Open\tROOT\tEmpty Project\t\t\t6\t0.88\t0.0000\t0.0000\t\t\t\t\t\tEC_Cmp_pct\tEE_Rem_hr\twbs-guid-1\t\t
|
||||
%T\tTASK
|
||||
%F\ttask_id\tproj_id\twbs_id\tclndr_id\tphys_complete_pct\trev_fdbk_flag\test_wt\tlock_plan_flag\tauto_compute_act_flag\tcomplete_pct_type\ttask_type\tduration_type\tstatus_code\ttask_code\ttask_name\trsrc_id\ttotal_float_hr_cnt\tfree_float_hr_cnt\tremain_drtn_hr_cnt\tact_work_qty\tremain_work_qty\ttarget_work_qty\ttarget_drtn_hr_cnt\ttarget_equip_qty\tact_equip_qty\tremain_equip_qty\tcstr_date\tact_start_date\tact_end_date\tlate_start_date\tlate_end_date\texpect_end_date\tearly_start_date\tearly_end_date\trestart_date\treend_date\ttarget_start_date\ttarget_end_date\trem_late_start_date\trem_late_end_date\tcstr_type\tpriority_type\tsuspend_date\tresume_date\tfloat_path\tfloat_path_order\tguid\ttmpl_guid\tcstr_date2\tcstr_type2\tdriving_path_flag\tact_this_per_work_qty\tact_this_per_equip_qty\texternal_early_start_date\texternal_late_end_date\tcreate_date\tupdate_date\tcreate_user\tupdate_user\tlocation_id\tcrt_path_num
|
||||
%T\tTASKPRED
|
||||
%F\ttask_pred_id\ttask_id\tpred_task_id\tproj_id\tpred_proj_id\tpred_type\tlag_hr_cnt\tcomments\tfloat_path\taref\tarls
|
||||
%T\tEND
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sample_xer_single_project(tmp_path: Path) -> Path:
|
||||
"""Create a temporary XER file with a single project."""
|
||||
xer_file = tmp_path / "single_project.xer"
|
||||
xer_file.write_text(SAMPLE_XER_SINGLE_PROJECT)
|
||||
return xer_file
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sample_xer_multi_project(tmp_path: Path) -> Path:
|
||||
"""Create a temporary XER file with multiple projects."""
|
||||
xer_file = tmp_path / "multi_project.xer"
|
||||
xer_file.write_text(SAMPLE_XER_MULTI_PROJECT)
|
||||
return xer_file
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sample_xer_empty(tmp_path: Path) -> Path:
|
||||
"""Create a temporary XER file with no activities."""
|
||||
xer_file = tmp_path / "empty_project.xer"
|
||||
xer_file.write_text(SAMPLE_XER_EMPTY)
|
||||
return xer_file
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def nonexistent_xer_path(tmp_path: Path) -> Path:
|
||||
"""Return a path to a non-existent XER file."""
|
||||
return tmp_path / "does_not_exist.xer"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def invalid_xer_file(tmp_path: Path) -> Path:
|
||||
"""Create a temporary file with invalid XER content."""
|
||||
xer_file = tmp_path / "invalid.xer"
|
||||
xer_file.write_text("This is not a valid XER file\nJust some random text")
|
||||
return xer_file
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def real_xer_file() -> Path | None:
|
||||
"""Return the path to the real XER file if it exists.
|
||||
|
||||
This fixture provides access to the actual XER file in the repository
|
||||
for integration testing with real data.
|
||||
"""
|
||||
real_file = Path(
|
||||
"/home/bill/xer-mcp/S48019R - Proposal Schedule - E-J Electric Installation.xer"
|
||||
)
|
||||
if real_file.exists():
|
||||
return real_file
|
||||
return None
|
||||
1
tests/contract/__init__.py
Normal file
1
tests/contract/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Contract tests for MCP tool interfaces."""
|
||||
89
tests/contract/test_get_activity.py
Normal file
89
tests/contract/test_get_activity.py
Normal file
@@ -0,0 +1,89 @@
|
||||
"""Contract tests for get_activity MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestGetActivityContract:
|
||||
"""Contract tests verifying get_activity tool interface matches spec."""
|
||||
|
||||
async def test_get_activity_returns_details(self, sample_xer_single_project: Path) -> None:
|
||||
"""get_activity returns complete activity details."""
|
||||
from xer_mcp.tools.get_activity import get_activity
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_activity(activity_id="2002")
|
||||
|
||||
assert result["task_id"] == "2002"
|
||||
assert result["task_code"] == "A1010"
|
||||
assert result["task_name"] == "Site Preparation"
|
||||
assert result["task_type"] == "TT_Task"
|
||||
assert "target_start_date" in result
|
||||
assert "target_end_date" in result
|
||||
assert "wbs_id" in result
|
||||
assert "predecessor_count" in result
|
||||
assert "successor_count" in result
|
||||
|
||||
async def test_get_activity_includes_wbs_name(self, sample_xer_single_project: Path) -> None:
|
||||
"""get_activity includes WBS name from lookup."""
|
||||
from xer_mcp.tools.get_activity import get_activity
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_activity(activity_id="2002")
|
||||
|
||||
assert "wbs_name" in result
|
||||
|
||||
async def test_get_activity_includes_relationship_counts(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_activity includes predecessor and successor counts."""
|
||||
from xer_mcp.tools.get_activity import get_activity
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
# A1010 (2002) has 1 predecessor (A1000) and 2 successors (A1020, A1030)
|
||||
result = await get_activity(activity_id="2002")
|
||||
|
||||
assert result["predecessor_count"] == 1
|
||||
assert result["successor_count"] == 2
|
||||
|
||||
async def test_get_activity_not_found_returns_error(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_activity with invalid ID returns ACTIVITY_NOT_FOUND error."""
|
||||
from xer_mcp.tools.get_activity import get_activity
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_activity(activity_id="nonexistent")
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "ACTIVITY_NOT_FOUND"
|
||||
|
||||
async def test_get_activity_no_file_loaded_returns_error(self) -> None:
|
||||
"""get_activity without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.get_activity import get_activity
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await get_activity(activity_id="2002")
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
91
tests/contract/test_get_critical_path.py
Normal file
91
tests/contract/test_get_critical_path.py
Normal file
@@ -0,0 +1,91 @@
|
||||
"""Contract tests for get_critical_path MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestGetCriticalPathContract:
|
||||
"""Contract tests verifying get_critical_path tool interface."""
|
||||
|
||||
async def test_get_critical_path_returns_critical_activities(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_critical_path returns activities with driving_path_flag set."""
|
||||
from xer_mcp.tools.get_critical_path import get_critical_path
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_critical_path()
|
||||
|
||||
assert "critical_activities" in result
|
||||
assert len(result["critical_activities"]) == 4
|
||||
|
||||
async def test_get_critical_path_includes_expected_fields(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_critical_path returns activities with required fields."""
|
||||
from xer_mcp.tools.get_critical_path import get_critical_path
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_critical_path()
|
||||
|
||||
activity = result["critical_activities"][0]
|
||||
assert "task_id" in activity
|
||||
assert "task_code" in activity
|
||||
assert "task_name" in activity
|
||||
assert "target_start_date" in activity
|
||||
assert "target_end_date" in activity
|
||||
assert "total_float_hr_cnt" in activity
|
||||
|
||||
async def test_get_critical_path_ordered_by_date(self, sample_xer_single_project: Path) -> None:
|
||||
"""get_critical_path returns activities ordered by start date."""
|
||||
from xer_mcp.tools.get_critical_path import get_critical_path
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_critical_path()
|
||||
|
||||
activities = result["critical_activities"]
|
||||
for i in range(len(activities) - 1):
|
||||
assert activities[i]["target_start_date"] <= activities[i + 1]["target_start_date"]
|
||||
|
||||
async def test_get_critical_path_excludes_non_critical(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_critical_path excludes activities not on critical path."""
|
||||
from xer_mcp.tools.get_critical_path import get_critical_path
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_critical_path()
|
||||
|
||||
# A1020 "Foundation Work" has driving_path_flag = N
|
||||
activity_names = [a["task_name"] for a in result["critical_activities"]]
|
||||
assert "Foundation Work" not in activity_names
|
||||
|
||||
async def test_get_critical_path_no_file_loaded_returns_error(self) -> None:
|
||||
"""get_critical_path without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.get_critical_path import get_critical_path
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await get_critical_path()
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
77
tests/contract/test_get_predecessors.py
Normal file
77
tests/contract/test_get_predecessors.py
Normal file
@@ -0,0 +1,77 @@
|
||||
"""Contract tests for get_predecessors MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestGetPredecessorsContract:
|
||||
"""Contract tests verifying get_predecessors tool interface."""
|
||||
|
||||
async def test_get_predecessors_returns_list(self, sample_xer_single_project: Path) -> None:
|
||||
"""get_predecessors returns predecessor activities."""
|
||||
from xer_mcp.tools.get_predecessors import get_predecessors
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
# A1010 (2002) has one predecessor: A1000 (2001)
|
||||
result = await get_predecessors(activity_id="2002")
|
||||
|
||||
assert "activity_id" in result
|
||||
assert result["activity_id"] == "2002"
|
||||
assert "predecessors" in result
|
||||
assert len(result["predecessors"]) == 1
|
||||
assert result["predecessors"][0]["task_id"] == "2001"
|
||||
|
||||
async def test_get_predecessors_includes_relationship_details(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_predecessors includes relationship type and lag."""
|
||||
from xer_mcp.tools.get_predecessors import get_predecessors
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_predecessors(activity_id="2002")
|
||||
|
||||
pred = result["predecessors"][0]
|
||||
assert "relationship_type" in pred
|
||||
assert "lag_hr_cnt" in pred
|
||||
assert pred["relationship_type"] in ["FS", "SS", "FF", "SF"]
|
||||
|
||||
async def test_get_predecessors_empty_list_for_no_predecessors(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_predecessors returns empty list when no predecessors exist."""
|
||||
from xer_mcp.tools.get_predecessors import get_predecessors
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
# A1000 (2001) has no predecessors
|
||||
result = await get_predecessors(activity_id="2001")
|
||||
|
||||
assert "predecessors" in result
|
||||
assert len(result["predecessors"]) == 0
|
||||
|
||||
async def test_get_predecessors_no_file_loaded_returns_error(self) -> None:
|
||||
"""get_predecessors without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.get_predecessors import get_predecessors
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await get_predecessors(activity_id="2002")
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
88
tests/contract/test_get_project_summary.py
Normal file
88
tests/contract/test_get_project_summary.py
Normal file
@@ -0,0 +1,88 @@
|
||||
"""Contract tests for get_project_summary MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestGetProjectSummaryContract:
|
||||
"""Contract tests verifying get_project_summary tool interface."""
|
||||
|
||||
async def test_get_project_summary_returns_basic_info(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_project_summary returns project name, dates, and activity count."""
|
||||
from xer_mcp.tools.get_project_summary import get_project_summary
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_project_summary()
|
||||
|
||||
assert "project_name" in result
|
||||
assert "plan_start_date" in result
|
||||
assert "plan_end_date" in result
|
||||
assert "activity_count" in result
|
||||
|
||||
async def test_get_project_summary_returns_correct_values(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_project_summary returns correct project values from loaded XER."""
|
||||
from xer_mcp.tools.get_project_summary import get_project_summary
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_project_summary()
|
||||
|
||||
assert result["project_name"] == "Test Project"
|
||||
assert result["activity_count"] == 5
|
||||
|
||||
async def test_get_project_summary_includes_milestone_count(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_project_summary includes count of milestones."""
|
||||
from xer_mcp.tools.get_project_summary import get_project_summary
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_project_summary()
|
||||
|
||||
assert "milestone_count" in result
|
||||
assert result["milestone_count"] == 2
|
||||
|
||||
async def test_get_project_summary_includes_critical_count(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_project_summary includes count of critical path activities."""
|
||||
from xer_mcp.tools.get_project_summary import get_project_summary
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_project_summary()
|
||||
|
||||
assert "critical_activity_count" in result
|
||||
assert result["critical_activity_count"] == 4
|
||||
|
||||
async def test_get_project_summary_no_file_loaded_returns_error(self) -> None:
|
||||
"""get_project_summary without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.get_project_summary import get_project_summary
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await get_project_summary()
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
76
tests/contract/test_get_successors.py
Normal file
76
tests/contract/test_get_successors.py
Normal file
@@ -0,0 +1,76 @@
|
||||
"""Contract tests for get_successors MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestGetSuccessorsContract:
|
||||
"""Contract tests verifying get_successors tool interface."""
|
||||
|
||||
async def test_get_successors_returns_list(self, sample_xer_single_project: Path) -> None:
|
||||
"""get_successors returns successor activities."""
|
||||
from xer_mcp.tools.get_successors import get_successors
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
# A1010 (2002) has two successors: A1020 (2003) and A1030 (2004)
|
||||
result = await get_successors(activity_id="2002")
|
||||
|
||||
assert "activity_id" in result
|
||||
assert result["activity_id"] == "2002"
|
||||
assert "successors" in result
|
||||
assert len(result["successors"]) == 2
|
||||
|
||||
async def test_get_successors_includes_relationship_details(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_successors includes relationship type and lag."""
|
||||
from xer_mcp.tools.get_successors import get_successors
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await get_successors(activity_id="2001")
|
||||
|
||||
succ = result["successors"][0]
|
||||
assert "relationship_type" in succ
|
||||
assert "lag_hr_cnt" in succ
|
||||
assert succ["relationship_type"] in ["FS", "SS", "FF", "SF"]
|
||||
|
||||
async def test_get_successors_empty_list_for_no_successors(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""get_successors returns empty list when no successors exist."""
|
||||
from xer_mcp.tools.get_successors import get_successors
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
# A1040 (2005) has no successors
|
||||
result = await get_successors(activity_id="2005")
|
||||
|
||||
assert "successors" in result
|
||||
assert len(result["successors"]) == 0
|
||||
|
||||
async def test_get_successors_no_file_loaded_returns_error(self) -> None:
|
||||
"""get_successors without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.get_successors import get_successors
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await get_successors(activity_id="2002")
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
138
tests/contract/test_list_activities.py
Normal file
138
tests/contract/test_list_activities.py
Normal file
@@ -0,0 +1,138 @@
|
||||
"""Contract tests for list_activities MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestListActivitiesContract:
|
||||
"""Contract tests verifying list_activities tool interface matches spec."""
|
||||
|
||||
async def test_list_activities_returns_paginated_results(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_activities returns activities with pagination metadata."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_activities()
|
||||
|
||||
assert "activities" in result
|
||||
assert "pagination" in result
|
||||
assert len(result["activities"]) == 5
|
||||
assert result["pagination"]["total_count"] == 5
|
||||
assert result["pagination"]["offset"] == 0
|
||||
assert result["pagination"]["limit"] == 100
|
||||
assert result["pagination"]["has_more"] is False
|
||||
|
||||
async def test_list_activities_with_limit(self, sample_xer_single_project: Path) -> None:
|
||||
"""list_activities respects limit parameter."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_activities(limit=2)
|
||||
|
||||
assert len(result["activities"]) == 2
|
||||
assert result["pagination"]["limit"] == 2
|
||||
assert result["pagination"]["has_more"] is True
|
||||
|
||||
async def test_list_activities_with_offset(self, sample_xer_single_project: Path) -> None:
|
||||
"""list_activities respects offset parameter."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_activities(offset=2, limit=2)
|
||||
|
||||
assert len(result["activities"]) == 2
|
||||
assert result["pagination"]["offset"] == 2
|
||||
|
||||
async def test_list_activities_filter_by_date_range(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_activities filters by date range."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
# Filter to January only
|
||||
result = await list_activities(start_date="2026-01-01", end_date="2026-01-31")
|
||||
|
||||
# Should include activities in January
|
||||
for activity in result["activities"]:
|
||||
assert "2026-01" in activity["target_start_date"]
|
||||
|
||||
async def test_list_activities_filter_by_activity_type(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_activities filters by activity type."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_activities(activity_type="TT_Mile")
|
||||
|
||||
assert len(result["activities"]) == 2
|
||||
for activity in result["activities"]:
|
||||
assert activity["task_type"] == "TT_Mile"
|
||||
|
||||
async def test_list_activities_filter_by_wbs(self, sample_xer_single_project: Path) -> None:
|
||||
"""list_activities filters by WBS ID."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_activities(wbs_id="101")
|
||||
|
||||
# WBS 101 has 3 activities in the fixture
|
||||
assert len(result["activities"]) == 3
|
||||
|
||||
async def test_list_activities_no_file_loaded_returns_error(self) -> None:
|
||||
"""list_activities without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await list_activities()
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
|
||||
async def test_list_activities_returns_expected_fields(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_activities returns activities with all expected fields."""
|
||||
from xer_mcp.tools.list_activities import list_activities
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_activities()
|
||||
|
||||
activity = result["activities"][0]
|
||||
assert "task_id" in activity
|
||||
assert "task_code" in activity
|
||||
assert "task_name" in activity
|
||||
assert "task_type" in activity
|
||||
assert "target_start_date" in activity
|
||||
assert "target_end_date" in activity
|
||||
assert "status_code" in activity
|
||||
assert "driving_path_flag" in activity
|
||||
89
tests/contract/test_list_milestones.py
Normal file
89
tests/contract/test_list_milestones.py
Normal file
@@ -0,0 +1,89 @@
|
||||
"""Contract tests for list_milestones MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestListMilestonesContract:
|
||||
"""Contract tests verifying list_milestones tool interface."""
|
||||
|
||||
async def test_list_milestones_returns_milestone_activities(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_milestones returns only milestone type activities."""
|
||||
from xer_mcp.tools.list_milestones import list_milestones
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_milestones()
|
||||
|
||||
assert "milestones" in result
|
||||
assert len(result["milestones"]) == 2
|
||||
|
||||
async def test_list_milestones_includes_expected_fields(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_milestones returns milestones with required fields."""
|
||||
from xer_mcp.tools.list_milestones import list_milestones
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_milestones()
|
||||
|
||||
milestone = result["milestones"][0]
|
||||
assert "task_id" in milestone
|
||||
assert "task_code" in milestone
|
||||
assert "task_name" in milestone
|
||||
assert "target_start_date" in milestone
|
||||
assert "target_end_date" in milestone
|
||||
|
||||
async def test_list_milestones_returns_correct_activities(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_milestones returns the expected milestone activities."""
|
||||
from xer_mcp.tools.list_milestones import list_milestones
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_milestones()
|
||||
|
||||
milestone_names = [m["task_name"] for m in result["milestones"]]
|
||||
assert "Project Start" in milestone_names
|
||||
assert "Project Complete" in milestone_names
|
||||
|
||||
async def test_list_milestones_empty_when_no_milestones(self, sample_xer_empty: Path) -> None:
|
||||
"""list_milestones returns empty list when no milestones exist."""
|
||||
from xer_mcp.tools.list_milestones import list_milestones
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_empty))
|
||||
|
||||
result = await list_milestones()
|
||||
|
||||
assert "milestones" in result
|
||||
assert len(result["milestones"]) == 0
|
||||
|
||||
async def test_list_milestones_no_file_loaded_returns_error(self) -> None:
|
||||
"""list_milestones without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.list_milestones import list_milestones
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await list_milestones()
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
78
tests/contract/test_list_relationships.py
Normal file
78
tests/contract/test_list_relationships.py
Normal file
@@ -0,0 +1,78 @@
|
||||
"""Contract tests for list_relationships MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestListRelationshipsContract:
|
||||
"""Contract tests verifying list_relationships tool interface."""
|
||||
|
||||
async def test_list_relationships_returns_paginated_results(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_relationships returns relationships with pagination metadata."""
|
||||
from xer_mcp.tools.list_relationships import list_relationships
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_relationships()
|
||||
|
||||
assert "relationships" in result
|
||||
assert "pagination" in result
|
||||
assert len(result["relationships"]) == 5
|
||||
assert result["pagination"]["total_count"] == 5
|
||||
|
||||
async def test_list_relationships_with_pagination(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_relationships respects limit and offset parameters."""
|
||||
from xer_mcp.tools.list_relationships import list_relationships
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_relationships(limit=2, offset=0)
|
||||
|
||||
assert len(result["relationships"]) == 2
|
||||
assert result["pagination"]["has_more"] is True
|
||||
|
||||
async def test_list_relationships_includes_expected_fields(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""list_relationships returns relationships with all expected fields."""
|
||||
from xer_mcp.tools.list_relationships import list_relationships
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
result = await list_relationships()
|
||||
|
||||
rel = result["relationships"][0]
|
||||
assert "task_pred_id" in rel
|
||||
assert "task_id" in rel
|
||||
assert "pred_task_id" in rel
|
||||
assert "pred_type" in rel
|
||||
assert "lag_hr_cnt" in rel
|
||||
|
||||
async def test_list_relationships_no_file_loaded_returns_error(self) -> None:
|
||||
"""list_relationships without loaded file returns NO_FILE_LOADED error."""
|
||||
from xer_mcp.server import set_file_loaded
|
||||
from xer_mcp.tools.list_relationships import list_relationships
|
||||
|
||||
set_file_loaded(False)
|
||||
result = await list_relationships()
|
||||
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "NO_FILE_LOADED"
|
||||
107
tests/contract/test_load_xer.py
Normal file
107
tests/contract/test_load_xer.py
Normal file
@@ -0,0 +1,107 @@
|
||||
"""Contract tests for load_xer MCP tool."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestLoadXerContract:
|
||||
"""Contract tests verifying load_xer tool interface matches spec."""
|
||||
|
||||
async def test_load_single_project_returns_success(
|
||||
self, sample_xer_single_project: Path
|
||||
) -> None:
|
||||
"""load_xer with single-project file returns success and project info."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
assert result["success"] is True
|
||||
assert "project" in result
|
||||
assert result["project"]["proj_id"] == "1001"
|
||||
assert result["project"]["proj_short_name"] == "Test Project"
|
||||
assert "activity_count" in result
|
||||
assert result["activity_count"] == 5
|
||||
assert "relationship_count" in result
|
||||
assert result["relationship_count"] == 5
|
||||
|
||||
async def test_load_multi_project_without_selection_returns_list(
|
||||
self, sample_xer_multi_project: Path
|
||||
) -> None:
|
||||
"""load_xer with multi-project file without project_id returns available projects."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(file_path=str(sample_xer_multi_project))
|
||||
|
||||
assert result["success"] is False
|
||||
assert "available_projects" in result
|
||||
assert len(result["available_projects"]) == 2
|
||||
assert "message" in result
|
||||
assert "project_id" in result["message"].lower()
|
||||
|
||||
async def test_load_multi_project_with_selection_returns_success(
|
||||
self, sample_xer_multi_project: Path
|
||||
) -> None:
|
||||
"""load_xer with multi-project file and project_id returns selected project."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(file_path=str(sample_xer_multi_project), project_id="1001")
|
||||
|
||||
assert result["success"] is True
|
||||
assert result["project"]["proj_id"] == "1001"
|
||||
assert result["project"]["proj_short_name"] == "Project Alpha"
|
||||
|
||||
async def test_load_nonexistent_file_returns_error(self, nonexistent_xer_path: Path) -> None:
|
||||
"""load_xer with missing file returns FILE_NOT_FOUND error."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(file_path=str(nonexistent_xer_path))
|
||||
|
||||
assert result["success"] is False
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "FILE_NOT_FOUND"
|
||||
|
||||
async def test_load_invalid_file_returns_error(self, invalid_xer_file: Path) -> None:
|
||||
"""load_xer with invalid file returns PARSE_ERROR error."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(file_path=str(invalid_xer_file))
|
||||
|
||||
assert result["success"] is False
|
||||
assert "error" in result
|
||||
assert result["error"]["code"] == "PARSE_ERROR"
|
||||
|
||||
async def test_load_replaces_previous_file(
|
||||
self, sample_xer_single_project: Path, sample_xer_empty: Path
|
||||
) -> None:
|
||||
"""Loading a new file replaces the previous file's data."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
# Load first file
|
||||
result1 = await load_xer(file_path=str(sample_xer_single_project))
|
||||
assert result1["activity_count"] == 5
|
||||
|
||||
# Load second file (empty)
|
||||
result2 = await load_xer(file_path=str(sample_xer_empty))
|
||||
assert result2["activity_count"] == 0
|
||||
|
||||
async def test_load_returns_plan_dates(self, sample_xer_single_project: Path) -> None:
|
||||
"""load_xer returns project plan start and end dates."""
|
||||
from xer_mcp.tools.load_xer import load_xer
|
||||
|
||||
result = await load_xer(file_path=str(sample_xer_single_project))
|
||||
|
||||
assert "plan_start_date" in result["project"]
|
||||
assert "plan_end_date" in result["project"]
|
||||
# Dates should be ISO8601 format
|
||||
assert "T" in result["project"]["plan_start_date"]
|
||||
1
tests/integration/__init__.py
Normal file
1
tests/integration/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Integration tests for XER MCP Server."""
|
||||
154
tests/integration/test_xer_parsing.py
Normal file
154
tests/integration/test_xer_parsing.py
Normal file
@@ -0,0 +1,154 @@
|
||||
"""Integration tests for XER parsing and database loading."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestXerParsing:
|
||||
"""Integration tests for parsing XER files and loading into database."""
|
||||
|
||||
def test_load_single_project_xer(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should parse XER and load data into SQLite database."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Load all data for the single project
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
# Verify data in database
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM projects")
|
||||
assert cur.fetchone()[0] == 1
|
||||
|
||||
cur.execute("SELECT COUNT(*) FROM activities")
|
||||
assert cur.fetchone()[0] == 5
|
||||
|
||||
cur.execute("SELECT COUNT(*) FROM relationships")
|
||||
assert cur.fetchone()[0] == 5
|
||||
|
||||
cur.execute("SELECT COUNT(*) FROM wbs")
|
||||
assert cur.fetchone()[0] == 3
|
||||
|
||||
def test_load_preserves_date_precision(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should preserve date/time precision from XER file."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT target_start_date FROM activities WHERE task_code = ?", ("A1010",))
|
||||
date_str = cur.fetchone()[0]
|
||||
# Should be ISO8601 with time component
|
||||
assert "T" in date_str
|
||||
assert "07:00" in date_str
|
||||
|
||||
def test_load_activities_indexed_by_type(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should be able to efficiently query activities by type."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
with db.cursor() as cur:
|
||||
# Query milestones
|
||||
cur.execute("SELECT COUNT(*) FROM activities WHERE task_type = ?", ("TT_Mile",))
|
||||
milestone_count = cur.fetchone()[0]
|
||||
assert milestone_count == 2
|
||||
|
||||
# Query tasks
|
||||
cur.execute("SELECT COUNT(*) FROM activities WHERE task_type = ?", ("TT_Task",))
|
||||
task_count = cur.fetchone()[0]
|
||||
assert task_count == 3
|
||||
|
||||
def test_load_critical_path_activities(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should be able to query critical path activities via index."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities WHERE driving_path_flag = 1")
|
||||
critical_count = cur.fetchone()[0]
|
||||
# Activities A1000, A1010, A1030, A1040 are on critical path
|
||||
assert critical_count == 4
|
||||
|
||||
def test_load_replaces_previous_data(self, sample_xer_single_project: Path) -> None:
|
||||
"""Loading a new file should replace previous data."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Load first time
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities")
|
||||
first_count = cur.fetchone()[0]
|
||||
|
||||
# Clear and load again
|
||||
db.clear()
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM activities")
|
||||
second_count = cur.fetchone()[0]
|
||||
|
||||
assert first_count == second_count
|
||||
|
||||
|
||||
class TestMultiProjectHandling:
|
||||
"""Integration tests for multi-project XER file handling."""
|
||||
|
||||
def test_load_selected_project_from_multi(self, sample_xer_multi_project: Path) -> None:
|
||||
"""Should load only the selected project from multi-project file."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_multi_project)
|
||||
|
||||
# Load only Project Alpha
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
with db.cursor() as cur:
|
||||
cur.execute("SELECT proj_short_name FROM projects")
|
||||
names = [row[0] for row in cur.fetchall()]
|
||||
assert names == ["Project Alpha"]
|
||||
|
||||
cur.execute("SELECT COUNT(*) FROM activities WHERE proj_id = ?", ("1001",))
|
||||
assert cur.fetchone()[0] == 1
|
||||
|
||||
def test_multi_project_list_available(self, sample_xer_multi_project: Path) -> None:
|
||||
"""Parser should report all available projects."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_multi_project)
|
||||
|
||||
assert len(parsed.projects) == 2
|
||||
proj_ids = {p["proj_id"] for p in parsed.projects}
|
||||
assert proj_ids == {"1001", "1002"}
|
||||
1
tests/unit/__init__.py
Normal file
1
tests/unit/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
"""Unit tests for XER MCP Server."""
|
||||
111
tests/unit/test_db_queries.py
Normal file
111
tests/unit/test_db_queries.py
Normal file
@@ -0,0 +1,111 @@
|
||||
"""Unit tests for database query functions."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from xer_mcp.db import db
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_db():
|
||||
"""Initialize and clear database for each test."""
|
||||
db.initialize()
|
||||
yield
|
||||
db.clear()
|
||||
|
||||
|
||||
class TestActivityQueries:
|
||||
"""Tests for activity query functions."""
|
||||
|
||||
def test_query_activities_with_pagination(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should return paginated activity results."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.db.queries import query_activities
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
activities, total = query_activities(limit=2, offset=0)
|
||||
|
||||
assert len(activities) == 2
|
||||
assert total == 5
|
||||
|
||||
def test_query_activities_filter_by_type(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should filter activities by task type."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.db.queries import query_activities
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
activities, total = query_activities(activity_type="TT_Mile")
|
||||
|
||||
assert total == 2
|
||||
for act in activities:
|
||||
assert act["task_type"] == "TT_Mile"
|
||||
|
||||
def test_query_activities_filter_by_date_range(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should filter activities by date range."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.db.queries import query_activities
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
# Filter to very narrow range
|
||||
activities, total = query_activities(start_date="2026-01-01", end_date="2026-01-01")
|
||||
|
||||
# Only activities starting on 2026-01-01
|
||||
for act in activities:
|
||||
assert "2026-01-01" in act["target_start_date"]
|
||||
|
||||
def test_query_activities_filter_by_wbs(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should filter activities by WBS ID."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.db.queries import query_activities
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
activities, total = query_activities(wbs_id="102")
|
||||
|
||||
# WBS 102 has 2 activities
|
||||
assert total == 2
|
||||
|
||||
def test_get_activity_by_id(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should return single activity by ID."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.db.queries import get_activity_by_id
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
activity = get_activity_by_id("2002")
|
||||
|
||||
assert activity is not None
|
||||
assert activity["task_code"] == "A1010"
|
||||
|
||||
def test_get_activity_by_id_not_found(self, sample_xer_single_project: Path) -> None:
|
||||
"""Should return None for non-existent activity."""
|
||||
from xer_mcp.db.loader import load_parsed_data
|
||||
from xer_mcp.db.queries import get_activity_by_id
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
parsed = parser.parse(sample_xer_single_project)
|
||||
load_parsed_data(parsed, project_id="1001")
|
||||
|
||||
activity = get_activity_by_id("nonexistent")
|
||||
|
||||
assert activity is None
|
||||
146
tests/unit/test_parser.py
Normal file
146
tests/unit/test_parser.py
Normal file
@@ -0,0 +1,146 @@
|
||||
"""Unit tests for XER parser."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class TestXerParser:
|
||||
"""Tests for the XER file parser."""
|
||||
|
||||
def test_parse_single_project_file(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should extract project data from single-project XER file."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
assert len(result.projects) == 1
|
||||
assert result.projects[0]["proj_id"] == "1001"
|
||||
assert result.projects[0]["proj_short_name"] == "Test Project"
|
||||
|
||||
def test_parse_multi_project_file(self, sample_xer_multi_project: Path) -> None:
|
||||
"""Parser should extract all projects from multi-project XER file."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_multi_project)
|
||||
|
||||
assert len(result.projects) == 2
|
||||
project_names = {p["proj_short_name"] for p in result.projects}
|
||||
assert project_names == {"Project Alpha", "Project Beta"}
|
||||
|
||||
def test_parse_activities(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should extract activities from XER file."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Single project fixture has 5 activities
|
||||
assert len(result.tasks) == 5
|
||||
|
||||
# Check first milestone
|
||||
milestone = next(t for t in result.tasks if t["task_code"] == "A1000")
|
||||
assert milestone["task_name"] == "Project Start"
|
||||
assert milestone["task_type"] == "TT_Mile"
|
||||
|
||||
def test_parse_relationships(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should extract relationships from XER file."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Single project fixture has 5 relationships
|
||||
assert len(result.taskpreds) == 5
|
||||
|
||||
# Check a FS relationship
|
||||
fs_rel = next(r for r in result.taskpreds if r["pred_type"] == "PR_FS")
|
||||
assert fs_rel["lag_hr_cnt"] == 0
|
||||
|
||||
# Check a SS relationship
|
||||
ss_rel = next(r for r in result.taskpreds if r["pred_type"] == "PR_SS")
|
||||
assert ss_rel["lag_hr_cnt"] == 40
|
||||
|
||||
def test_parse_wbs(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should extract WBS hierarchy from XER file."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Single project fixture has 3 WBS elements
|
||||
assert len(result.projwbs) == 3
|
||||
|
||||
# Check root WBS
|
||||
root = next(w for w in result.projwbs if w["wbs_short_name"] == "ROOT")
|
||||
assert root["parent_wbs_id"] is None or root["parent_wbs_id"] == ""
|
||||
|
||||
def test_parse_calendars(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should extract calendars from XER file."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Single project fixture has 1 calendar
|
||||
assert len(result.calendars) == 1
|
||||
cal = result.calendars[0]
|
||||
assert cal["clndr_name"] == "Standard 5 Day"
|
||||
assert cal["day_hr_cnt"] == 8
|
||||
|
||||
def test_parse_empty_project(self, sample_xer_empty: Path) -> None:
|
||||
"""Parser should handle XER file with no activities."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_empty)
|
||||
|
||||
assert len(result.projects) == 1
|
||||
assert len(result.tasks) == 0
|
||||
assert len(result.taskpreds) == 0
|
||||
|
||||
def test_parse_invalid_file_raises_error(self, invalid_xer_file: Path) -> None:
|
||||
"""Parser should raise ParseError for invalid XER content."""
|
||||
from xer_mcp.errors import ParseError
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
with pytest.raises(ParseError):
|
||||
parser.parse(invalid_xer_file)
|
||||
|
||||
def test_parse_nonexistent_file_raises_error(self, nonexistent_xer_path: Path) -> None:
|
||||
"""Parser should raise FileNotFoundError for missing file."""
|
||||
from xer_mcp.errors import FileNotFoundError
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
with pytest.raises(FileNotFoundError):
|
||||
parser.parse(nonexistent_xer_path)
|
||||
|
||||
def test_parse_dates_converted_to_iso8601(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should convert XER dates to ISO8601 format."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
# Check date conversion (XER: "2026-01-01 07:00" -> ISO: "2026-01-01T07:00:00")
|
||||
task = next(t for t in result.tasks if t["task_code"] == "A1000")
|
||||
assert "T" in task["target_start_date"]
|
||||
|
||||
def test_parse_driving_path_flag(self, sample_xer_single_project: Path) -> None:
|
||||
"""Parser should correctly parse driving_path_flag as boolean."""
|
||||
from xer_mcp.parser.xer_parser import XerParser
|
||||
|
||||
parser = XerParser()
|
||||
result = parser.parse(sample_xer_single_project)
|
||||
|
||||
# A1000 has driving_path_flag = Y
|
||||
critical_task = next(t for t in result.tasks if t["task_code"] == "A1000")
|
||||
assert critical_task["driving_path_flag"] is True
|
||||
|
||||
# A1020 has driving_path_flag = N
|
||||
non_critical = next(t for t in result.tasks if t["task_code"] == "A1020")
|
||||
assert non_critical["driving_path_flag"] is False
|
||||
192
tests/unit/test_table_handlers.py
Normal file
192
tests/unit/test_table_handlers.py
Normal file
@@ -0,0 +1,192 @@
|
||||
"""Unit tests for XER table handlers."""
|
||||
|
||||
|
||||
class TestProjectHandler:
|
||||
"""Tests for PROJECT table handler."""
|
||||
|
||||
def test_parse_project_row(self) -> None:
|
||||
"""Handler should parse PROJECT row correctly."""
|
||||
from xer_mcp.parser.table_handlers.project import ProjectHandler
|
||||
|
||||
handler = ProjectHandler()
|
||||
|
||||
# Minimal PROJECT fields
|
||||
fields = [
|
||||
"proj_id",
|
||||
"proj_short_name",
|
||||
"plan_start_date",
|
||||
"plan_end_date",
|
||||
]
|
||||
values = ["1001", "Test Project", "2026-01-01 00:00", "2026-06-30 00:00"]
|
||||
|
||||
result = handler.parse_row(fields, values)
|
||||
|
||||
assert result is not None
|
||||
assert result["proj_id"] == "1001"
|
||||
assert result["proj_short_name"] == "Test Project"
|
||||
assert result["plan_start_date"] == "2026-01-01T00:00:00"
|
||||
assert result["plan_end_date"] == "2026-06-30T00:00:00"
|
||||
|
||||
def test_table_name(self) -> None:
|
||||
"""Handler should report correct table name."""
|
||||
from xer_mcp.parser.table_handlers.project import ProjectHandler
|
||||
|
||||
handler = ProjectHandler()
|
||||
assert handler.table_name == "PROJECT"
|
||||
|
||||
|
||||
class TestTaskHandler:
|
||||
"""Tests for TASK table handler."""
|
||||
|
||||
def test_parse_task_row(self) -> None:
|
||||
"""Handler should parse TASK row correctly."""
|
||||
from xer_mcp.parser.table_handlers.task import TaskHandler
|
||||
|
||||
handler = TaskHandler()
|
||||
|
||||
fields = [
|
||||
"task_id",
|
||||
"proj_id",
|
||||
"wbs_id",
|
||||
"task_code",
|
||||
"task_name",
|
||||
"task_type",
|
||||
"status_code",
|
||||
"target_start_date",
|
||||
"target_end_date",
|
||||
"total_float_hr_cnt",
|
||||
"driving_path_flag",
|
||||
]
|
||||
values = [
|
||||
"2001",
|
||||
"1001",
|
||||
"100",
|
||||
"A1000",
|
||||
"Site Prep",
|
||||
"TT_Task",
|
||||
"TK_NotStart",
|
||||
"2026-01-02 07:00",
|
||||
"2026-01-08 15:00",
|
||||
"0",
|
||||
"Y",
|
||||
]
|
||||
|
||||
result = handler.parse_row(fields, values)
|
||||
|
||||
assert result is not None
|
||||
assert result["task_id"] == "2001"
|
||||
assert result["task_code"] == "A1000"
|
||||
assert result["task_type"] == "TT_Task"
|
||||
assert result["driving_path_flag"] is True
|
||||
assert result["total_float_hr_cnt"] == 0.0
|
||||
|
||||
def test_table_name(self) -> None:
|
||||
"""Handler should report correct table name."""
|
||||
from xer_mcp.parser.table_handlers.task import TaskHandler
|
||||
|
||||
handler = TaskHandler()
|
||||
assert handler.table_name == "TASK"
|
||||
|
||||
|
||||
class TestTaskpredHandler:
|
||||
"""Tests for TASKPRED table handler."""
|
||||
|
||||
def test_parse_relationship_row(self) -> None:
|
||||
"""Handler should parse TASKPRED row correctly."""
|
||||
from xer_mcp.parser.table_handlers.taskpred import TaskpredHandler
|
||||
|
||||
handler = TaskpredHandler()
|
||||
|
||||
fields = [
|
||||
"task_pred_id",
|
||||
"task_id",
|
||||
"pred_task_id",
|
||||
"proj_id",
|
||||
"pred_proj_id",
|
||||
"pred_type",
|
||||
"lag_hr_cnt",
|
||||
]
|
||||
values = ["3001", "2002", "2001", "1001", "1001", "PR_FS", "8"]
|
||||
|
||||
result = handler.parse_row(fields, values)
|
||||
|
||||
assert result is not None
|
||||
assert result["task_pred_id"] == "3001"
|
||||
assert result["task_id"] == "2002"
|
||||
assert result["pred_task_id"] == "2001"
|
||||
assert result["pred_type"] == "PR_FS"
|
||||
assert result["lag_hr_cnt"] == 8.0
|
||||
|
||||
def test_table_name(self) -> None:
|
||||
"""Handler should report correct table name."""
|
||||
from xer_mcp.parser.table_handlers.taskpred import TaskpredHandler
|
||||
|
||||
handler = TaskpredHandler()
|
||||
assert handler.table_name == "TASKPRED"
|
||||
|
||||
|
||||
class TestProjwbsHandler:
|
||||
"""Tests for PROJWBS table handler."""
|
||||
|
||||
def test_parse_wbs_row(self) -> None:
|
||||
"""Handler should parse PROJWBS row correctly."""
|
||||
from xer_mcp.parser.table_handlers.projwbs import ProjwbsHandler
|
||||
|
||||
handler = ProjwbsHandler()
|
||||
|
||||
fields = [
|
||||
"wbs_id",
|
||||
"proj_id",
|
||||
"parent_wbs_id",
|
||||
"wbs_short_name",
|
||||
"wbs_name",
|
||||
]
|
||||
values = ["100", "1001", "", "ROOT", "Project Root"]
|
||||
|
||||
result = handler.parse_row(fields, values)
|
||||
|
||||
assert result is not None
|
||||
assert result["wbs_id"] == "100"
|
||||
assert result["proj_id"] == "1001"
|
||||
assert result["parent_wbs_id"] == ""
|
||||
assert result["wbs_short_name"] == "ROOT"
|
||||
|
||||
def test_table_name(self) -> None:
|
||||
"""Handler should report correct table name."""
|
||||
from xer_mcp.parser.table_handlers.projwbs import ProjwbsHandler
|
||||
|
||||
handler = ProjwbsHandler()
|
||||
assert handler.table_name == "PROJWBS"
|
||||
|
||||
|
||||
class TestCalendarHandler:
|
||||
"""Tests for CALENDAR table handler."""
|
||||
|
||||
def test_parse_calendar_row(self) -> None:
|
||||
"""Handler should parse CALENDAR row correctly."""
|
||||
from xer_mcp.parser.table_handlers.calendar import CalendarHandler
|
||||
|
||||
handler = CalendarHandler()
|
||||
|
||||
fields = [
|
||||
"clndr_id",
|
||||
"clndr_name",
|
||||
"day_hr_cnt",
|
||||
"week_hr_cnt",
|
||||
]
|
||||
values = ["1", "Standard 5 Day", "8", "40"]
|
||||
|
||||
result = handler.parse_row(fields, values)
|
||||
|
||||
assert result is not None
|
||||
assert result["clndr_id"] == "1"
|
||||
assert result["clndr_name"] == "Standard 5 Day"
|
||||
assert result["day_hr_cnt"] == 8.0
|
||||
assert result["week_hr_cnt"] == 40.0
|
||||
|
||||
def test_table_name(self) -> None:
|
||||
"""Handler should report correct table name."""
|
||||
from xer_mcp.parser.table_handlers.calendar import CalendarHandler
|
||||
|
||||
handler = CalendarHandler()
|
||||
assert handler.table_name == "CALENDAR"
|
||||
601
uv.lock
generated
Normal file
601
uv.lock
generated
Normal file
@@ -0,0 +1,601 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.14"
|
||||
|
||||
[[package]]
|
||||
name = "annotated-types"
|
||||
version = "0.7.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyio"
|
||||
version = "4.12.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "idna" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "25.4.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6b/5c/685e6633917e101e5dcb62b9dd76946cbb57c26e133bae9e0cd36033c0a9/attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11", size = 934251, upload-time = "2025-10-06T13:54:44.725Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3a/2a/7cc015f5b9f5db42b7d48157e23356022889fc354a2813c15934b7cb5c0e/attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373", size = 67615, upload-time = "2025-10-06T13:54:43.17Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2026.1.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e0/2d/a891ca51311197f6ad14a7ef42e2399f36cf2f9bd44752b3dc4eab60fdc5/certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120", size = 154268, upload-time = "2026-01-04T02:42:41.825Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/ad/3cc14f097111b4de0040c83a525973216457bbeeb63739ef1ed275c1c021/certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c", size = 152900, upload-time = "2026-01-04T02:42:40.15Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cffi"
|
||||
version = "2.0.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pycparser", marker = "implementation_name != 'PyPy'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/eb/56/b1ba7935a17738ae8453301356628e8147c79dbb825bcbc73dc7401f9846/cffi-2.0.0.tar.gz", hash = "sha256:44d1b5909021139fe36001ae048dbdde8214afa20200eda0f64c068cac5d5529", size = 523588, upload-time = "2025-09-08T23:24:04.541Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/92/c4/3ce07396253a83250ee98564f8d7e9789fab8e58858f35d07a9a2c78de9f/cffi-2.0.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:fc33c5141b55ed366cfaad382df24fe7dcbc686de5be719b207bb248e3053dc5", size = 185320, upload-time = "2025-09-08T23:23:18.087Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/dd/27e9fa567a23931c838c6b02d0764611c62290062a6d4e8ff7863daf9730/cffi-2.0.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c654de545946e0db659b3400168c9ad31b5d29593291482c43e3564effbcee13", size = 181487, upload-time = "2025-09-08T23:23:19.622Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/43/0e822876f87ea8a4ef95442c3d766a06a51fc5298823f884ef87aaad168c/cffi-2.0.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:24b6f81f1983e6df8db3adc38562c83f7d4a0c36162885ec7f7b77c7dcbec97b", size = 220049, upload-time = "2025-09-08T23:23:20.853Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b4/89/76799151d9c2d2d1ead63c2429da9ea9d7aac304603de0c6e8764e6e8e70/cffi-2.0.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:12873ca6cb9b0f0d3a0da705d6086fe911591737a59f28b7936bdfed27c0d47c", size = 207793, upload-time = "2025-09-08T23:23:22.08Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/dd/3465b14bb9e24ee24cb88c9e3730f6de63111fffe513492bf8c808a3547e/cffi-2.0.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:d9b97165e8aed9272a6bb17c01e3cc5871a594a446ebedc996e2397a1c1ea8ef", size = 206300, upload-time = "2025-09-08T23:23:23.314Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/47/d9/d83e293854571c877a92da46fdec39158f8d7e68da75bf73581225d28e90/cffi-2.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:afb8db5439b81cf9c9d0c80404b60c3cc9c3add93e114dcae767f1477cb53775", size = 219244, upload-time = "2025-09-08T23:23:24.541Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/0f/1f177e3683aead2bb00f7679a16451d302c436b5cbf2505f0ea8146ef59e/cffi-2.0.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:737fe7d37e1a1bffe70bd5754ea763a62a066dc5913ca57e957824b72a85e205", size = 222828, upload-time = "2025-09-08T23:23:26.143Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/0f/cafacebd4b040e3119dcb32fed8bdef8dfe94da653155f9d0b9dc660166e/cffi-2.0.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:38100abb9d1b1435bc4cc340bb4489635dc2f0da7456590877030c9b3d40b0c1", size = 220926, upload-time = "2025-09-08T23:23:27.873Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/aa/df335faa45b395396fcbc03de2dfcab242cd61a9900e914fe682a59170b1/cffi-2.0.0-cp314-cp314-win32.whl", hash = "sha256:087067fa8953339c723661eda6b54bc98c5625757ea62e95eb4898ad5e776e9f", size = 175328, upload-time = "2025-09-08T23:23:44.61Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/92/882c2d30831744296ce713f0feb4c1cd30f346ef747b530b5318715cc367/cffi-2.0.0-cp314-cp314-win_amd64.whl", hash = "sha256:203a48d1fb583fc7d78a4c6655692963b860a417c0528492a6bc21f1aaefab25", size = 185650, upload-time = "2025-09-08T23:23:45.848Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9f/2c/98ece204b9d35a7366b5b2c6539c350313ca13932143e79dc133ba757104/cffi-2.0.0-cp314-cp314-win_arm64.whl", hash = "sha256:dbd5c7a25a7cb98f5ca55d258b103a2054f859a46ae11aaf23134f9cc0d356ad", size = 180687, upload-time = "2025-09-08T23:23:47.105Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/61/c768e4d548bfa607abcda77423448df8c471f25dbe64fb2ef6d555eae006/cffi-2.0.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:9a67fc9e8eb39039280526379fb3a70023d77caec1852002b4da7e8b270c4dd9", size = 188773, upload-time = "2025-09-08T23:23:29.347Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/ea/5f76bce7cf6fcd0ab1a1058b5af899bfbef198bea4d5686da88471ea0336/cffi-2.0.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7a66c7204d8869299919db4d5069a82f1561581af12b11b3c9f48c584eb8743d", size = 185013, upload-time = "2025-09-08T23:23:30.63Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/be/b4/c56878d0d1755cf9caa54ba71e5d049479c52f9e4afc230f06822162ab2f/cffi-2.0.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7cc09976e8b56f8cebd752f7113ad07752461f48a58cbba644139015ac24954c", size = 221593, upload-time = "2025-09-08T23:23:31.91Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e0/0d/eb704606dfe8033e7128df5e90fee946bbcb64a04fcdaa97321309004000/cffi-2.0.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:92b68146a71df78564e4ef48af17551a5ddd142e5190cdf2c5624d0c3ff5b2e8", size = 209354, upload-time = "2025-09-08T23:23:33.214Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/19/3c435d727b368ca475fb8742ab97c9cb13a0de600ce86f62eab7fa3eea60/cffi-2.0.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b1e74d11748e7e98e2f426ab176d4ed720a64412b6a15054378afdb71e0f37dc", size = 208480, upload-time = "2025-09-08T23:23:34.495Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/44/681604464ed9541673e486521497406fadcc15b5217c3e326b061696899a/cffi-2.0.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:28a3a209b96630bca57cce802da70c266eb08c6e97e5afd61a75611ee6c64592", size = 221584, upload-time = "2025-09-08T23:23:36.096Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/25/8e/342a504ff018a2825d395d44d63a767dd8ebc927ebda557fecdaca3ac33a/cffi-2.0.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7553fb2090d71822f02c629afe6042c299edf91ba1bf94951165613553984512", size = 224443, upload-time = "2025-09-08T23:23:37.328Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e1/5e/b666bacbbc60fbf415ba9988324a132c9a7a0448a9a8f125074671c0f2c3/cffi-2.0.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6c6c373cfc5c83a975506110d17457138c8c63016b563cc9ed6e056a82f13ce4", size = 223437, upload-time = "2025-09-08T23:23:38.945Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/1d/ec1a60bd1a10daa292d3cd6bb0b359a81607154fb8165f3ec95fe003b85c/cffi-2.0.0-cp314-cp314t-win32.whl", hash = "sha256:1fc9ea04857caf665289b7a75923f2c6ed559b8298a1b8c49e59f7dd95c8481e", size = 180487, upload-time = "2025-09-08T23:23:40.423Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/41/4c1168c74fac325c0c8156f04b6749c8b6a8f405bbf91413ba088359f60d/cffi-2.0.0-cp314-cp314t-win_amd64.whl", hash = "sha256:d68b6cef7827e8641e8ef16f4494edda8b36104d79773a334beaa1e3521430f6", size = 191726, upload-time = "2025-09-08T23:23:41.742Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ae/3a/dbeec9d1ee0844c679f6bb5d6ad4e9f198b1224f4e7a32825f47f6192b0c/cffi-2.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0a1527a803f0a659de1af2e1fd700213caba79377e27e4693648c2923da066f9", size = 184195, upload-time = "2025-09-08T23:23:43.004Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.3.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/3d/fa/656b739db8587d7b5dfa22e22ed02566950fbfbcdc20311993483657a5c0/click-8.3.1.tar.gz", hash = "sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a", size = 295065, upload-time = "2025-11-15T20:45:42.706Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/98/78/01c019cdb5d6498122777c1a43056ebb3ebfeef2076d9d026bfe15583b2b/click-8.3.1-py3-none-any.whl", hash = "sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6", size = 108274, upload-time = "2025-11-15T20:45:41.139Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cryptography"
|
||||
version = "46.0.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cffi", marker = "platform_python_implementation != 'PyPy'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9f/33/c00162f49c0e2fe8064a62cb92b93e50c74a72bc370ab92f86112b33ff62/cryptography-46.0.3.tar.gz", hash = "sha256:a8b17438104fed022ce745b362294d9ce35b4c2e45c1d958ad4a4b019285f4a1", size = 749258, upload-time = "2025-10-15T23:18:31.74Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/1d/42/9c391dd801d6cf0d561b5890549d4b27bafcc53b39c31a817e69d87c625b/cryptography-46.0.3-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:109d4ddfadf17e8e7779c39f9b18111a09efb969a301a31e987416a0191ed93a", size = 7225004, upload-time = "2025-10-15T23:16:52.239Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1c/67/38769ca6b65f07461eb200e85fc1639b438bdc667be02cf7f2cd6a64601c/cryptography-46.0.3-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:09859af8466b69bc3c27bdf4f5d84a665e0f7ab5088412e9e2ec49758eca5cbc", size = 4296667, upload-time = "2025-10-15T23:16:54.369Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/49/498c86566a1d80e978b42f0d702795f69887005548c041636df6ae1ca64c/cryptography-46.0.3-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:01ca9ff2885f3acc98c29f1860552e37f6d7c7d013d7334ff2a9de43a449315d", size = 4450807, upload-time = "2025-10-15T23:16:56.414Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4b/0a/863a3604112174c8624a2ac3c038662d9e59970c7f926acdcfaed8d61142/cryptography-46.0.3-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:6eae65d4c3d33da080cff9c4ab1f711b15c1d9760809dad6ea763f3812d254cb", size = 4299615, upload-time = "2025-10-15T23:16:58.442Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/02/b73a533f6b64a69f3cd3872acb6ebc12aef924d8d103133bb3ea750dc703/cryptography-46.0.3-cp311-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5bf0ed4490068a2e72ac03d786693adeb909981cc596425d09032d372bcc849", size = 4016800, upload-time = "2025-10-15T23:17:00.378Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/25/d5/16e41afbfa450cde85a3b7ec599bebefaef16b5c6ba4ec49a3532336ed72/cryptography-46.0.3-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:5ecfccd2329e37e9b7112a888e76d9feca2347f12f37918facbb893d7bb88ee8", size = 4984707, upload-time = "2025-10-15T23:17:01.98Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/56/e7e69b427c3878352c2fb9b450bd0e19ed552753491d39d7d0a2f5226d41/cryptography-46.0.3-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a2c0cd47381a3229c403062f764160d57d4d175e022c1df84e168c6251a22eec", size = 4482541, upload-time = "2025-10-15T23:17:04.078Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/f6/50736d40d97e8483172f1bb6e698895b92a223dba513b0ca6f06b2365339/cryptography-46.0.3-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:549e234ff32571b1f4076ac269fcce7a808d3bf98b76c8dd560e42dbc66d7d91", size = 4299464, upload-time = "2025-10-15T23:17:05.483Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/00/de/d8e26b1a855f19d9994a19c702fa2e93b0456beccbcfe437eda00e0701f2/cryptography-46.0.3-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:c0a7bb1a68a5d3471880e264621346c48665b3bf1c3759d682fc0864c540bd9e", size = 4950838, upload-time = "2025-10-15T23:17:07.425Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8f/29/798fc4ec461a1c9e9f735f2fc58741b0daae30688f41b2497dcbc9ed1355/cryptography-46.0.3-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:10b01676fc208c3e6feeb25a8b83d81767e8059e1fe86e1dc62d10a3018fa926", size = 4481596, upload-time = "2025-10-15T23:17:09.343Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/15/8d/03cd48b20a573adfff7652b76271078e3045b9f49387920e7f1f631d125e/cryptography-46.0.3-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0abf1ffd6e57c67e92af68330d05760b7b7efb243aab8377e583284dbab72c71", size = 4426782, upload-time = "2025-10-15T23:17:11.22Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fa/b1/ebacbfe53317d55cf33165bda24c86523497a6881f339f9aae5c2e13e57b/cryptography-46.0.3-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a04bee9ab6a4da801eb9b51f1b708a1b5b5c9eb48c03f74198464c66f0d344ac", size = 4698381, upload-time = "2025-10-15T23:17:12.829Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/92/8a6a9525893325fc057a01f654d7efc2c64b9de90413adcf605a85744ff4/cryptography-46.0.3-cp311-abi3-win32.whl", hash = "sha256:f260d0d41e9b4da1ed1e0f1ce571f97fe370b152ab18778e9e8f67d6af432018", size = 3055988, upload-time = "2025-10-15T23:17:14.65Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/bf/80fbf45253ea585a1e492a6a17efcb93467701fa79e71550a430c5e60df0/cryptography-46.0.3-cp311-abi3-win_amd64.whl", hash = "sha256:a9a3008438615669153eb86b26b61e09993921ebdd75385ddd748702c5adfddb", size = 3514451, upload-time = "2025-10-15T23:17:16.142Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2e/af/9b302da4c87b0beb9db4e756386a7c6c5b8003cd0e742277888d352ae91d/cryptography-46.0.3-cp311-abi3-win_arm64.whl", hash = "sha256:5d7f93296ee28f68447397bf5198428c9aeeab45705a55d53a6343455dcb2c3c", size = 2928007, upload-time = "2025-10-15T23:17:18.04Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f5/e2/a510aa736755bffa9d2f75029c229111a1d02f8ecd5de03078f4c18d91a3/cryptography-46.0.3-cp314-cp314t-macosx_10_9_universal2.whl", hash = "sha256:00a5e7e87938e5ff9ff5447ab086a5706a957137e6e433841e9d24f38a065217", size = 7158012, upload-time = "2025-10-15T23:17:19.982Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/73/dc/9aa866fbdbb95b02e7f9d086f1fccfeebf8953509b87e3f28fff927ff8a0/cryptography-46.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c8daeb2d2174beb4575b77482320303f3d39b8e81153da4f0fb08eb5fe86a6c5", size = 4288728, upload-time = "2025-10-15T23:17:21.527Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c5/fd/bc1daf8230eaa075184cbbf5f8cd00ba9db4fd32d63fb83da4671b72ed8a/cryptography-46.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:39b6755623145ad5eff1dab323f4eae2a32a77a7abef2c5089a04a3d04366715", size = 4435078, upload-time = "2025-10-15T23:17:23.042Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/82/98/d3bd5407ce4c60017f8ff9e63ffee4200ab3e23fe05b765cab805a7db008/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:db391fa7c66df6762ee3f00c95a89e6d428f4d60e7abc8328f4fe155b5ac6e54", size = 4293460, upload-time = "2025-10-15T23:17:24.885Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/e9/e23e7900983c2b8af7a08098db406cf989d7f09caea7897e347598d4cd5b/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:78a97cf6a8839a48c49271cdcbd5cf37ca2c1d6b7fdd86cc864f302b5e9bf459", size = 3995237, upload-time = "2025-10-15T23:17:26.449Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/15/af68c509d4a138cfe299d0d7ddb14afba15233223ebd933b4bbdbc7155d3/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:dfb781ff7eaa91a6f7fd41776ec37c5853c795d3b358d4896fdbb5df168af422", size = 4967344, upload-time = "2025-10-15T23:17:28.06Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ca/e3/8643d077c53868b681af077edf6b3cb58288b5423610f21c62aadcbe99f4/cryptography-46.0.3-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:6f61efb26e76c45c4a227835ddeae96d83624fb0d29eb5df5b96e14ed1a0afb7", size = 4466564, upload-time = "2025-10-15T23:17:29.665Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0e/43/c1e8726fa59c236ff477ff2b5dc071e54b21e5a1e51aa2cee1676f1c986f/cryptography-46.0.3-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:23b1a8f26e43f47ceb6d6a43115f33a5a37d57df4ea0ca295b780ae8546e8044", size = 4292415, upload-time = "2025-10-15T23:17:31.686Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/f9/2f8fefdb1aee8a8e3256a0568cffc4e6d517b256a2fe97a029b3f1b9fe7e/cryptography-46.0.3-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:b419ae593c86b87014b9be7396b385491ad7f320bde96826d0dd174459e54665", size = 4931457, upload-time = "2025-10-15T23:17:33.478Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/79/30/9b54127a9a778ccd6d27c3da7563e9f2d341826075ceab89ae3b41bf5be2/cryptography-46.0.3-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:50fc3343ac490c6b08c0cf0d704e881d0d660be923fd3076db3e932007e726e3", size = 4466074, upload-time = "2025-10-15T23:17:35.158Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/68/b4f4a10928e26c941b1b6a179143af9f4d27d88fe84a6a3c53592d2e76bf/cryptography-46.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:22d7e97932f511d6b0b04f2bfd818d73dcd5928db509460aaf48384778eb6d20", size = 4420569, upload-time = "2025-10-15T23:17:37.188Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a3/49/3746dab4c0d1979888f125226357d3262a6dd40e114ac29e3d2abdf1ec55/cryptography-46.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:d55f3dffadd674514ad19451161118fd010988540cee43d8bc20675e775925de", size = 4681941, upload-time = "2025-10-15T23:17:39.236Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/30/27654c1dbaf7e4a3531fa1fc77986d04aefa4d6d78259a62c9dc13d7ad36/cryptography-46.0.3-cp314-cp314t-win32.whl", hash = "sha256:8a6e050cb6164d3f830453754094c086ff2d0b2f3a897a1d9820f6139a1f0914", size = 3022339, upload-time = "2025-10-15T23:17:40.888Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f6/30/640f34ccd4d2a1bc88367b54b926b781b5a018d65f404d409aba76a84b1c/cryptography-46.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:760f83faa07f8b64e9c33fc963d790a2edb24efb479e3520c14a45741cd9b2db", size = 3494315, upload-time = "2025-10-15T23:17:42.769Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/8b/88cc7e3bd0a8e7b861f26981f7b820e1f46aa9d26cc482d0feba0ecb4919/cryptography-46.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:516ea134e703e9fe26bcd1277a4b59ad30586ea90c365a87781d7887a646fe21", size = 2919331, upload-time = "2025-10-15T23:17:44.468Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/23/45fe7f376a7df8daf6da3556603b36f53475a99ce4faacb6ba2cf3d82021/cryptography-46.0.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:cb3d760a6117f621261d662bccc8ef5bc32ca673e037c83fbe565324f5c46936", size = 7218248, upload-time = "2025-10-15T23:17:46.294Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/32/b68d27471372737054cbd34c84981f9edbc24fe67ca225d389799614e27f/cryptography-46.0.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4b7387121ac7d15e550f5cb4a43aef2559ed759c35df7336c402bb8275ac9683", size = 4294089, upload-time = "2025-10-15T23:17:48.269Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/26/42/fa8389d4478368743e24e61eea78846a0006caffaf72ea24a15159215a14/cryptography-46.0.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:15ab9b093e8f09daab0f2159bb7e47532596075139dd74365da52ecc9cb46c5d", size = 4440029, upload-time = "2025-10-15T23:17:49.837Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5f/eb/f483db0ec5ac040824f269e93dd2bd8a21ecd1027e77ad7bdf6914f2fd80/cryptography-46.0.3-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:46acf53b40ea38f9c6c229599a4a13f0d46a6c3fa9ef19fc1a124d62e338dfa0", size = 4297222, upload-time = "2025-10-15T23:17:51.357Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fd/cf/da9502c4e1912cb1da3807ea3618a6829bee8207456fbbeebc361ec38ba3/cryptography-46.0.3-cp38-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:10ca84c4668d066a9878890047f03546f3ae0a6b8b39b697457b7757aaf18dbc", size = 4012280, upload-time = "2025-10-15T23:17:52.964Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6b/8f/9adb86b93330e0df8b3dcf03eae67c33ba89958fc2e03862ef1ac2b42465/cryptography-46.0.3-cp38-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:36e627112085bb3b81b19fed209c05ce2a52ee8b15d161b7c643a7d5a88491f3", size = 4978958, upload-time = "2025-10-15T23:17:54.965Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/a0/5fa77988289c34bdb9f913f5606ecc9ada1adb5ae870bd0d1054a7021cc4/cryptography-46.0.3-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:1000713389b75c449a6e979ffc7dcc8ac90b437048766cef052d4d30b8220971", size = 4473714, upload-time = "2025-10-15T23:17:56.754Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/14/e5/fc82d72a58d41c393697aa18c9abe5ae1214ff6f2a5c18ac470f92777895/cryptography-46.0.3-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:b02cf04496f6576afffef5ddd04a0cb7d49cf6be16a9059d793a30b035f6b6ac", size = 4296970, upload-time = "2025-10-15T23:17:58.588Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/06/5663ed35438d0b09056973994f1aec467492b33bd31da36e468b01ec1097/cryptography-46.0.3-cp38-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:71e842ec9bc7abf543b47cf86b9a743baa95f4677d22baa4c7d5c69e49e9bc04", size = 4940236, upload-time = "2025-10-15T23:18:00.897Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fc/59/873633f3f2dcd8a053b8dd1d38f783043b5fce589c0f6988bf55ef57e43e/cryptography-46.0.3-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:402b58fc32614f00980b66d6e56a5b4118e6cb362ae8f3fda141ba4689bd4506", size = 4472642, upload-time = "2025-10-15T23:18:02.749Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/39/8e71f3930e40f6877737d6f69248cf74d4e34b886a3967d32f919cc50d3b/cryptography-46.0.3-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ef639cb3372f69ec44915fafcd6698b6cc78fbe0c2ea41be867f6ed612811963", size = 4423126, upload-time = "2025-10-15T23:18:04.85Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cd/c7/f65027c2810e14c3e7268353b1681932b87e5a48e65505d8cc17c99e36ae/cryptography-46.0.3-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:3b51b8ca4f1c6453d8829e1eb7299499ca7f313900dd4d89a24b8b87c0a780d4", size = 4686573, upload-time = "2025-10-15T23:18:06.908Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/6e/1c8331ddf91ca4730ab3086a0f1be19c65510a33b5a441cb334e7a2d2560/cryptography-46.0.3-cp38-abi3-win32.whl", hash = "sha256:6276eb85ef938dc035d59b87c8a7dc559a232f954962520137529d77b18ff1df", size = 3036695, upload-time = "2025-10-15T23:18:08.672Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/90/45/b0d691df20633eff80955a0fc7695ff9051ffce8b69741444bd9ed7bd0db/cryptography-46.0.3-cp38-abi3-win_amd64.whl", hash = "sha256:416260257577718c05135c55958b674000baef9a1c7d9e8f306ec60d71db850f", size = 3501720, upload-time = "2025-10-15T23:18:10.632Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/cb/2da4cc83f5edb9c3257d09e1e7ab7b23f049c7962cae8d842bbef0a9cec9/cryptography-46.0.3-cp38-abi3-win_arm64.whl", hash = "sha256:d89c3468de4cdc4f08a57e214384d0471911a3830fcdaf7a8cc587e42a866372", size = 2918740, upload-time = "2025-10-15T23:18:12.277Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h11"
|
||||
version = "0.16.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httpcore"
|
||||
version = "1.0.9"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "certifi" },
|
||||
{ name = "h11" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httpx"
|
||||
version = "0.28.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
{ name = "certifi" },
|
||||
{ name = "httpcore" },
|
||||
{ name = "idna" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httpx-sse"
|
||||
version = "0.4.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0f/4c/751061ffa58615a32c31b2d82e8482be8dd4a89154f003147acee90f2be9/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d", size = 15943, upload-time = "2025-10-10T21:48:22.271Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960, upload-time = "2025-10-10T21:48:21.158Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.11"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
version = "2.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema"
|
||||
version = "4.25.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "jsonschema-specifications" },
|
||||
{ name = "referencing" },
|
||||
{ name = "rpds-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/74/69/f7185de793a29082a9f3c7728268ffb31cb5095131a9c139a74078e27336/jsonschema-4.25.1.tar.gz", hash = "sha256:e4a9655ce0da0c0b67a085847e00a3a51449e1157f4f75e9fb5aa545e122eb85", size = 357342, upload-time = "2025-08-18T17:03:50.038Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/9c/8c95d856233c1f82500c2450b8c68576b4cf1c871db3afac5c34ff84e6fd/jsonschema-4.25.1-py3-none-any.whl", hash = "sha256:3fba0169e345c7175110351d456342c364814cfcf3b964ba4587f22915230a63", size = 90040, upload-time = "2025-08-18T17:03:48.373Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema-specifications"
|
||||
version = "2025.9.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "referencing" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mcp"
|
||||
version = "1.25.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
{ name = "httpx" },
|
||||
{ name = "httpx-sse" },
|
||||
{ name = "jsonschema" },
|
||||
{ name = "pydantic" },
|
||||
{ name = "pydantic-settings" },
|
||||
{ name = "pyjwt", extra = ["crypto"] },
|
||||
{ name = "python-multipart" },
|
||||
{ name = "pywin32", marker = "sys_platform == 'win32'" },
|
||||
{ name = "sse-starlette" },
|
||||
{ name = "starlette" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
{ name = "uvicorn", marker = "sys_platform != 'emscripten'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d5/2d/649d80a0ecf6a1f82632ca44bec21c0461a9d9fc8934d38cb5b319f2db5e/mcp-1.25.0.tar.gz", hash = "sha256:56310361ebf0364e2d438e5b45f7668cbb124e158bb358333cd06e49e83a6802", size = 605387, upload-time = "2025-12-19T10:19:56.985Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/fc/6dc7659c2ae5ddf280477011f4213a74f806862856b796ef08f028e664bf/mcp-1.25.0-py3-none-any.whl", hash = "sha256:b37c38144a666add0862614cc79ec276e97d72aa8ca26d622818d4e278b9721a", size = 233076, upload-time = "2025-12-19T10:19:55.416Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "25.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.6.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pycparser"
|
||||
version = "2.23"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fe/cf/d2d3b9f5699fb1e4615c8e32ff220203e43b248e1dfcc6736ad9057731ca/pycparser-2.23.tar.gz", hash = "sha256:78816d4f24add8f10a06d6f05b4d424ad9e96cfebf68a4ddc99c65c0720d00c2", size = 173734, upload-time = "2025-09-09T13:23:47.91Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/e3/59cd50310fc9b59512193629e1984c1f95e5c8ae6e5d8c69532ccc65a7fe/pycparser-2.23-py3-none-any.whl", hash = "sha256:e5c6e8d3fbad53479cab09ac03729e0a9faf2bee3db8208a550daf5af81a5934", size = 118140, upload-time = "2025-09-09T13:23:46.651Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic"
|
||||
version = "2.12.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "annotated-types" },
|
||||
{ name = "pydantic-core" },
|
||||
{ name = "typing-extensions" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-core"
|
||||
version = "2.41.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydantic-settings"
|
||||
version = "2.12.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pydantic" },
|
||||
{ name = "python-dotenv" },
|
||||
{ name = "typing-inspection" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/43/4b/ac7e0aae12027748076d72a8764ff1c9d82ca75a7a52622e67ed3f765c54/pydantic_settings-2.12.0.tar.gz", hash = "sha256:005538ef951e3c2a68e1c08b292b5f2e71490def8589d4221b95dab00dafcfd0", size = 194184, upload-time = "2025-11-10T14:25:47.013Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c1/60/5d4751ba3f4a40a6891f24eec885f51afd78d208498268c734e256fb13c4/pydantic_settings-2.12.0-py3-none-any.whl", hash = "sha256:fddb9fd99a5b18da837b29710391e945b1e30c135477f484084ee513adb93809", size = 51880, upload-time = "2025-11-10T14:25:45.546Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.19.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyjwt"
|
||||
version = "2.10.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e7/46/bd74733ff231675599650d3e47f361794b22ef3e3770998dda30d3b63726/pyjwt-2.10.1.tar.gz", hash = "sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953", size = 87785, upload-time = "2024-11-28T03:43:29.933Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/61/ad/689f02752eeec26aed679477e80e632ef1b682313be70793d798c1d5fc8f/PyJWT-2.10.1-py3-none-any.whl", hash = "sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb", size = 22997, upload-time = "2024-11-28T03:43:27.893Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
crypto = [
|
||||
{ name = "cryptography" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "9.0.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||
{ name = "iniconfig" },
|
||||
{ name = "packaging" },
|
||||
{ name = "pluggy" },
|
||||
{ name = "pygments" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/d1/db/7ef3487e0fb0049ddb5ce41d3a49c235bf9ad299b6a25d5780a89f19230f/pytest-9.0.2.tar.gz", hash = "sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11", size = 1568901, upload-time = "2025-12-06T21:30:51.014Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl", hash = "sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b", size = 374801, upload-time = "2025-12-06T21:30:49.154Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytest-asyncio"
|
||||
version = "1.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "pytest" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/e5/35/f8b19922b6a25bc0880171a2f1a003eaeb93657475193ab516fd87cac9da/pytest_asyncio-1.3.0-py3-none-any.whl", hash = "sha256:611e26147c7f77640e6d0a92a38ed17c3e9848063698d5c93d5aa7aa11cebff5", size = 15075, upload-time = "2025-11-10T16:07:45.537Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-dotenv"
|
||||
version = "1.2.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f0/26/19cadc79a718c5edbec86fd4919a6b6d3f681039a2f6d66d14be94e75fb9/python_dotenv-1.2.1.tar.gz", hash = "sha256:42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6", size = 44221, upload-time = "2025-10-26T15:12:10.434Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/14/1b/a298b06749107c305e1fe0f814c6c74aea7b2f1e10989cb30f544a1b3253/python_dotenv-1.2.1-py3-none-any.whl", hash = "sha256:b81ee9561e9ca4004139c6cbba3a238c32b03e4894671e181b671e8cb8425d61", size = 21230, upload-time = "2025-10-26T15:12:09.109Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-multipart"
|
||||
version = "0.0.21"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/78/96/804520d0850c7db98e5ccb70282e29208723f0964e88ffd9d0da2f52ea09/python_multipart-0.0.21.tar.gz", hash = "sha256:7137ebd4d3bbf70ea1622998f902b97a29434a9e8dc40eb203bbcf7c2a2cba92", size = 37196, upload-time = "2025-12-17T09:24:22.446Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/76/03af049af4dcee5d27442f71b6924f01f3efb5d2bd34f23fcd563f2cc5f5/python_multipart-0.0.21-py3-none-any.whl", hash = "sha256:cf7a6713e01c87aa35387f4774e812c4361150938d20d232800f75ffcf266090", size = 24541, upload-time = "2025-12-17T09:24:21.153Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pywin32"
|
||||
version = "311"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/31/097f2e132c4f16d99a22bfb777e0fd88bd8e1c634304e102f313af69ace5/pywin32-311-cp314-cp314-win32.whl", hash = "sha256:b7a2c10b93f8986666d0c803ee19b5990885872a7de910fc460f9b0c2fbf92ee", size = 8840714, upload-time = "2025-07-14T20:13:32.449Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/90/4b/07c77d8ba0e01349358082713400435347df8426208171ce297da32c313d/pywin32-311-cp314-cp314-win_amd64.whl", hash = "sha256:3aca44c046bd2ed8c90de9cb8427f581c479e594e99b5c0bb19b29c10fd6cb87", size = 9656800, upload-time = "2025-07-14T20:13:34.312Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540, upload-time = "2025-07-14T20:13:36.379Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "referencing"
|
||||
version = "0.37.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "rpds-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rpds-py"
|
||||
version = "0.30.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/20/af/3f2f423103f1113b36230496629986e0ef7e199d2aa8392452b484b38ced/rpds_py-0.30.0.tar.gz", hash = "sha256:dd8ff7cf90014af0c0f787eea34794ebf6415242ee1d6fa91eaba725cc441e84", size = 69469, upload-time = "2025-11-30T20:24:38.837Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/86/81/dad16382ebbd3d0e0328776d8fd7ca94220e4fa0798d1dc5e7da48cb3201/rpds_py-0.30.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:68f19c879420aa08f61203801423f6cd5ac5f0ac4ac82a2368a9fcd6a9a075e0", size = 362099, upload-time = "2025-11-30T20:23:27.316Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/60/19f7884db5d5603edf3c6bce35408f45ad3e97e10007df0e17dd57af18f8/rpds_py-0.30.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ec7c4490c672c1a0389d319b3a9cfcd098dcdc4783991553c332a15acf7249be", size = 353192, upload-time = "2025-11-30T20:23:29.151Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/c4/76eb0e1e72d1a9c4703c69607cec123c29028bff28ce41588792417098ac/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f251c812357a3fed308d684a5079ddfb9d933860fc6de89f2b7ab00da481e65f", size = 384080, upload-time = "2025-11-30T20:23:30.785Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/87/87ea665e92f3298d1b26d78814721dc39ed8d2c74b86e83348d6b48a6f31/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac98b175585ecf4c0348fd7b29c3864bda53b805c773cbf7bfdaffc8070c976f", size = 394841, upload-time = "2025-11-30T20:23:32.209Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/77/ad/7783a89ca0587c15dcbf139b4a8364a872a25f861bdb88ed99f9b0dec985/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3e62880792319dbeb7eb866547f2e35973289e7d5696c6e295476448f5b63c87", size = 516670, upload-time = "2025-11-30T20:23:33.742Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5b/3c/2882bdac942bd2172f3da574eab16f309ae10a3925644e969536553cb4ee/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4e7fc54e0900ab35d041b0601431b0a0eb495f0851a0639b6ef90f7741b39a18", size = 408005, upload-time = "2025-11-30T20:23:35.253Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/81/9a91c0111ce1758c92516a3e44776920b579d9a7c09b2b06b642d4de3f0f/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47e77dc9822d3ad616c3d5759ea5631a75e5809d5a28707744ef79d7a1bcfcad", size = 382112, upload-time = "2025-11-30T20:23:36.842Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cf/8e/1da49d4a107027e5fbc64daeab96a0706361a2918da10cb41769244b805d/rpds_py-0.30.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:b4dc1a6ff022ff85ecafef7979a2c6eb423430e05f1165d6688234e62ba99a07", size = 399049, upload-time = "2025-11-30T20:23:38.343Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/5a/7ee239b1aa48a127570ec03becbb29c9d5a9eb092febbd1699d567cae859/rpds_py-0.30.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4559c972db3a360808309e06a74628b95eaccbf961c335c8fe0d590cf587456f", size = 415661, upload-time = "2025-11-30T20:23:40.263Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/ea/caa143cf6b772f823bc7929a45da1fa83569ee49b11d18d0ada7f5ee6fd6/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:0ed177ed9bded28f8deb6ab40c183cd1192aa0de40c12f38be4d59cd33cb5c65", size = 565606, upload-time = "2025-11-30T20:23:42.186Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/91/ac20ba2d69303f961ad8cf55bf7dbdb4763f627291ba3d0d7d67333cced9/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:ad1fa8db769b76ea911cb4e10f049d80bf518c104f15b3edb2371cc65375c46f", size = 591126, upload-time = "2025-11-30T20:23:44.086Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/20/7ff5f3c8b00c8a95f75985128c26ba44503fb35b8e0259d812766ea966c7/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:46e83c697b1f1c72b50e5ee5adb4353eef7406fb3f2043d64c33f20ad1c2fc53", size = 553371, upload-time = "2025-11-30T20:23:46.004Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/c7/81dadd7b27c8ee391c132a6b192111ca58d866577ce2d9b0ca157552cce0/rpds_py-0.30.0-cp314-cp314-win32.whl", hash = "sha256:ee454b2a007d57363c2dfd5b6ca4a5d7e2c518938f8ed3b706e37e5d470801ed", size = 215298, upload-time = "2025-11-30T20:23:47.696Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/d2/1aaac33287e8cfb07aab2e6b8ac1deca62f6f65411344f1433c55e6f3eb8/rpds_py-0.30.0-cp314-cp314-win_amd64.whl", hash = "sha256:95f0802447ac2d10bcc69f6dc28fe95fdf17940367b21d34e34c737870758950", size = 228604, upload-time = "2025-11-30T20:23:49.501Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/95/ab005315818cc519ad074cb7784dae60d939163108bd2b394e60dc7b5461/rpds_py-0.30.0-cp314-cp314-win_arm64.whl", hash = "sha256:613aa4771c99f03346e54c3f038e4cc574ac09a3ddfb0e8878487335e96dead6", size = 222391, upload-time = "2025-11-30T20:23:50.96Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/68/154fe0194d83b973cdedcdcc88947a2752411165930182ae41d983dcefa6/rpds_py-0.30.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:7e6ecfcb62edfd632e56983964e6884851786443739dbfe3582947e87274f7cb", size = 364868, upload-time = "2025-11-30T20:23:52.494Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/83/69/8bbc8b07ec854d92a8b75668c24d2abcb1719ebf890f5604c61c9369a16f/rpds_py-0.30.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a1d0bc22a7cdc173fedebb73ef81e07faef93692b8c1ad3733b67e31e1b6e1b8", size = 353747, upload-time = "2025-11-30T20:23:54.036Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ab/00/ba2e50183dbd9abcce9497fa5149c62b4ff3e22d338a30d690f9af970561/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d08f00679177226c4cb8c5265012eea897c8ca3b93f429e546600c971bcbae7", size = 383795, upload-time = "2025-11-30T20:23:55.556Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/6f/86f0272b84926bcb0e4c972262f54223e8ecc556b3224d281e6598fc9268/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5965af57d5848192c13534f90f9dd16464f3c37aaf166cc1da1cae1fd5a34898", size = 393330, upload-time = "2025-11-30T20:23:57.033Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/e9/0e02bb2e6dc63d212641da45df2b0bf29699d01715913e0d0f017ee29438/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a4e86e34e9ab6b667c27f3211ca48f73dba7cd3d90f8d5b11be56e5dbc3fb4e", size = 518194, upload-time = "2025-11-30T20:23:58.637Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/ca/be7bca14cf21513bdf9c0606aba17d1f389ea2b6987035eb4f62bd923f25/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d3e6b26f2c785d65cc25ef1e5267ccbe1b069c5c21b8cc724efee290554419", size = 408340, upload-time = "2025-11-30T20:24:00.2Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/c7/736e00ebf39ed81d75544c0da6ef7b0998f8201b369acf842f9a90dc8fce/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:626a7433c34566535b6e56a1b39a7b17ba961e97ce3b80ec62e6f1312c025551", size = 383765, upload-time = "2025-11-30T20:24:01.759Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/3f/da50dfde9956aaf365c4adc9533b100008ed31aea635f2b8d7b627e25b49/rpds_py-0.30.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:acd7eb3f4471577b9b5a41baf02a978e8bdeb08b4b355273994f8b87032000a8", size = 396834, upload-time = "2025-11-30T20:24:03.687Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/00/34bcc2565b6020eab2623349efbdec810676ad571995911f1abdae62a3a0/rpds_py-0.30.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe5fa731a1fa8a0a56b0977413f8cacac1768dad38d16b3a296712709476fbd5", size = 415470, upload-time = "2025-11-30T20:24:05.232Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/28/882e72b5b3e6f718d5453bd4d0d9cf8df36fddeb4ddbbab17869d5868616/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:74a3243a411126362712ee1524dfc90c650a503502f135d54d1b352bd01f2404", size = 565630, upload-time = "2025-11-30T20:24:06.878Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/97/04a65539c17692de5b85c6e293520fd01317fd878ea1995f0367d4532fb1/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3e8eeb0544f2eb0d2581774be4c3410356eba189529a6b3e36bbbf9696175856", size = 591148, upload-time = "2025-11-30T20:24:08.445Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/85/70/92482ccffb96f5441aab93e26c4d66489eb599efdcf96fad90c14bbfb976/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dbd936cde57abfee19ab3213cf9c26be06d60750e60a8e4dd85d1ab12c8b1f40", size = 556030, upload-time = "2025-11-30T20:24:10.956Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/20/53/7c7e784abfa500a2b6b583b147ee4bb5a2b3747a9166bab52fec4b5b5e7d/rpds_py-0.30.0-cp314-cp314t-win32.whl", hash = "sha256:dc824125c72246d924f7f796b4f63c1e9dc810c7d9e2355864b3c3a73d59ade0", size = 211570, upload-time = "2025-11-30T20:24:12.735Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/02/fa464cdfbe6b26e0600b62c528b72d8608f5cc49f96b8d6e38c95d60c676/rpds_py-0.30.0-cp314-cp314t-win_amd64.whl", hash = "sha256:27f4b0e92de5bfbc6f86e43959e6edd1425c33b5e69aab0984a72047f2bcf1e3", size = 226532, upload-time = "2025-11-30T20:24:14.634Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.14.10"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/57/08/52232a877978dd8f9cf2aeddce3e611b40a63287dfca29b6b8da791f5e8d/ruff-0.14.10.tar.gz", hash = "sha256:9a2e830f075d1a42cd28420d7809ace390832a490ed0966fe373ba288e77aaf4", size = 5859763, upload-time = "2025-12-18T19:28:57.98Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/60/01/933704d69f3f05ee16ef11406b78881733c186fe14b6a46b05cfcaf6d3b2/ruff-0.14.10-py3-none-linux_armv6l.whl", hash = "sha256:7a3ce585f2ade3e1f29ec1b92df13e3da262178df8c8bdf876f48fa0e8316c49", size = 13527080, upload-time = "2025-12-18T19:29:25.642Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/58/a0349197a7dfa603ffb7f5b0470391efa79ddc327c1e29c4851e85b09cc5/ruff-0.14.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:674f9be9372907f7257c51f1d4fc902cb7cf014b9980152b802794317941f08f", size = 13797320, upload-time = "2025-12-18T19:29:02.571Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/82/36be59f00a6082e38c23536df4e71cdbc6af8d7c707eade97fcad5c98235/ruff-0.14.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d85713d522348837ef9df8efca33ccb8bd6fcfc86a2cde3ccb4bc9d28a18003d", size = 12918434, upload-time = "2025-12-18T19:28:51.202Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/00/45c62a7f7e34da92a25804f813ebe05c88aa9e0c25e5cb5a7d23dd7450e3/ruff-0.14.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6987ebe0501ae4f4308d7d24e2d0fe3d7a98430f5adfd0f1fead050a740a3a77", size = 13371961, upload-time = "2025-12-18T19:29:04.991Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/40/31/a5906d60f0405f7e57045a70f2d57084a93ca7425f22e1d66904769d1628/ruff-0.14.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:16a01dfb7b9e4eee556fbfd5392806b1b8550c9b4a9f6acd3dbe6812b193c70a", size = 13275629, upload-time = "2025-12-18T19:29:21.381Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/60/61c0087df21894cf9d928dc04bcd4fb10e8b2e8dca7b1a276ba2155b2002/ruff-0.14.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7165d31a925b7a294465fa81be8c12a0e9b60fb02bf177e79067c867e71f8b1f", size = 14029234, upload-time = "2025-12-18T19:29:00.132Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/44/84/77d911bee3b92348b6e5dab5a0c898d87084ea03ac5dc708f46d88407def/ruff-0.14.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c561695675b972effb0c0a45db233f2c816ff3da8dcfbe7dfc7eed625f218935", size = 15449890, upload-time = "2025-12-18T19:28:53.573Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/36/480206eaefa24a7ec321582dda580443a8f0671fdbf6b1c80e9c3e93a16a/ruff-0.14.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4bb98fcbbc61725968893682fd4df8966a34611239c9fd07a1f6a07e7103d08e", size = 15123172, upload-time = "2025-12-18T19:29:23.453Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/38/68e414156015ba80cef5473d57919d27dfb62ec804b96180bafdeaf0e090/ruff-0.14.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f24b47993a9d8cb858429e97bdf8544c78029f09b520af615c1d261bf827001d", size = 14460260, upload-time = "2025-12-18T19:29:27.808Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b3/19/9e050c0dca8aba824d67cc0db69fb459c28d8cd3f6855b1405b3f29cc91d/ruff-0.14.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59aabd2e2c4fd614d2862e7939c34a532c04f1084476d6833dddef4afab87e9f", size = 14229978, upload-time = "2025-12-18T19:29:11.32Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/51/eb/e8dd1dd6e05b9e695aa9dd420f4577debdd0f87a5ff2fedda33c09e9be8c/ruff-0.14.10-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:213db2b2e44be8625002dbea33bb9c60c66ea2c07c084a00d55732689d697a7f", size = 14338036, upload-time = "2025-12-18T19:29:09.184Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6a/12/f3e3a505db7c19303b70af370d137795fcfec136d670d5de5391e295c134/ruff-0.14.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b914c40ab64865a17a9a5b67911d14df72346a634527240039eb3bd650e5979d", size = 13264051, upload-time = "2025-12-18T19:29:13.431Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/08/64/8c3a47eaccfef8ac20e0484e68e0772013eb85802f8a9f7603ca751eb166/ruff-0.14.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1484983559f026788e3a5c07c81ef7d1e97c1c78ed03041a18f75df104c45405", size = 13283998, upload-time = "2025-12-18T19:29:06.994Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/84/534a5506f4074e5cc0529e5cd96cfc01bb480e460c7edf5af70d2bcae55e/ruff-0.14.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c70427132db492d25f982fffc8d6c7535cc2fd2c83fc8888f05caaa248521e60", size = 13601891, upload-time = "2025-12-18T19:28:55.811Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0d/1e/14c916087d8598917dbad9b2921d340f7884824ad6e9c55de948a93b106d/ruff-0.14.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5bcf45b681e9f1ee6445d317ce1fa9d6cba9a6049542d1c3d5b5958986be8830", size = 14336660, upload-time = "2025-12-18T19:29:16.531Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/1c/d7b67ab43f30013b47c12b42d1acd354c195351a3f7a1d67f59e54227ede/ruff-0.14.10-py3-none-win32.whl", hash = "sha256:104c49fc7ab73f3f3a758039adea978869a918f31b73280db175b43a2d9b51d6", size = 13196187, upload-time = "2025-12-18T19:29:19.006Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/9c/896c862e13886fae2af961bef3e6312db9ebc6adc2b156fe95e615dee8c1/ruff-0.14.10-py3-none-win_amd64.whl", hash = "sha256:466297bd73638c6bdf06485683e812db1c00c7ac96d4ddd0294a338c62fdc154", size = 14661283, upload-time = "2025-12-18T19:29:30.16Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/74/31/b0e29d572670dca3674eeee78e418f20bdf97fa8aa9ea71380885e175ca0/ruff-0.14.10-py3-none-win_arm64.whl", hash = "sha256:e51d046cf6dda98a4633b8a8a771451107413b0f07183b2bef03f075599e44e6", size = 13729839, upload-time = "2025-12-18T19:28:48.636Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sse-starlette"
|
||||
version = "3.1.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
{ name = "starlette" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/da/34/f5df66cb383efdbf4f2db23cabb27f51b1dcb737efaf8a558f6f1d195134/sse_starlette-3.1.2.tar.gz", hash = "sha256:55eff034207a83a0eb86de9a68099bd0157838f0b8b999a1b742005c71e33618", size = 26303, upload-time = "2025-12-31T08:02:20.023Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/95/8c4b76eec9ae574474e5d2997557cebf764bcd3586458956c30631ae08f4/sse_starlette-3.1.2-py3-none-any.whl", hash = "sha256:cd800dd349f4521b317b9391d3796fa97b71748a4da9b9e00aafab32dda375c8", size = 12484, upload-time = "2025-12-31T08:02:18.894Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "starlette"
|
||||
version = "0.50.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "anyio" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/ba/b8/73a0e6a6e079a9d9cfa64113d771e421640b6f679a52eeb9b32f72d871a1/starlette-0.50.0.tar.gz", hash = "sha256:a2a17b22203254bcbc2e1f926d2d55f3f9497f769416b3190768befe598fa3ca", size = 2646985, upload-time = "2025-11-01T15:25:27.516Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d9/52/1064f510b141bd54025f9b55105e26d1fa970b9be67ad766380a3c9b74b0/starlette-0.50.0-py3-none-any.whl", hash = "sha256:9e5391843ec9b6e472eed1365a78c8098cfceb7a74bfd4d6b1c0c0095efb3bca", size = 74033, upload-time = "2025-11-01T15:25:25.461Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.15.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-inspection"
|
||||
version = "0.4.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uvicorn"
|
||||
version = "0.40.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "click" },
|
||||
{ name = "h11" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c3/d1/8f3c683c9561a4e6689dd3b1d345c815f10f86acd044ee1fb9a4dcd0b8c5/uvicorn-0.40.0.tar.gz", hash = "sha256:839676675e87e73694518b5574fd0f24c9d97b46bea16df7b8c05ea1a51071ea", size = 81761, upload-time = "2025-12-21T14:16:22.45Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl", hash = "sha256:c6c8f55bc8bf13eb6fa9ff87ad62308bbbc33d0b67f84293151efe87e0d5f2ee", size = 68502, upload-time = "2025-12-21T14:16:21.041Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xer-mcp"
|
||||
version = "0.1.0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "mcp" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
dev = [
|
||||
{ name = "pytest" },
|
||||
{ name = "pytest-asyncio" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "mcp", specifier = ">=1.0.0" },
|
||||
{ name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0.0" },
|
||||
{ name = "pytest-asyncio", marker = "extra == 'dev'", specifier = ">=0.24.0" },
|
||||
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.8.0" },
|
||||
]
|
||||
provides-extras = ["dev"]
|
||||
Reference in New Issue
Block a user