Skip to content

Guide Local Setup

Reese Hodge edited this page Nov 20, 2026 · 4 revisions

Guide: Local Setup

This repo is a pnpm workspace for Max Height:

Package Purpose Local command
packages/frontend React + Vite web app cd packages/frontend && pnpm run dev
packages/agent Strands/AgentCore agent cd packages/agent && pnpm run dev
packages/infra AWS CDK infrastructure cd packages/infra && npx cdk synth

Read Guide-Validation-Gate after setup; pnpm run validate is the final quality gate. Deployment-only tooling is covered in Guide-Deployment.

Prerequisites

For install/build/test, you need a system Node new enough to run pnpm under the repo's engine check, and a pnpm 11 install capable of self-switching. AWS CLI, CDK CLI and Docker are only needed for deployment work; AgentCore CLI is optional for local agent development or the documented deploy contingency. The CDK-owned V2 runtime is an unbuilt target with a constitutional conflict, not a current deploy path; see Guide-Deployment.

Do not add Corepack steps. The toolchain is self-pinning:

  • package.json packageManager pins the exact pnpm version.
  • package.json devEngines.runtime pins the Node runtime range and tells pnpm to download it when missing.
  • packages/infra/test/toolchain.test.ts verifies devEngines.runtime exists, downloads on failure, and stays on the same Node major as .nvmrc.

That trap is indexed from Gotchas because adding Corepack would be redundant and can age badly as Node distributions change.

Notes moved here from the README on 2026-11-07, where version numbers and platform tips would have gone stale:

  • pnpm 11's pmOnFail setting (default download) is the built-in equivalent of Corepack: it fetches and runs the version declared in packageManager.
  • .npmrc sets engine-strict=true, so a system Node older than the engine range makes pnpm install fail outright instead of warning.
  • .nvmrc pins the Node major for nvm/fnm and for CI's actions/setup-node; the toolchain test keeps it in step with devEngines.runtime. The system node -v and pnpm exec node -v may legitimately differ, because scripts run on the pinned Node.
  • On Windows, pnpm recommends installing it via npm: Microsoft Defender sometimes blocks the standalone installer. On macOS and Linux, curl -fsSL https://get.pnpm.io/install.sh | sh - also works.
  • If you manage toolchains with asdf, mise or Volta, set pmOnFail: ignore and runtimeOnFail: ignore in your local pnpm-workspace.yaml so pnpm defers to your version manager.
  • If the editor's Vitest extension reports "Vitest not found" right after cloning, that is expected before pnpm install; install, then reload the window. Do not run the pnpm add -D vitest it suggests, because vitest is already a declared dependency.

Clone and install

git clone https://github.com/quattro004/Agent004.git
cd Agent004

node -v
npm install -g pnpm@11   # only if pnpm 11 is not already installed

pnpm install

After pnpm install, the repo's pinned tools take over. Use:

pnpm -v
pnpm exec node -v

to confirm the active script toolchain, not just the system binaries on PATH.

Run the packages locally

Frontend

cd packages/frontend
pnpm run dev

The frontend dev server runs the browser app with hot reload and skips the provider sign-in gate so the UI can be developed without a deployed Cognito app client. This is UI-only: it does not mint an access token or mock the agent. useAgentStream still refuses requests without a real token, and the app shows its signal-lost state if a local interaction needs the agent. Production builds keep the sign-in gate. Live agent and full deployment E2E testing still require deployment.

Agent

cd packages/agent
pnpm run dev

The quickstart also documents agentcore dev for local AgentCore-style work. That path needs deployment tooling and AWS credentials for Bedrock calls.

Infrastructure

cd packages/infra
npx cdk synth
npx cdk diff

Do not deploy casually. See Guide-Deployment first, especially the split between CDK-managed stacks and the AgentCore Runtime V2 deployment path.

Optional MCP servers

MCP config is for AI coding assistants, not for building, testing or deploying the repo. See Guide-MCP-Servers before editing .mcp.json or .vscode/mcp.json.

First health check

Run the full gate after install:

pnpm run validate

It chains lint, formatting, type-check, build and tests. See Guide-Validation-Gate for the exact order, individual commands, and known validation traps.

Clone this wiki locally