spoq 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spoq-0.2.0/.gitignore +80 -0
- spoq-0.2.0/PKG-INFO +112 -0
- spoq-0.2.0/README.md +89 -0
- spoq-0.2.0/pyproject.toml +51 -0
- spoq-0.2.0/src/spoq_server/__init__.py +9 -0
- spoq-0.2.0/src/spoq_server/__main__.py +5 -0
- spoq-0.2.0/src/spoq_server/cli.py +154 -0
- spoq-0.2.0/src/spoq_server/epic_tools.py +464 -0
- spoq-0.2.0/src/spoq_server/epic_utils.py +479 -0
- spoq-0.2.0/src/spoq_server/init_cmd.py +445 -0
- spoq-0.2.0/src/spoq_server/map_tools.py +614 -0
- spoq-0.2.0/src/spoq_server/map_utils.py +468 -0
- spoq-0.2.0/src/spoq_server/server.py +60 -0
- spoq-0.2.0/src/spoq_server/task_tools.py +167 -0
- spoq-0.2.0/src/spoq_server/team_tools.py +202 -0
- spoq-0.2.0/src/spoq_server/util_tools.py +214 -0
- spoq-0.2.0/tests/conftest.py +64 -0
- spoq-0.2.0/tests/fixtures/test-epic/EPIC.md +87 -0
- spoq-0.2.0/tests/fixtures/test-epic/tasks/01-setup.yml +40 -0
- spoq-0.2.0/tests/fixtures/test-epic/tasks/02-core.yml +38 -0
- spoq-0.2.0/tests/fixtures/test-epic/tasks/03-api.yml +43 -0
- spoq-0.2.0/tests/fixtures/test-epic/tasks/04-tests.yml +40 -0
- spoq-0.2.0/tests/fixtures/test-map/MAP.md +71 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/alpha-service/EPIC.md +34 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/alpha-service/tasks/01-models.yml +37 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/alpha-service/tasks/02-parser.yml +38 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/beta-api/EPIC.md +34 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/beta-api/tasks/01-endpoints.yml +39 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/beta-api/tasks/02-validation.yml +39 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/gamma-tests/EPIC.md +32 -0
- spoq-0.2.0/tests/fixtures/test-map-epics/gamma-tests/tasks/01-e2e.yml +38 -0
- spoq-0.2.0/tests/test_epic_tools.py +551 -0
- spoq-0.2.0/tests/test_integration.py +717 -0
- spoq-0.2.0/tests/test_map_tools.py +479 -0
- spoq-0.2.0/tests/test_mcp_config.py +61 -0
- spoq-0.2.0/tests/test_server.py +42 -0
- spoq-0.2.0/tests/test_task_tools.py +96 -0
- spoq-0.2.0/tests/test_team_tools.py +83 -0
- spoq-0.2.0/tests/test_util_tools.py +84 -0
- spoq-0.2.0/uv.lock +733 -0
spoq-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.*
|
|
5
|
+
.yarn/*
|
|
6
|
+
!.yarn/patches
|
|
7
|
+
!.yarn/plugins
|
|
8
|
+
!.yarn/releases
|
|
9
|
+
!.yarn/versions
|
|
10
|
+
|
|
11
|
+
# Next.js
|
|
12
|
+
.next/
|
|
13
|
+
out/
|
|
14
|
+
build/
|
|
15
|
+
|
|
16
|
+
# Testing
|
|
17
|
+
coverage/
|
|
18
|
+
|
|
19
|
+
# Python
|
|
20
|
+
__pycache__/
|
|
21
|
+
*.py[cod]
|
|
22
|
+
*$py.class
|
|
23
|
+
.Python
|
|
24
|
+
*.so
|
|
25
|
+
.venv/
|
|
26
|
+
venv/
|
|
27
|
+
ENV/
|
|
28
|
+
|
|
29
|
+
# LaTeX build artifacts
|
|
30
|
+
*.aux
|
|
31
|
+
*.log
|
|
32
|
+
*.out
|
|
33
|
+
*.toc
|
|
34
|
+
*.lof
|
|
35
|
+
*.lot
|
|
36
|
+
*.fls
|
|
37
|
+
*.fdb_latexmk
|
|
38
|
+
*.synctex.gz
|
|
39
|
+
*.bbl
|
|
40
|
+
*.blg
|
|
41
|
+
*.nav
|
|
42
|
+
*.snm
|
|
43
|
+
*.vrb
|
|
44
|
+
|
|
45
|
+
# Terraform
|
|
46
|
+
.terraform/
|
|
47
|
+
*.tfstate
|
|
48
|
+
*.tfstate.*
|
|
49
|
+
.terraform.lock.hcl
|
|
50
|
+
*.tfvars
|
|
51
|
+
!*.tfvars.example
|
|
52
|
+
|
|
53
|
+
# IDE
|
|
54
|
+
.idea/
|
|
55
|
+
.vscode/
|
|
56
|
+
*.swp
|
|
57
|
+
*.swo
|
|
58
|
+
*~
|
|
59
|
+
|
|
60
|
+
# OS
|
|
61
|
+
.DS_Store
|
|
62
|
+
Thumbs.db
|
|
63
|
+
|
|
64
|
+
# Env files
|
|
65
|
+
.env
|
|
66
|
+
.env.*
|
|
67
|
+
!.env.example
|
|
68
|
+
|
|
69
|
+
# Debug logs
|
|
70
|
+
npm-debug.log*
|
|
71
|
+
yarn-debug.log*
|
|
72
|
+
yarn-error.log*
|
|
73
|
+
.pnpm-debug.log*
|
|
74
|
+
|
|
75
|
+
# TypeScript
|
|
76
|
+
*.tsbuildinfo
|
|
77
|
+
|
|
78
|
+
# Misc
|
|
79
|
+
*.pem
|
|
80
|
+
.vercel
|
spoq-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spoq
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: SPOQ: Multi-agent AI orchestration with wave-based parallel execution and quality gates
|
|
5
|
+
Project-URL: Homepage, https://spoqpaper.com
|
|
6
|
+
Project-URL: Repository, https://gitlab.com/kenth56/spoq
|
|
7
|
+
Project-URL: Documentation, https://spoqpaper.com/quickstart
|
|
8
|
+
Author: Royce Carbowitz
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Keywords: agents,ai,claude,mcp,orchestration,spoq
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
18
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: mcp>=1.0
|
|
21
|
+
Requires-Dist: pyyaml>=6.0
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# SPOQ
|
|
25
|
+
|
|
26
|
+
**Specialist Orchestrated Queuing** for multi-agent AI development.
|
|
27
|
+
|
|
28
|
+
SPOQ coordinates AI coding agents through wave-based parallel execution with structured quality gates. It provides an MCP server with 23 tools, a CLI for project scaffolding, and template generators for epics and maps.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install spoq
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
### 1. Initialize a project
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
spoq init --target /path/to/project --with-mcp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates the SPOQ directory structure, skill stubs for Claude Code, and configures `.mcp.json`.
|
|
45
|
+
|
|
46
|
+
### 2. Use with Claude Code
|
|
47
|
+
|
|
48
|
+
Once initialized, these slash commands are available in Claude Code:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
/epic-planning Plan an epic with atomic tasks and dependency DAG
|
|
52
|
+
/epic-validation Score epic quality (10 metrics, 95/90 threshold)
|
|
53
|
+
/agent-execution Execute tasks with parallel agent swarms
|
|
54
|
+
/agent-validation Score delivered code (10 metrics, 95/80 threshold)
|
|
55
|
+
/team-execution Persona-specialized agent teams
|
|
56
|
+
/epic-planning --map Coordinate multiple epics as a program
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3. Run the MCP server directly
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
spoq mcp
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Or configure in `.mcp.json`:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"spoq": {
|
|
71
|
+
"command": "spoq",
|
|
72
|
+
"args": ["mcp"]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## CLI Commands
|
|
79
|
+
|
|
80
|
+
| Command | Description |
|
|
81
|
+
|---------|-------------|
|
|
82
|
+
| `spoq mcp` | Run the MCP server (stdio transport) |
|
|
83
|
+
| `spoq init` | Bootstrap SPOQ in a project directory |
|
|
84
|
+
| `spoq init --full` | Include example epic and optional skills |
|
|
85
|
+
| `spoq init --with-mcp` | Configure .mcp.json |
|
|
86
|
+
| `spoq init --upgrade` | Upgrade existing installation |
|
|
87
|
+
| `spoq template epic <name> <tasks>` | Generate an epic skeleton |
|
|
88
|
+
| `spoq template map <name> <epics>` | Generate a map skeleton |
|
|
89
|
+
| `spoq --version` | Show version |
|
|
90
|
+
|
|
91
|
+
## MCP Tools (23)
|
|
92
|
+
|
|
93
|
+
**Epic Management:** `spoq_parse_epic`, `spoq_validate_epic`, `spoq_compute_waves`, `spoq_get_wave_tasks`, `spoq_analyze_dag`, `spoq_estimate_effort`, `spoq_generate_execution_plan`, `spoq_generate_skeleton`
|
|
94
|
+
|
|
95
|
+
**Map Management:** `spoq_parse_map`, `spoq_validate_map`, `spoq_compute_epic_waves`, `spoq_analyze_map_dag`, `spoq_estimate_map_effort`, `spoq_get_map_status`, `spoq_list_maps`, `spoq_generate_map_skeleton`
|
|
96
|
+
|
|
97
|
+
**Task Management:** `spoq_get_task`, `spoq_update_task_status`, `spoq_list_task_statuses`
|
|
98
|
+
|
|
99
|
+
**Team Execution:** `spoq_assign_personas`, `spoq_detect_conflicts`
|
|
100
|
+
|
|
101
|
+
**Utilities:** `spoq_get_timestamp`, `spoq_ping`
|
|
102
|
+
|
|
103
|
+
## Links
|
|
104
|
+
|
|
105
|
+
- [Website](https://spoqpaper.com)
|
|
106
|
+
- [Quickstart Guide](https://spoqpaper.com/quickstart)
|
|
107
|
+
- [Methodology](https://spoqpaper.com/methodology)
|
|
108
|
+
- [Source Code](https://gitlab.com/kenth56/spoq)
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
spoq-0.2.0/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# SPOQ
|
|
2
|
+
|
|
3
|
+
**Specialist Orchestrated Queuing** for multi-agent AI development.
|
|
4
|
+
|
|
5
|
+
SPOQ coordinates AI coding agents through wave-based parallel execution with structured quality gates. It provides an MCP server with 23 tools, a CLI for project scaffolding, and template generators for epics and maps.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install spoq
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### 1. Initialize a project
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
spoq init --target /path/to/project --with-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This creates the SPOQ directory structure, skill stubs for Claude Code, and configures `.mcp.json`.
|
|
22
|
+
|
|
23
|
+
### 2. Use with Claude Code
|
|
24
|
+
|
|
25
|
+
Once initialized, these slash commands are available in Claude Code:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
/epic-planning Plan an epic with atomic tasks and dependency DAG
|
|
29
|
+
/epic-validation Score epic quality (10 metrics, 95/90 threshold)
|
|
30
|
+
/agent-execution Execute tasks with parallel agent swarms
|
|
31
|
+
/agent-validation Score delivered code (10 metrics, 95/80 threshold)
|
|
32
|
+
/team-execution Persona-specialized agent teams
|
|
33
|
+
/epic-planning --map Coordinate multiple epics as a program
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 3. Run the MCP server directly
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
spoq mcp
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or configure in `.mcp.json`:
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"spoq": {
|
|
48
|
+
"command": "spoq",
|
|
49
|
+
"args": ["mcp"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## CLI Commands
|
|
56
|
+
|
|
57
|
+
| Command | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| `spoq mcp` | Run the MCP server (stdio transport) |
|
|
60
|
+
| `spoq init` | Bootstrap SPOQ in a project directory |
|
|
61
|
+
| `spoq init --full` | Include example epic and optional skills |
|
|
62
|
+
| `spoq init --with-mcp` | Configure .mcp.json |
|
|
63
|
+
| `spoq init --upgrade` | Upgrade existing installation |
|
|
64
|
+
| `spoq template epic <name> <tasks>` | Generate an epic skeleton |
|
|
65
|
+
| `spoq template map <name> <epics>` | Generate a map skeleton |
|
|
66
|
+
| `spoq --version` | Show version |
|
|
67
|
+
|
|
68
|
+
## MCP Tools (23)
|
|
69
|
+
|
|
70
|
+
**Epic Management:** `spoq_parse_epic`, `spoq_validate_epic`, `spoq_compute_waves`, `spoq_get_wave_tasks`, `spoq_analyze_dag`, `spoq_estimate_effort`, `spoq_generate_execution_plan`, `spoq_generate_skeleton`
|
|
71
|
+
|
|
72
|
+
**Map Management:** `spoq_parse_map`, `spoq_validate_map`, `spoq_compute_epic_waves`, `spoq_analyze_map_dag`, `spoq_estimate_map_effort`, `spoq_get_map_status`, `spoq_list_maps`, `spoq_generate_map_skeleton`
|
|
73
|
+
|
|
74
|
+
**Task Management:** `spoq_get_task`, `spoq_update_task_status`, `spoq_list_task_statuses`
|
|
75
|
+
|
|
76
|
+
**Team Execution:** `spoq_assign_personas`, `spoq_detect_conflicts`
|
|
77
|
+
|
|
78
|
+
**Utilities:** `spoq_get_timestamp`, `spoq_ping`
|
|
79
|
+
|
|
80
|
+
## Links
|
|
81
|
+
|
|
82
|
+
- [Website](https://spoqpaper.com)
|
|
83
|
+
- [Quickstart Guide](https://spoqpaper.com/quickstart)
|
|
84
|
+
- [Methodology](https://spoqpaper.com/methodology)
|
|
85
|
+
- [Source Code](https://gitlab.com/kenth56/spoq)
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "spoq"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
description = "SPOQ: Multi-agent AI orchestration with wave-based parallel execution and quality gates"
|
|
5
|
+
requires-python = ">=3.12"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Royce Carbowitz" },
|
|
10
|
+
]
|
|
11
|
+
keywords = ["ai", "agents", "orchestration", "mcp", "claude", "spoq"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.12",
|
|
18
|
+
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
20
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"mcp>=1.0",
|
|
24
|
+
"pyyaml>=6.0",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.scripts]
|
|
28
|
+
spoq = "spoq_server.cli:main"
|
|
29
|
+
spoq-mcp = "spoq_server.server:main"
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://spoqpaper.com"
|
|
33
|
+
Repository = "https://gitlab.com/kenth56/spoq"
|
|
34
|
+
Documentation = "https://spoqpaper.com/quickstart"
|
|
35
|
+
|
|
36
|
+
[build-system]
|
|
37
|
+
requires = ["hatchling"]
|
|
38
|
+
build-backend = "hatchling.build"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/spoq_server"]
|
|
42
|
+
|
|
43
|
+
[tool.pytest.ini_options]
|
|
44
|
+
testpaths = ["tests"]
|
|
45
|
+
|
|
46
|
+
[dependency-groups]
|
|
47
|
+
dev = [
|
|
48
|
+
"anyio>=4.12.1",
|
|
49
|
+
"pytest>=8.0",
|
|
50
|
+
"pytest-anyio>=0.0.0",
|
|
51
|
+
]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""SPOQ — Specialist Orchestrated Queuing for multi-agent AI development.
|
|
2
|
+
|
|
3
|
+
Provides:
|
|
4
|
+
- MCP server with 23 tools for epic, map, and task management
|
|
5
|
+
- CLI for project initialization, template generation, and server operation
|
|
6
|
+
- Bundled epic_utils and map_utils for standalone use
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.2.0"
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""SPOQ CLI entry point.
|
|
2
|
+
|
|
3
|
+
Provides subcommands:
|
|
4
|
+
spoq mcp - Run the MCP server (stdio transport)
|
|
5
|
+
spoq init - Bootstrap SPOQ in a project directory
|
|
6
|
+
spoq template - Generate epic or map skeletons
|
|
7
|
+
spoq version - Show version
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
from spoq_server import __version__
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def main():
|
|
17
|
+
"""Main CLI entry point."""
|
|
18
|
+
parser = argparse.ArgumentParser(
|
|
19
|
+
prog="spoq",
|
|
20
|
+
description="SPOQ: Specialist Orchestrated Queuing for multi-agent AI development",
|
|
21
|
+
)
|
|
22
|
+
parser.add_argument(
|
|
23
|
+
"--version", action="version", version=f"spoq {__version__}"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
27
|
+
|
|
28
|
+
# --- spoq mcp ---
|
|
29
|
+
mcp_parser = subparsers.add_parser(
|
|
30
|
+
"mcp", help="Run the SPOQ MCP server (stdio transport)"
|
|
31
|
+
)
|
|
32
|
+
mcp_parser.add_argument(
|
|
33
|
+
"--transport", default="stdio", choices=["stdio"],
|
|
34
|
+
help="Transport protocol (default: stdio)",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# --- spoq init ---
|
|
38
|
+
init_parser = subparsers.add_parser(
|
|
39
|
+
"init", help="Bootstrap SPOQ in a project directory"
|
|
40
|
+
)
|
|
41
|
+
init_parser.add_argument(
|
|
42
|
+
"--target", default=".", help="Target directory (default: current directory)"
|
|
43
|
+
)
|
|
44
|
+
init_parser.add_argument(
|
|
45
|
+
"--full", action="store_true",
|
|
46
|
+
help="Include example epic and optional skills",
|
|
47
|
+
)
|
|
48
|
+
init_parser.add_argument(
|
|
49
|
+
"--with-mcp", action="store_true",
|
|
50
|
+
help="Configure .mcp.json to use the SPOQ MCP server",
|
|
51
|
+
)
|
|
52
|
+
init_parser.add_argument(
|
|
53
|
+
"--upgrade", action="store_true",
|
|
54
|
+
help="Upgrade an existing SPOQ installation",
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# --- spoq template ---
|
|
58
|
+
template_parser = subparsers.add_parser(
|
|
59
|
+
"template", help="Generate epic or map skeletons"
|
|
60
|
+
)
|
|
61
|
+
template_sub = template_parser.add_subparsers(
|
|
62
|
+
dest="template_type", help="Template type"
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# spoq template epic <name> <task_count>
|
|
66
|
+
epic_tmpl = template_sub.add_parser("epic", help="Generate an epic skeleton")
|
|
67
|
+
epic_tmpl.add_argument("name", help="Epic name (converted to slug)")
|
|
68
|
+
epic_tmpl.add_argument(
|
|
69
|
+
"task_count", type=int, help="Number of task files (minimum 3)"
|
|
70
|
+
)
|
|
71
|
+
epic_tmpl.add_argument(
|
|
72
|
+
"--path", default="", help="Base path (default: spoq/epics/active/)"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# spoq template map <name> <epic_count>
|
|
76
|
+
map_tmpl = template_sub.add_parser("map", help="Generate a map skeleton")
|
|
77
|
+
map_tmpl.add_argument("name", help="Map name (converted to slug)")
|
|
78
|
+
map_tmpl.add_argument(
|
|
79
|
+
"epic_count", type=int, help="Number of epic entries (minimum 2)"
|
|
80
|
+
)
|
|
81
|
+
map_tmpl.add_argument(
|
|
82
|
+
"--path", default="", help="Base path (default: spoq/maps/active/)"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
args = parser.parse_args()
|
|
86
|
+
|
|
87
|
+
if args.command is None:
|
|
88
|
+
parser.print_help()
|
|
89
|
+
sys.exit(1)
|
|
90
|
+
|
|
91
|
+
if args.command == "mcp":
|
|
92
|
+
_cmd_mcp(args)
|
|
93
|
+
elif args.command == "init":
|
|
94
|
+
_cmd_init(args)
|
|
95
|
+
elif args.command == "template":
|
|
96
|
+
_cmd_template(args)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _cmd_mcp(args):
|
|
100
|
+
"""Run the MCP server."""
|
|
101
|
+
from spoq_server.server import main as mcp_main
|
|
102
|
+
mcp_main()
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _cmd_init(args):
|
|
106
|
+
"""Bootstrap SPOQ in a project directory."""
|
|
107
|
+
from spoq_server.init_cmd import run_init
|
|
108
|
+
run_init(
|
|
109
|
+
target=args.target,
|
|
110
|
+
full=args.full,
|
|
111
|
+
with_mcp=args.with_mcp,
|
|
112
|
+
upgrade=args.upgrade,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def _cmd_template(args):
|
|
117
|
+
"""Generate a template."""
|
|
118
|
+
import json
|
|
119
|
+
|
|
120
|
+
if args.template_type is None:
|
|
121
|
+
print("Usage: spoq template {epic,map} <name> <count>")
|
|
122
|
+
sys.exit(1)
|
|
123
|
+
|
|
124
|
+
if args.template_type == "epic":
|
|
125
|
+
from spoq_server.util_tools import spoq_generate_skeleton
|
|
126
|
+
result = json.loads(spoq_generate_skeleton(
|
|
127
|
+
name=args.name,
|
|
128
|
+
task_count=args.task_count,
|
|
129
|
+
path=args.path,
|
|
130
|
+
))
|
|
131
|
+
elif args.template_type == "map":
|
|
132
|
+
from spoq_server.map_tools import spoq_generate_map_skeleton
|
|
133
|
+
result = json.loads(spoq_generate_map_skeleton(
|
|
134
|
+
name=args.name,
|
|
135
|
+
epic_count=args.epic_count,
|
|
136
|
+
path=args.path,
|
|
137
|
+
))
|
|
138
|
+
else:
|
|
139
|
+
print(f"Unknown template type: {args.template_type}")
|
|
140
|
+
sys.exit(1)
|
|
141
|
+
|
|
142
|
+
if "error" in result:
|
|
143
|
+
print(f"Error: {result['error']}", file=sys.stderr)
|
|
144
|
+
sys.exit(1)
|
|
145
|
+
|
|
146
|
+
path_key = "epic_path" if args.template_type == "epic" else "map_path"
|
|
147
|
+
print(f"Created {args.template_type} at: {result[path_key]}")
|
|
148
|
+
if "wave_distribution" in result:
|
|
149
|
+
dist = result["wave_distribution"]
|
|
150
|
+
print(f" Wave 0: {dist.get('wave_0', 0)}, Wave 1: {dist.get('wave_1', 0)}, Later: {dist.get('later', 0)}")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
if __name__ == "__main__":
|
|
154
|
+
main()
|