Files
opencode-manager/backend/src/constants.ts
T
Chris Scott 7fbb7555b2 feat(files): fullscreen preview, relative markdown links, and preinstalled Chromium (#369)
* feat(files): add fullscreen preview with a minimal close control

Add a fullscreen toggle to the desktop file preview header. Fullscreen fills the viewport, hides the header, and shows only a small on-top X to exit.

Keep the mobile preview fullscreen by default with its close button layered above the content, and give the headerless mobile preview the same small on-top X.

* fix(files): open relative markdown links and preinstall Chromium

Resolve relative and absolute markdown links against the previewed file
and open them in the file browser; external links open in a new tab.
Install Playwright and Chromium into the Manager image with NODE_PATH
and PLAYWRIGHT_BROWSERS_PATH so agents can run browser automation
without a project-local install.

* refactor(files): share markdown link handling across renderers

* test(docker): cover the preinstalled playwright chromium step
2026-09-29 00:15:52 -04:00

71 lines
2.7 KiB
TypeScript

export const DEFAULT_AGENTS_MD = `# OpenCode Manager - Global Agent Instructions
## Critical System Constraints
- **DO NOT** use ports 5003 or 5551 - these are reserved for OpenCode Manager
- **DO NOT** kill or stop processes on ports 5003 or 5551
- **DO NOT** modify files in the \`.config/opencode\` directory unless explicitly requested
## Dev Server Ports
When starting dev servers, use the pre-allocated ports 5100-5103:
- Port 5100: Primary dev server (frontend)
- Port 5101: Secondary dev server (API/backend)
- Port 5102: Additional service
- Port 5103: Additional service
Always bind to \`0.0.0.0\` to allow external access from the Docker host.
## Package Management
### Node.js Packages
Prefer **pnpm** or **bun** over npm for installing dependencies to save disk space:
- Use \`pnpm install\` instead of \`npm install\`
- Use \`bun install\` as an alternative
- Both are pre-installed in the container
### Python Packages
Always create a virtual environment in the repository directory before installing packages:
1. Create virtual environment in repo:
\`cd \`<repo_path>\`
\`uv venv .venv\`
2. Activate the virtual environment:
\`source .venv/bin/activate\` # or \`uv pip sync\` for project-based workflows
3. Install packages into activated environment:
\`uv pip install \`<package>\`
\`uv pip install -r requirements.txt\`
4. Run Python commands:
\`python script.py\` # Uses activated .venv
Alternative: Use \`uv run python script.py\` to skip explicit activation
**Important:**
- Always create .venv in the repository directory (not workspace root)
- Activate the environment before running pip operations
- uv is pre-installed in the container and provides faster package installation
- .venv directories created in repos will persist but can be removed safely
## Browser Automation
Playwright and Chromium are pre-installed, so browser automation runs without a project-local install:
- The \`playwright\` package resolves from any working directory via \`NODE_PATH\`
- Chromium is installed at \`PLAYWRIGHT_BROWSERS_PATH\`
- Run scripts with \`node\`, \`bun\`, or \`pnpm\`; no extra setup is needed
\`\`\`bash
node -e "const { chromium } = require('playwright'); (async () => { const browser = await chromium.launch(); const page = await browser.newPage(); await page.goto('https://example.com'); console.log(await page.title()); await browser.close(); })();"
\`\`\`
If Chromium fails to launch because the host kernel restricts user namespaces, pass \`--no-sandbox\`; the container is already the isolation boundary.
## General Guidelines
- This file is merged with any AGENTS.md files in individual repositories
- Repository-specific instructions take precedence for their respective codebases
`