Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help release publish-crates docs test-python test-python-integration format-python test-cli build-python
.PHONY: help release publish-crates docs test-cli

# Default target - show help when running just 'make'
.DEFAULT_GOAL := help
Expand All @@ -7,14 +7,12 @@ help:
@echo "pctx dev scripts"
@echo ""
@echo "Available targets:"
@echo " make docs - Generate CLI and Python documentation"
@echo " make test-python - Run Python client tests"
@echo " make test-python-integration - Run Python client tests with integration testing"
@echo " make format-python - Format and lint Python code with ruff"
@echo " make test-cli - Run CLI integration tests (pctx mcp start)"
@echo " make release - Interactive release script (bump version, update changelog)"
@echo " make publish-crates - Publish pctx_code_mode + dependencies to crates.io (runs locally)"
@echo " make build-python - Build Python package (resolves symlinks before build)"
@echo " make docs - Generate CLI, OpenAPI, and Python documentation"
@echo " make test-cli - Run CLI integration tests (pctx mcp start)"
@echo " make release - Interactive release script (bump version, update changelog)"
@echo " make publish-crates - Publish pctx_code_mode + dependencies to crates.io (runs locally)"
@echo ""
@echo "Python package targets live in pctx-py/Makefile (run 'make -C pctx-py help')."
@echo ""

# Generate CLI, OAS, and Python documentation
Expand All @@ -24,21 +22,10 @@ docs:
@./scripts/generate-openapi.sh
@echo ""
@echo "Building Python Sphinx documentation..."
@cd pctx-py && uv run sphinx-build -b html docs docs/_build/html
@$(MAKE) -C pctx-py docs
@echo ""
@echo "✓ Documentation built successfully!"

# Run Python client tests
test-python:
@cd pctx-py && uv run pytest tests/ -v

# Run Python client tests with integration tests (expects pctx running on localhost on the default port)
test-python-integration:
@cd pctx-py && uv run pytest tests/ --integration -v

format-python:
@cd pctx-py && uv run ruff format . && uv run ruff check . --fix

# Run CLI integration tests
test-cli:
@./scripts/test-mcp-cli.sh
Expand All @@ -50,8 +37,3 @@ release:
# Publish Rust crates to crates.io
publish-crates:
@./scripts/publish-crates.sh

# Build Python package (resolves _tool_descriptions/data symlink before build, restores after)
build-python:
@./scripts/build-python.sh

