Skip to main content

Agent execution toolkit - tool execution, MCP integration, file operations, and shell commands

Project description

kollabor-agent

kollabor-agent is the tool and agent execution runtime for Kollabor.

It owns tool dispatch, MCP server connections, file operations, shell execution, agent/skill loading, background tasks, process management, and permission-aware execution. The CLI and engine both build on this package when a model wants to act on the local environment.

Current Role

  • Execute built-in tools such as terminal commands, file operations, and MCP tool calls.
  • Load agent definitions and skills from project, user, and bundled locations.
  • Manage MCP stdio servers and expose their tools to model providers.
  • Provide permission risk assessment and approval flow primitives.
  • Run background processes/tasks and provide process lifecycle helpers.
  • Bridge native/XML tool definitions into the unified tool registry.

Architecture

Module Responsibility
tool_executor.py unified dispatch for terminal, file, MCP, and plugin tools
file_operations_executor.py read/write/edit/move/copy/delete file operations
mcp_integration.py / mcp_manager.py MCP config loading, connection, discovery, calls
permissions/ approval modes, risk assessment, response handling
agent_manager.py agent, skill, and prompt asset loading
runtime.py / process_manager.py agent lifecycle and managed processes
background_task_manager.py background task tracking and cleanup
shell_executor.py / shell_command_service.py async shell execution services
native_tools_handler.py native tool-call routing
tool_registry.py / tool_definitions/ canonical tool metadata and schemas
tool_generators/ markdown, XML, and native JSON tool generation
queue_processor.py tool queue and continuation flow used by the app

Usage

from kollabor_agent import MCPIntegration, ToolExecutor
from kollabor_events import EventBus

bus = EventBus()
mcp = MCPIntegration(event_bus=bus)
executor = ToolExecutor(mcp_integration=mcp, event_bus=bus)

result = await executor.execute_tool({
    "id": "tool_1",
    "type": "terminal",
    "command": "pwd",
})

print(result.success, result.output)

Known Gaps

  • Tool execution depends on caller-provided context for workspace/cwd behavior; service callers must wire project boundaries explicitly until the runtime has a stronger workspace object.
  • MCP session connect behavior is mostly implemented through internal helpers; a smaller public connection API would reduce route-level coupling.
  • Permission scope, bundle scope, and tool registry behavior are powerful but spread across several modules; more contract tests would make changes safer.
  • Some diagnostics and legacy compatibility paths still live inside the runtime and should be made quieter or moved behind debug flags.

Roadmap

Phase 1: Execution boundaries

  • Add a first-class workspace/project execution context used by shell and file operations.
  • Expose a public MCP connect/disconnect/list-tools API for service callers.
  • Tighten cancellation behavior across shell, MCP, background, and plugin tools.

Phase 2: Tool contract stabilization

  • Keep the unified tool registry as the canonical source for schemas, permissions, bundle scope, and prompt rendering.
  • Add regression tests for native JSON, XML, and markdown tool generation.
  • Document exact tool result metadata expected by context-service and display layers.

Phase 3: Agent runtime maturity

  • Clarify which runtime pieces are reusable library APIs versus CLI orchestration internals.
  • Harden process cleanup, circuit-breaker behavior, and background task reporting.
  • Expand agent/skill loading tests across project, user, and bundled sources.

Development

Targeted validation examples:

python -m py_compile packages/kollabor-agent/src/kollabor_agent/*.py
python -m pytest tests/unit/mcp tests/unit/test_auto_grant_mcp_tools.py -q

Dependencies

  • kollabor-events
  • kollabor-config
  • kollabor-ai
  • pyyaml

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kollabor_agent-0.5.7.tar.gz (109.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kollabor_agent-0.5.7-py3-none-any.whl (126.0 kB view details)

Uploaded Python 3

File details

Details for the file kollabor_agent-0.5.7.tar.gz.

File metadata

  • Download URL: kollabor_agent-0.5.7.tar.gz
  • Upload date:
  • Size: 109.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor_agent-0.5.7.tar.gz
Algorithm Hash digest
SHA256 47be5bda6091f424d73fe26cd6e07da06b4754e3ef74efa9c5703afba008cdd5
MD5 2c3a8271247c0e51c361534c138668d9
BLAKE2b-256 dc430a9c47a0313cd8d46b3b485e63b7e2f8eefecc0a3346fa4f4faea7fece1f

See more details on using hashes here.

File details

Details for the file kollabor_agent-0.5.7-py3-none-any.whl.

File metadata

  • Download URL: kollabor_agent-0.5.7-py3-none-any.whl
  • Upload date:
  • Size: 126.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor_agent-0.5.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7d9243d4488a144e869f8f5cc50247ef7c9064a7fdd487c8fe4f984e35a8c758
MD5 48ade0dbc8c5a7b4562dc219e8f3746d
BLAKE2b-256 5f7c33bff75e80fc65b2caf5cfb285e59dff1ab8565b6c10e7f74f919fca817d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page