$ show LeonGaoHaining/opencowork
OpenCowork is a desktop AI agent application built with Electron, React, and TypeScript. It enables users to automate tasks through natural language interactions, supporting browser automation (via Playwright), local command execution, image processing, and integration with messaging platforms like Feishu. The application features a modular architecture with separate main and renderer processes, communicating via IPC. Core functionality includes task orchestration, skill-based workflow reuse, scheduling, memory management, and MCP (Model Context Protocol) integration for extensibility. The system emphasizes local-first operation, user control, and reliable execution with fallback mechanisms for unstable automation scenarios.
The LLM identified 3 files worth highlighting for reuse:
Routes actions to appropriate executors (browser, CLI, vision, etc.) based on action type. Demonstrates the router pattern for decoupling action handling from execution logic. Can be extracted by defining action types and executor interfaces.
Executes shell commands and captures output, error, and exit code. A simple, self-contained utility that depends only on Node.js built-ins. Can be used in any Node.js project needing to run shell commands with proper error handling.
Validates action objects against a predefined schema using a discriminated union approach. Demonstrates schema-based validation for ensuring action correctness. Can be reused in any system that processes structured actions by defining the action schema.