Auto Component Integrator¶
auto_component_integrator — automated library-to-component integration.
Cluster: Uncategorised | Type: component | MCP Tools: 37
Overview¶
Experimental component scaffolding and validation assistant. It analyses Python API surfaces from source, maps operations, scaffolds component files, tracks dependency changes, records integration state, and runs validation checks through a 37-op MCP interface.
Experimental: not a fully automatic integrator
This component is useful for engineering workflows and demos, but it should not be described as a polished end-user automatic component integrator yet. It does not reliably convert arbitrary third-party libraries into complete production-ready G6 components end to end. Treat it as scaffold-and-validate infrastructure: it can create starter files, inspect mappings, run tests, check registry/MCP importability, and record rollback metadata. Human review is still required before publishing or claiming an integration succeeded.
Dependency add/remove operations are record-only: they write dependency-change rows to the integration store but do not mutate pyproject files, requirements files, manifests, or lockfiles.
Full validation reports verified only when tests, registry/MCP checks, workspace-contained written files, dependency analysis, a stored rollback snapshot, reviewer_id, and a bound review artifact or reviewer signature are all present. A bare reviewer_id is only a presence check and remains qualified-draft.
When to use:
- Creating starter files for a new G6 component from a known library/API shape
- Auditing an existing component's dependency graph for conflicts
- Running a scaffold-and-validate loop from an agent pipeline with human review
- Calling
describe_capabilitiesbefore automation needs a single source for real ops, side effects, evidence requirements, fallback state, and known non-capabilities
Example:
from mvp.auto_component_integrator import AutoComponentIntegratorMCPBlock, MCPComponentIntegratorInput
block = AutoComponentIntegratorMCPBlock(db_path=":memory:")
result = block.infer(MCPComponentIntegratorInput(
op="scaffold_all",
component_name="ctx_http",
prefix="ctx_http",
))
# Dry run by default: returns the file list that would be scaffolded.
# To write files, pass metadata={"write_to_disk": True}; review output before publishing.
Works well with: component_creator, auto_engineer, meta_programming
Public API¶
AutoComponentIntegratorBlock(AIBlock[IntegratorInput, IntegratorOutput, None])¶
| Field | Type | Default |
|---|---|---|
name | str | 'auto_component_integrator' |
resource_bounds | ResourceBounds \| None | None |
usage | ResourceUsage | field(default_factory=ResourceUsage) |
Methods:
infer(data: IntegratorInput) -> Result[IntegratorOutput]¶
IntegratorInput(BaseModel)¶
| Field | Type | Default |
|---|---|---|
library_name | str | '' |
library_path_or_url | str | '' |
component_name | str | '' |
prefix | str | '' |
operations | list[str] | Field(default_factory=list) |
allow_mock | bool | False |
IntegratorOutput(BaseModel)¶
| Field | Type | Default |
|---|---|---|
component_name | str | '' |
files_created | list[str] | Field(default_factory=list) |
tests_passed | int | 0 |
tests_failed | int | 0 |
registry_found | bool | False |
message | str | '' |
mocked | bool | False |
degraded | bool | False |
degradation_reason | str | '' |
completion_state | str | 'qualified-draft' |
warning_card | str | '' |
evidence | dict[str, Any] | Field(default_factory=dict) |
AutoComponentIntegratorMCPBlock(AIBlock[MCPComponentIntegratorInput, MCPComponentIntegratorOutput, dict])¶
37-op component integrator MCP block with SQLite persistence.
| Field | Type | Default |
|---|---|---|
name | str | 'auto_component_integrator_mcp' |
resource_bounds | ResourceBounds \| None | None |
usage | ResourceUsage | field(default_factory=ResourceUsage) |
state | dict | field(default_factory=dict) |
db_path | str | ':memory:' |
Methods:
store() -> ComponentIntegratorStore¶
infer(data: MCPComponentIntegratorInput) -> Result[MCPComponentIntegratorOutput]¶
MCPComponentIntegratorRecord(BaseModel)¶
| Field | Type | Default |
|---|---|---|
id | str | '' |
record_type | str | '' |
key | str | '' |
value | str | '' |
tags | list[str] | Field(default_factory=list) |
timestamp | str | '' |
metadata | dict[str, Any] | Field(default_factory=dict) |
MCPComponentIntegratorInput(BaseModel)¶
| Field | Type | Default |
|---|---|---|
op | ComponentIntegratorOp | required |
library_name | str | '' |
library_path | str | '' |
source_code | str | '' |
mapping_id | str | '' |
adjustments | str | '' |
component_name | str | '' |
prefix | str | '' |
operations_csv | str | '' |
package_name | str | '' |
version | str | '' |
test_path | str | '' |
integration_id | str | '' |
source_type | str | '' |
status | str | '' |
branch_name | str | '' |
files_json | str | '' |
gate_id | str | '' |
cycle_id | str | '' |
limit | int | 50 |
offset | int | 0 |
metadata | dict[str, Any] | Field(default_factory=dict) |
MCPComponentIntegratorOutput(BaseModel)¶
| Field | Type | Default |
|---|---|---|
op | str | '' |
key | str | '' |
value | str | '' |
found | bool | False |
count | int | 0 |
records | list[MCPComponentIntegratorRecord] | Field(default_factory=list) |
content | str | '' |
message | str | '' |
metadata | dict[str, Any] | Field(default_factory=dict) |
degraded | bool | False |
degradation_reason | str | '' |
completion_state | str | 'qualified-draft' |
warning_card | str | '' |
request_id | str | '' |
task_id | str | '' |
run_id | str | '' |
execution_kind | str | '' |
evidence | dict[str, Any] \| IntegrationEvidence | Field(default_factory=IntegrationEvidence) |
ComponentIntegratorStore¶
Constructor:
| Parameter | Type | Default |
|---|---|---|
db_path | str | ':memory:' |
Methods:
create_integration(component_name: str, source_type: str = '', status: str = 'pending', files_json: str = '[]') -> str¶
get_integration(integration_id: str) -> dict[str, Any] | None¶
list_integrations(limit: int = 50, offset: int = 0) -> list[dict[str, Any]]¶
update_integration(integration_id: str, status: str | None = None, files_json: str | None = None) -> None¶
count_integrations() -> int¶
add_mapping(integration_id: str, library_function: str, mcp_op: str, conversion_notes: str = '') -> str¶
list_mappings(integration_id: str = '') -> list[dict[str, Any]]¶
update_mapping(mapping_id: str, mcp_op: str | None = None, conversion_notes: str | None = None) -> bool¶
add_dependency_change(integration_id: str, action: str, package_name: str, version: str = '') -> str¶
list_dependency_changes(integration_id: str = '') -> list[dict[str, Any]]¶
add_test_run(integration_id: str, passed: int = 0, failed: int = 0, errors_json: str = '[]') -> str¶
list_test_runs(integration_id: str = '') -> list[dict[str, Any]]¶
add_rollback_snapshot(integration_id: str, branch_name: str = '', git_sha: str = '', files_json: str = '[]') -> str¶
list_rollback_snapshots(integration_id: str = '') -> list[dict[str, Any]]¶
create_gate(gate_number: int, cycle_id: str, payload_json: str = '{}') -> str¶
get_gate(gate_id: str) -> dict[str, Any] | None¶
update_gate(gate_id: str, status: str, decision_json: str = '{}') -> None¶
list_gates(cycle_id: str | None = None, gate_number: int | None = None, status: str | None = None) -> list[dict[str, Any]]¶
create_cycle(trigger: str, status: str = 'scanning', current_stage: int = 1, candidate_json: str = '{}') -> str¶
get_cycle(cycle_id: str) -> dict[str, Any] | None¶
update_cycle(cycle_id: str, status: str | None = None, current_stage: int | None = None, candidate_json: str | None = None) -> None¶
list_cycles(limit: int = 50) -> list[dict[str, Any]]¶
MCP Tools¶
| Operation | Source |
|---|---|
analyze_api | component_integrator_mcp |
map_operations | component_integrator_mcp |
preview_mapping | component_integrator_mcp |
adjust_mapping | component_integrator_mcp |
validate_mapping | component_integrator_mcp |
scaffold_component | component_integrator_mcp |
scaffold_mcp | component_integrator_mcp |
scaffold_tests | component_integrator_mcp |
scaffold_skill | component_integrator_mcp |
scaffold_all | component_integrator_mcp |
check_dependencies | component_integrator_mcp |
add_dependency | component_integrator_mcp |
remove_dependency | component_integrator_mcp |
detect_conflicts | component_integrator_mcp |
list_changes | component_integrator_mcp |
run_tests | component_integrator_mcp |
check_registry | component_integrator_mcp |
check_mcp_server | component_integrator_mcp |
run_full_validation | component_integrator_mcp |
get_test_report | component_integrator_mcp |
create_integration | component_integrator_mcp |
get_integration | component_integrator_mcp |
list_integrations | component_integrator_mcp |
rollback_integration | component_integrator_mcp |
component_integrator_info | component_integrator_mcp |
create_cycle | component_integrator_mcp |
get_cycle | component_integrator_mcp |
list_cycles | component_integrator_mcp |
create_gate | component_integrator_mcp |
get_gate | component_integrator_mcp |
list_gates | component_integrator_mcp |
list_mappings | component_integrator_mcp |
list_dependency_changes | component_integrator_mcp |
list_rollback_snapshots | component_integrator_mcp |
list_test_runs | component_integrator_mcp |
list_patterns | component_integrator_mcp |
describe_capabilities | component_integrator_mcp |