### Initialize and Run Development Environment Source: https://github.com/accomplish-ai/coworker/blob/main/README.md Commands to install dependencies and start the development server. ```bash pnpm install pnpm dev ``` -------------------------------- ### Install dependencies Source: https://github.com/accomplish-ai/coworker/blob/main/packages/agent-core/mcp-tools/dev-browser-mcp/README.md Install the necessary project dependencies. ```bash npm install ``` -------------------------------- ### Run in Builtin mode Source: https://github.com/accomplish-ai/coworker/blob/main/packages/agent-core/mcp-tools/dev-browser-mcp/README.md Start the server in builtin mode, optionally specifying a custom port. ```bash # Uses http://localhost:9224 by default npx tsx src/index.ts # Custom port DEV_BROWSER_PORT=5555 npx tsx src/index.ts ``` -------------------------------- ### Initialize Coworker Services Source: https://github.com/accomplish-ai/coworker/blob/main/packages/agent-core/README.md Demonstrates initializing storage and a task manager, then starting a task with lifecycle callbacks. ```typescript import { createStorage, createTaskManager } from '@coworker_ai/agent-core'; // Initialize storage (SQLite + encrypted secure storage) const storage = createStorage({ databasePath: '/path/to/coworker.db', userDataPath: '/path/to/user-data', }); storage.initialize(); // Set up a task manager const taskManager = createTaskManager({ defaultWorkingDirectory: process.cwd(), isCliAvailable: async () => true, adapterOptions: { platform: process.platform, isPackaged: false, tempPath: '/tmp', getCliCommand: () => ({ command: 'opencode', args: [] }), buildEnvironment: async () => ({ ...process.env }), buildCliArgs: async (config, taskId) => [config.prompt], }, }); // Start a task await taskManager.startTask( 'task-1', { prompt: 'Hello' }, { onMessage: (msg) => console.log(msg), onProgress: (p) => console.log(p.stage), onPermissionRequest: (req) => console.log(req), onComplete: (result) => console.log('Done:', result), onError: (err) => console.error(err), }, ); ``` -------------------------------- ### Launch headless browser for remote mode Source: https://github.com/accomplish-ai/coworker/blob/main/packages/agent-core/mcp-tools/dev-browser-mcp/README.md Start a headless Chromium instance and connect the MCP server to it. ```bash # Start headless Chromium with a CDP port chromium --headless --no-sandbox --remote-debugging-port=9222 # Verify it's running curl http://localhost:9222/json/version # Connect the MCP server CDP_ENDPOINT=http://localhost:9222 npx tsx src/index.ts ``` -------------------------------- ### Execute Google Calendar commands Source: https://github.com/accomplish-ai/coworker/blob/main/apps/desktop/bundled-skills/gws-calendar/SKILL.md Examples of using the google_calendar tool for listing events, finding free time, and creating new events. ```text google_calendar(command: "list") // all accounts google_calendar(command: "free-time --duration 60") // all accounts google_calendar(command: "create --title 'Team Sync'", account: "Work") ``` -------------------------------- ### E2E test usage example Source: https://github.com/accomplish-ai/coworker/blob/main/apps/desktop/e2e/README.md Demonstrates a full test flow including task submission, navigation, and AI screenshot capture. ```typescript import { test, expect } from '../fixtures'; import { HomePage, ExecutionPage } from '../pages'; import { captureForAI } from '../utils'; test('should submit a task and navigate to execution', async ({ window }) => { const homePage = new HomePage(window); const executionPage = new ExecutionPage(window); // Enter task await homePage.enterTask('Create a new file called hello.txt'); await homePage.submitTask(); // Wait for navigation to execution page await executionPage.statusBadge.waitFor({ state: 'visible' }); // Capture screenshot for AI evaluation await captureForAI(window, 'task-submission', 'execution-started', [ 'Task execution page loaded', 'Status badge visible', ]); // Assert await expect(executionPage.statusBadge).toBeVisible(); }); ``` -------------------------------- ### Add CLI arguments to run configuration Source: https://github.com/accomplish-ai/coworker/blob/main/docs/webstorm-run-configurations.md Example of arguments to be added to the Arguments field in the WebStorm UI for scripts requiring CLI parameters. ```text -- --artifact-dir=release/mac-arm64/Accomplish.app --expected-version=1.14.18 ``` -------------------------------- ### Execute Gmail Commands Source: https://github.com/accomplish-ai/coworker/blob/main/apps/desktop/bundled-skills/gws-gmail/SKILL.md Examples of listing unread emails across all accounts and sending an email from a specific account. ```text google_gmail(command: "list --query 'is:unread'") // all accounts google_gmail(command: "send --to 'x@example.com' --subject 'Hi'", account: "Work") ``` -------------------------------- ### Configure Browser Connection Source: https://github.com/accomplish-ai/coworker/blob/main/packages/agent-core/README.md Examples for configuring browser connectivity modes including builtin, remote CDP, and disabled modes. ```typescript import { generateConfig, type BrowserConfig } from '@coworker_ai/agent-core'; // Default — uses the dev-browser HTTP server generateConfig({ browser: { mode: 'builtin' } }); // Remote CDP — connect to any Chrome DevTools Protocol endpoint generateConfig({ browser: { mode: 'remote', cdpEndpoint: 'http://localhost:9222', cdpHeaders: { 'X-CDP-Secret': 'token' }, // optional auth }, }); // No browser — omits browser tools entirely generateConfig({ browser: { mode: 'none' } }); ``` -------------------------------- ### Snapshot metadata output Source: https://github.com/accomplish-ai/coworker/blob/main/packages/agent-core/mcp-tools/dev-browser-mcp/README.md Example of the metadata header included when snapshot output is truncated. ```yaml # Elements: 300 of 5538 (truncated: element limit) # Tokens: ~4500 # Navigation: Home → Search → Results ``` -------------------------------- ### Create run configurations directory Source: https://github.com/accomplish-ai/coworker/blob/main/docs/webstorm-run-configurations.md Initializes the directory required for storing XML-based run configurations. ```bash mkdir -p .idea/runConfigurations ``` -------------------------------- ### Development Commands Source: https://github.com/accomplish-ai/coworker/blob/main/CONTRIBUTING.md Common commands for running the desktop app, building workspaces, and performing quality checks. ```bash pnpm dev # Run the desktop app in development mode pnpm build # Build all workspaces pnpm typecheck # Run TypeScript checks pnpm lint # Run linting ``` -------------------------------- ### Define Desktop build:unpack run configuration Source: https://github.com/accomplish-ai/coworker/blob/main/docs/webstorm-run-configurations.md Use this XML template to create an npm run configuration for the build:unpack script in the desktop application. ```xml