feat(tool): add tool and validation domain models
CI / lint (pull_request) Successful in 14s
CI / typecheck (pull_request) Successful in 26s
CI / security (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 15s
CI / integration_tests (pull_request) Successful in 4m10s
CI / build (pull_request) Successful in 16s
CI / unit_tests (pull_request) Successful in 8m23s
CI / docker (pull_request) Successful in 39s
CI / coverage (pull_request) Successful in 6m21s
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
CI / security (push) Waiting to run
CI / quality (push) Waiting to run
CI / unit_tests (push) Waiting to run
CI / integration_tests (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / docker (push) Blocked by required conditions

This commit was merged in pull request #59.
This commit is contained in:
Jeff
2026-02-13 21:41:16 +00:00
parent 4cf773703d
commit dfb91781aa
13 changed files with 2616 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# Example: Custom Python tool
# A simple custom tool that runs inline Python code.
name: local/line-counter
description: Count lines in a file
source: custom
code: |
import pathlib
path = pathlib.Path(inputs["file_path"])
count = len(path.read_text().splitlines())
return {"line_count": count}
input_schema:
type: object
required:
- file_path
properties:
file_path:
type: string
description: Path to the file to count lines in
output_schema:
type: object
properties:
line_count:
type: integer
capability:
read_only: true
writes: false
idempotent: true
resource_slots:
- name: target_file
resource_type: fs-mount
access: read_only
description: File system containing the target file
binding: contextual
timeout: 60
+53
View File
@@ -0,0 +1,53 @@
# Example: MCP server tool
# Delegates execution to a tool on an MCP server.
name: devops/docker-build
description: Build a Docker image via the DevOps MCP server
source: mcp
mcp_server: devops-mcp
mcp_tool_name: docker_build
input_schema:
type: object
required:
- context_dir
- image_tag
properties:
context_dir:
type: string
description: Docker build context directory
image_tag:
type: string
description: Tag for the built image
dockerfile:
type: string
description: Path to Dockerfile (relative to context_dir)
default: Dockerfile
output_schema:
type: object
properties:
image_id:
type: string
build_log:
type: string
capability:
read_only: false
writes: true
write_scope: container-registry
checkpointable: false
side_effects:
- network
- container-registry
unsafe: false
human_approval_required: false
resource_slots:
- name: source_repo
resource_type: git-checkout
access: read_only
description: Source code repository for the Docker build
binding: contextual
timeout: 600
@@ -0,0 +1,39 @@
# Example: Required validation (standalone)
# A custom validation that checks test coverage meets a threshold.
name: qa/coverage-check
description: Verify test coverage meets the required threshold
source: custom
mode: required
code: |
import json
report = json.loads(inputs["coverage_json"])
total = report.get("totals", {}).get("percent_covered", 0)
passed = total >= inputs.get("threshold", 80)
return {
"passed": passed,
"data": {"coverage_percent": total},
"message": f"Coverage {total}% {'meets' if passed else 'below'} threshold"
}
input_schema:
type: object
required:
- coverage_json
properties:
coverage_json:
type: string
description: JSON string of the coverage report
threshold:
type: number
description: Minimum coverage percentage required
default: 80
resource_slots:
- name: project_repo
resource_type: git-checkout
access: read_only
description: Repository under test
binding: contextual
timeout: 120
@@ -0,0 +1,29 @@
# Example: Wrapped validation
# Wraps an existing tool and transforms its output into a pass/fail result.
name: qa/lint-check
description: Validate that linting passes by wrapping the lint tool
wraps: devops/run-linter
mode: required
transform: |
def transform(result):
errors = result.get("errors", [])
passed = len(errors) == 0
return {
"passed": passed,
"data": {"error_count": len(errors), "errors": errors[:5]},
"message": f"{len(errors)} lint errors found" if errors else "No lint errors"
}
argument_mapping:
strict: true
config_path: .eslintrc.json
resource_slots:
- name: source_code
resource_type: git-checkout
access: read_only
description: Source code to lint
binding: contextual
timeout: 180