Files
Francesco Bonacci 174ae253ba feat: auto-generated SDK docs, Python CLI, and docs improvements (#1040)
* feat: auto-generated SDK docs, Python CLI, and docs improvements

- Add auto-generated SDK reference pages (computer-sdk, agent-sdk) with version selector
- Add Python CLI package (cua-cli) with auth, sandbox, image, MCP commands
- Deprecate TypeScript CLI in favor of Python CLI
- Add versioned docs (agent-sdk v0.3-v0.7, computer-sdk v0.3-v0.5)
- Rename cloud-cli to cli in docs
- Add mobile header fix with sidebar toggle
- Restructure guide pages (quickstart, self-hosted-sandboxes)
- Add redirects for old /api URLs
- Update workflows, lume docs, cuabench docs, desktop sandbox docs

* refactor: auto-generate CLI index page like computer/agent SDKs

Change CLI docs to use the same auto-generated index.mdx pattern as
computer-sdk and agent-sdk. Removes hand-written index page that could
become stale, and deletes the separate api.mdx.

* fix: rename "Cua Bench API Reference" to "API Reference" in menu

* fix: update lume examples to macos-tahoe-vanilla and shorten page titles

- Replace macos-sequoia-vanilla:latest with macos-tahoe-vanilla:latest
  in lume docs and generator
- Rename "Lume CLI Reference" to "CLI Reference"
- Rename "Lume HTTP API Reference" to "API Reference"

* feat: rename CuaBot to Cua-Bot and add to dropdown selector

- Rename CuaBot to Cua-Bot in docs meta.json and content pages
- Add Cua-Bot entry to the header dropdown selector

* refactor: restructure Cua-Bot docs to match Cua/Cua-Bench pattern

Reorganize cuabot docs from flat structure into guide/getting-started/
hierarchy matching other collections:
- cuabot.mdx → guide/getting-started/introduction.mdx
- install.mdx → guide/getting-started/installation.mdx
- Add meta.json files with proper icons and structure
- Update dropdown selector href to new path

* feat(docs): add auto-generated API reference, changelog, and versioning for Cua-Bot

Add TypeScript SDK doc generator (regex-based, no compiler dependency) and
configure cuabot for changelog generation and versioned docs snapshots.

* feat(ci): add cuabot to docs drift check and improve failure message

Wire cuabot into CI path triggers, runner config, and changed-file
detection. Add --check mode to typescript-sdk.ts for drift comparison.
Update failure banner with per-library and versioning commands.

* fix: resolve Python lint issues (black, ruff)

Run black formatting on 12 files, fix ruff F841 (unused variables) in
tests, and add TYPE_CHECKING import for FastMCP forward references.

* fix: resolve TS typecheck and Lume Swift 6 CI failures

- typescript-typecheck.js: build @trycua/core before running typecheck
  so its dist/ type declarations are available for @trycua/computer
- SSHClient.swift: avoid crossing Sendable boundary with NIOSSHHandler
  by keeping handler access + createChannel within flatMap on the event
  loop, fixing Swift 6 strict concurrency errors

* fix: TS typecheck pnpm version strict mode and Lume mock conformance

- Set COREPACK_ENABLE_STRICT=0 in typecheck script to allow pnpm 9.x
  to run commands in workspace packages declaring pnpm 10.x
- Update MockVNCService.sendText signature to match protocol (add
  delayMs parameter)

* fix: run prettier formatting and ignore auto-generated docs files

Format all files to pass prettier 3.8.1 check. Add docs/.source/ and
docs/next-env.d.ts to .prettierignore (auto-generated, not editable).

* fix: restore MDX comment syntax broken by prettier

Prettier 3.8.1 converts {/* */} to {/_ _/} in MDX files, which breaks
the acorn parser. Restore all comments and add *.mdx to .prettierignore.

* fix: regenerate docs to pass drift check after prettier revert

* fix: CI docs check fetch-depth, regenerate Lume docs, fix header layout shift

- Use fetch-depth: 0 in CI checkout so git tags are available for
  version discovery (was using fetch-depth: 2, causing version fallback)
- Regenerate Lume docs from local Swift build (0.2.75 → 0.2.76)
- Fix header product selector layout shift with consistent icon/text sizing

* fix: format custom-header.tsx with prettier

* fix: use arch-agnostic JAVA_HOME for arm64 Docker build

The openjdk package writes the arch-specific path (e.g. java-17-openjdk-amd64)
to /etc/environment, which sdkmanager sources, overriding the Dockerfile ENV.
Create an arch-agnostic symlink and re-export JAVA_HOME in the sdkmanager RUN
step to ensure it works on both amd64 and arm64.

* fix: skip emulator package on arm64 (not available for that arch)

The Android emulator SDK package is only published for amd64.
Conditionally install it based on dpkg --print-architecture.

* ci: retrigger cuabot docker build
2026-02-09 08:54:11 +01:00

151 lines
6.3 KiB
YAML

name: "CI: Check Docs"
on:
pull_request:
paths:
# Lume (Swift)
- "libs/lume/src/**"
# Cua CLI (TypeScript)
- "libs/typescript/cua-cli/src/**"
# MCP Server (Python)
- "libs/python/mcp-server/src/**"
# Computer SDK
- "libs/python/computer/computer/**"
- "libs/typescript/computer/src/**"
# Agent SDK
- "libs/python/agent/agent/**"
- "libs/typescript/agent/src/**"
# Cua-Bot
- "libs/cuabot/src/**"
# Documentation files themselves
- "docs/content/docs/cua/reference/**"
- "docs/content/docs/cuabot/reference/**"
# Generator scripts
- "scripts/docs-generators/**"
jobs:
check-docs-sync:
name: Check Documentation Sync
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Need full history for git tags (version discovery) and changed file detection
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Node dependencies
run: pnpm install
working-directory: docs
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python doc dependencies
run: pip install -r scripts/docs-generators/requirements.txt
- name: Determine changed generators
id: changed
run: |
# Get list of changed files
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
echo "Changed files:"
echo "$CHANGED_FILES"
# Check which generators need to run
GENERATORS=""
# Lume changes
if echo "$CHANGED_FILES" | grep -q "^libs/lume/src/"; then
GENERATORS="$GENERATORS lume"
fi
# Cua CLI changes
if echo "$CHANGED_FILES" | grep -q "^libs/typescript/cua-cli/src/"; then
GENERATORS="$GENERATORS cua-cli"
fi
# MCP Server changes
if echo "$CHANGED_FILES" | grep -q "^libs/python/mcp-server/src/"; then
GENERATORS="$GENERATORS mcp-server"
fi
# Python SDK changes (Computer and Agent)
if echo "$CHANGED_FILES" | grep -q "^libs/python/computer/computer/\|^libs/python/agent/agent/"; then
GENERATORS="$GENERATORS python-sdk"
fi
# Cua-Bot changes
if echo "$CHANGED_FILES" | grep -q "^libs/cuabot/src/"; then
GENERATORS="$GENERATORS cuabot"
fi
# Generator changes should run all
if echo "$CHANGED_FILES" | grep -q "^scripts/docs-generators/"; then
GENERATORS="all"
fi
echo "generators=$GENERATORS" >> $GITHUB_OUTPUT
- name: Build Lume (if needed)
if: contains(steps.changed.outputs.generators, 'lume') || steps.changed.outputs.generators == 'all'
run: swift build -c release
working-directory: libs/lume
- name: Run documentation check
run: |
GENERATORS="${{ steps.changed.outputs.generators }}"
if [ -z "$GENERATORS" ]; then
echo "No documentation-related changes detected."
exit 0
fi
if [ "$GENERATORS" = "all" ]; then
npx tsx scripts/docs-generators/runner.ts --check
else
for gen in $GENERATORS; do
echo "Checking generator: $gen"
npx tsx scripts/docs-generators/runner.ts --library "$gen" --check
done
fi
working-directory: .
- name: Show help if check failed
if: failure()
run: |
echo ""
echo "╔═══════════════════════════════════════════════════════════════════════╗"
echo "║ Documentation Out of Sync! ║"
echo "╠═══════════════════════════════════════════════════════════════════════╣"
echo "║ ║"
echo "║ The documentation has drifted from the source code. ║"
echo "║ ║"
echo "║ To regenerate all docs, run from the repository root: ║"
echo "║ ║"
echo "║ npx tsx scripts/docs-generators/runner.ts ║"
echo "║ ║"
echo "║ Or for a specific library: ║"
echo "║ ║"
echo "║ npx tsx scripts/docs-generators/runner.ts --library lume ║"
echo "║ npx tsx scripts/docs-generators/runner.ts --library python-sdk ║"
echo "║ npx tsx scripts/docs-generators/runner.ts --library cuabot ║"
echo "║ ║"
echo "║ For versioned docs and changelogs (after tagging a new release): ║"
echo "║ ║"
echo "║ npx tsx scripts/docs-generators/generate-versioned-docs.ts ║"
echo "║ npx tsx scripts/docs-generators/generate-changelog.ts ║"
echo "║ ║"
echo "║ Then commit the updated documentation files. ║"
echo "║ ║"
echo "╚═══════════════════════════════════════════════════════════════════════╝"