130 changes: 101 additions & 29 deletions crates/pctx_session_server/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"paths": {
"/code-mode/execute-bash": {
"post": {
"tags": ["CodeMode"],
"tags": [
"CodeMode"
],
"summary": "Execute a bash command",
"operationId": "execute_bash",
"parameters": [
Expand Down Expand Up @@ -72,7 +74,9 @@
},
"/code-mode/functions/details": {
"post": {
"tags": ["CodeMode"],
"tags": [
"CodeMode"
],
"summary": "Get detailed information about a specific function",
"operationId": "get_function_details",
"parameters": [
Expand Down Expand Up @@ -132,7 +136,9 @@
},
"/code-mode/functions/list": {
"post": {
"tags": ["CodeMode"],
"tags": [
"CodeMode"
],
"summary": "List all available code mode functions from both server and tool registrations",
"operationId": "list_functions",
"parameters": [
Expand Down Expand Up @@ -172,7 +178,9 @@
},
"/code-mode/session/close": {
"post": {
"tags": ["CodeMode"],
"tags": [
"CodeMode"
],
"summary": "Close a `CodeMode` session",
"operationId": "close_session",
"parameters": [
Expand Down Expand Up @@ -222,7 +230,9 @@
},
"/code-mode/session/create": {
"post": {
"tags": ["CodeMode"],
"tags": [
"CodeMode"
],
"summary": "Create a new `CodeMode` session",
"operationId": "create_session",
"responses": {
Expand Down Expand Up @@ -251,7 +261,9 @@
},
"/health": {
"get": {
"tags": ["health"],
"tags": [
"health"
],
"summary": "Health check endpoint",
"operationId": "health",
"responses": {
Expand All @@ -270,7 +282,9 @@
},
"/register/servers": {
"post": {
"tags": ["registration"],
"tags": [
"registration"
],
"summary": "Register MCP servers dynamically at runtime",
"operationId": "register_servers",
"parameters": [
Expand Down Expand Up @@ -320,7 +334,9 @@
},
"/register/tools": {
"post": {
"tags": ["registration"],
"tags": [
"registration"
],
"summary": "Register tools that will be called via WebSocket callbacks",
"operationId": "register_tools",
"parameters": [
Expand Down Expand Up @@ -383,25 +399,35 @@
"schemas": {
"CallbackConfig": {
"type": "object",
"required": ["name"],
"required": [
"name"
],
"properties": {
"description": {
"type": ["string", "null"]
"type": [
"string",
"null"
]
},
"input_schema": {},
"name": {
"type": "string"
},
"namespace": {
"type": ["string", "null"]
"type": [
"string",
"null"
]
},
"output_schema": {}
}
},
"CloseSessionResponse": {
"type": "object",
"description": "Response after closing a `CodeMode` session",
"required": ["success"],
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean"
Expand All @@ -411,7 +437,9 @@
"CreateSessionResponse": {
"type": "object",
"description": "Response after creating a new `CodeMode` session",
"required": ["session_id"],
"required": [
"session_id"
],
"properties": {
"session_id": {
"type": "string"
Expand All @@ -420,17 +448,27 @@
},
"ErrorCode": {
"type": "string",
"enum": ["invalid_session", "internal", "execution"]
"enum": [
"invalid_session",
"internal",
"execution"
]
},
"ErrorData": {
"type": "object",
"required": ["code", "message"],
"required": [
"code",
"message"
],
"properties": {
"code": {
"$ref": "#/components/schemas/ErrorCode"
},
"details": {
"type": ["string", "null"]
"type": [
"string",
"null"
]
},
"message": {
"type": "string"
Expand All @@ -449,7 +487,11 @@
},
"ExecuteBashOutput": {
"type": "object",
"required": ["exit_code", "stdout", "stderr"],
"required": [
"exit_code",
"stdout",
"stderr"
],
"properties": {
"exit_code": {
"type": "integer",
Expand All @@ -473,7 +515,11 @@
},
{
"type": "object",
"required": ["input_type", "output_type", "types"],
"required": [
"input_type",
"output_type",
"types"
],
"properties": {
"input_type": {
"type": "string",
Expand All @@ -493,7 +539,9 @@
},
"GetFunctionDetailsInput": {
"type": "object",
"required": ["functions"],
"required": [
"functions"
],
"properties": {
"functions": {
"type": "array",
Expand All @@ -506,7 +554,10 @@
},
"GetFunctionDetailsOutput": {
"type": "object",
"required": ["functions", "code"],
"required": [
"functions",
"code"
],
"properties": {
"code": {
"type": "string"
Expand All @@ -522,7 +573,10 @@
"HealthResponse": {
"type": "object",
"description": "Health check response",
"required": ["status", "version"],
"required": [
"status",
"version"
],
"properties": {
"status": {
"type": "string"
Expand All @@ -534,7 +588,10 @@
},
"ListFunctionsOutput": {
"type": "object",
"required": ["functions", "code"],
"required": [
"functions",
"code"
],
"properties": {
"code": {
"type": "string"
Expand All @@ -550,10 +607,16 @@
},
"ListedFunction": {
"type": "object",
"required": ["namespace", "name"],
"required": [
"namespace",
"name"
],
"properties": {
"description": {
"type": ["string", "null"],
"type": [
"string",
"null"
],
"description": "Function description"
},
"name": {
Expand All @@ -569,7 +632,9 @@
"RegisterMcpServersRequest": {
"type": "object",
"description": "Request to register MCP servers",
"required": ["servers"],
"required": [
"servers"
],
"properties": {
"servers": {
"type": "array",
Expand All @@ -580,7 +645,10 @@
"RegisterMcpServersResponse": {
"type": "object",
"description": "Response after registering MCP servers",
"required": ["registered", "failed"],
"required": [
"registered",
"failed"
],
"properties": {
"failed": {
"type": "array",
Expand All @@ -597,7 +665,9 @@
"RegisterToolsRequest": {
"type": "object",
"description": "Request to register tools",
"required": ["tools"],
"required": [
"tools"
],
"properties": {
"tools": {
"type": "array",
Expand All @@ -610,7 +680,9 @@
"RegisterToolsResponse": {
"type": "object",
"description": "Response to registering tools",
"required": ["registered"],
"required": [
"registered"
],
"properties": {
"registered": {
"type": "integer",
Expand All @@ -630,4 +702,4 @@
"description": "Health check endpoints"
}
]
}
}
Loading
Loading