Skip to main content
Back

Contribution Guide

PilotDeck Agent Series

Welcome to participate in the development of PilotDeck! This article introduces how to set up a development environment, submit code and follow project specifications.

Development Environment Setup​

System Requirements​

Depend onVersion
macOSSonoma (14) or higher
Node.jsv18+ (v22 recommended)
npmv9+
GitLatest version
TypeScriptv5.9+ (installed within the project)

Cloning and Initialization​

Bash
# Clone repository
git clone https://github.com/OpenBMB/PilotDeck.git
cd PilotDeck

# Install dependencies (root directory + ui workspace)
npm install

# Compile Gateway
npm run build

# Install and compile Web UI
cdui
npm install
npm run build
cd..

Start Development Mode​

PilotDeck provides one-click development startup script:

Bash
# One-click startup (recommended)
npm rundev

npm run dev Will execute scripts/dev-launcher.mjs, automatically completed:

  1. run predev Hook - initialization configuration file
  2. Start Gateway Server (hot reload)
  3. Start the Web UI development server (Vite HMR)

You can also start each component separately:

Bash
#Start separately (in different terminal windows)

# Terminal 1: Gateway Server (using tsx hot reload)
npm run server

# Terminal 2: UI Bridge Server
npm --prefix ui run server

# Terminal 3: Web UI development server
npm --prefix ui run client

# Or use concurrently to start at the same time
npm --prefix ui run dev:concurrent

Coding Standards​

TypeScript​

  • Use strict mode TypeScript(strict: true)
  • priority use type rather than interface(The project has established practices)
  • Used when exporting export type {} Export to pure types
  • Use .js Import path for extensions (ESM specification)
Typescript
// ✅ Recommended
import { createGateway, type Gateway } from "../gateway/index.js";

// ❌ avoid
import { createGateway, Gateway } from "../gateway/index";

Module Boundaries​

each src/<module>/ Directory passed index.ts Define the public API.

Note · Warning
  • Don't Directly import internal files of other modules, only through index.ts Exported interface
  • Don't Create circular dependencies between modules
  • The dependence direction is from the upper layer to the lower layer, and the lower layer modules do not depend on the upper layer.

Naming Convention​

CategoryAgreementExample
file namePascalCase (class/component) or camelCase (utility function)RouterRuntime.ts, decideScenario.ts
class/typePascalCaseSessionRouter, RouterDecision
functioncamelCasecreateGateway, loadPilotConfig
constantUPPER_SNAKE_CASEDEFAULT_PILOT_HOME
Directorykebab-casealways-on, pilot-config

Git Workflow​

Branching Strategy​

branchPurpose
mainStable main line
feature/<name>New feature development
fix/<name>Bug fix
refactor/<name>Refactor

Commit Information​

Follow the semantic format:

Plain Text
<type>(<scope>): <description>

feat(router): add custom router plugin support
fix(gateway): handle WebSocket reconnection timeout
refactor(context): extract CompactionEngine from ContextRuntime
docs(config): update YAML schema documentation
test(router): add TokenSaver decision unit tests

Compile and Build​

Bash
# Compile the Gateway backend
npm run build
# Output to dist/

# Compile Web UI
npm --prefix ui run build
#Output to ui/dist/

#Type checking (not compiled)
npm --prefix ui run typecheck

Checklist for Submitting a PR​

  1. Local compilation passed

    Bash
    npm run build
  2. Test passed

    Bash
    npm test
  3. UI type checking passes (if involved)

    Bash
    npm --prefix ui run typecheck
  4. Update related documentation

    If the configuration schema, CLI command or public API is modified, update it synchronously docs/ documents in .

Developer Showcase

View all →