### Clone and Setup Cate Project Source: https://github.com/0-ai-ug/cate/blob/main/README.md Use this command to clone the repository, navigate into the directory, and set up the project by installing dependencies and building the companion daemon. ```bash git clone https://github.com/0-AI-UG/cate.git cd cate bun run setup ``` -------------------------------- ### Install and Run Cate Development Environment Source: https://github.com/0-ai-ug/cate/blob/main/CLAUDE.md Commands to install project dependencies and start the development server with hot reload. Also includes commands for building the production version and running tests. ```bash npm install # install dependencies npm run dev # start dev server with hot reload npm run build # production build npm test # run vitest suite ``` -------------------------------- ### Start Development Server Source: https://github.com/0-ai-ug/cate/blob/main/CONTRIBUTING.md Starts the development server for local development. Requires Node.js and npm. ```bash npm run dev ``` -------------------------------- ### Install Dependencies Source: https://github.com/0-ai-ug/cate/blob/main/CONTRIBUTING.md Installs project dependencies using npm. Ensure Node.js and npm are installed. ```bash npm install ``` -------------------------------- ### Workflow Prompt Execution Examples Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Examples of executing predefined workflow prompts. These shortcuts trigger complex agent sequences. ```plaintext /implement add Redis caching to the session store ``` ```plaintext /scout-and-plan refactor auth to support OAuth ``` ```plaintext /implement-and-review add input validation to API endpoints ``` -------------------------------- ### Parallel Agent Execution Example Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Example demonstrating how to run multiple agents concurrently. Useful for speeding up independent tasks. ```plaintext Run 2 scouts in parallel: one to find models, one to find providers ``` -------------------------------- ### Single Agent Usage Example Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Example of how to use a single agent to perform a specific task. This is the most basic usage pattern. ```plaintext Use scout to find all authentication code ``` -------------------------------- ### Conventional Commits Examples Source: https://github.com/0-ai-ug/cate/blob/main/CONTRIBUTING.md Examples of commit messages following the Conventional Commits specification. Use 'feat' for new features and 'fix' for bug fixes. ```bash feat: add panel snapping to grid fix: terminal resize not updating PTY dimensions ``` -------------------------------- ### Example Interface Definition Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/agents/scout.md Illustrates the structure for defining an interface within the scout's findings. ```typescript interface Example { // actual code from the files } ``` -------------------------------- ### Chained Agent Workflow Example Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Example of a chained workflow where the output of one agent becomes the input for the next. Enables complex, multi-step processes. ```plaintext Use a chain: first have scout find the read tool, then have planner suggest improvements ``` -------------------------------- ### Example Key Function Definition Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/agents/scout.md Shows how a critical function identified by the scout agent would be represented. ```typescript function keyFunction() { // actual implementation } ``` -------------------------------- ### Cate Theme Schema Example Source: https://github.com/0-ai-ug/cate/blob/main/skills/cate-theme/SKILL.md This JSON object defines the structure and properties for a Cate IDE theme, covering app chrome, terminal colors, and editor syntax highlighting. Validate your themes against the 'theme.schema.json' file. ```json { "version": 1, "id": "midnight-ember", // REQUIRED, unique kebab-case slug "name": "Midnight Ember", // REQUIRED, display name "type": "dark", // REQUIRED: "dark" | "light" (drives system light/dark auto-switch + editor base) "author": "You", // optional "bootBackground": "#1a1714", // optional — exact cold-launch window bg (defaults to surface-0) "app": { // app chrome — see "App colors" below. PARTIAL: omitted keys inherit the base. "surface-0": "#1a1714", "surface-1": "#221d18", "text-primary": "#e7ddd0", "text-muted": "#9b9186", "border-focus": "#e0683c", "focus-blue": "#e0683c", "agent-rgb": "224 104 60" }, "terminal": { // REQUIRED full xterm palette — ordinary shell output "background": "#1a1714", "foreground": "#e7ddd0", "cursor": "#e0683c", "selectionBackground": "#3a2f26", "black": "#1a1714", "red": "#e0683c", "green": "#8fa86a", "yellow": "#d9a441", "blue": "#5f90c4", "magenta": "#b06aa0", "cyan": "#5fa8a8", "white": "#d8cdbf", "brightBlack": "#6b6258", "brightRed": "#f0855a", "brightGreen": "#a6c47f", "brightYellow": "#e8bd6a", "brightBlue": "#7aa8d6", "brightMagenta": "#c884b8", "brightCyan": "#7cc0c0", "brightWhite": "#f4ece1" }, "editor": { // REQUIRED Monaco syntax "base": "vs-dark", // "vs" for light themes, "vs-dark" for dark "tokens": [ // syntax rules — foreground is hex WITHOUT the leading # { "token": "comment", "foreground": "6b6258", "fontStyle": "italic" }, { "token": "keyword", "foreground": "e0683c" }, { "token": "string", "foreground": "8fa86a" }, { "token": "constant.numeric", "foreground": "d9a441" }, { "token": "type", "foreground": "5f90c4" }, { "token": "entity.name.function", "foreground": "b06aa0" } ], "colors": { // optional Monaco IColors (# prefixed) "editor.background": "#1a1714", "editor.foreground": "#e7ddd0" } } } ``` -------------------------------- ### Create a New Feature Branch Source: https://github.com/0-ai-ug/cate/blob/main/CONTRIBUTING.md Creates a new git branch from 'main' to start working on a feature. Ensure you have cloned the repository and are in the project directory. ```bash git checkout -b my-feature ``` -------------------------------- ### Preventing Exit During Update Install Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/plans/2026-06-07-update-install-rearchitecture.md This code modifies the 'will-quit' event handler to prevent premature process exit when an update is pending installation. This ensures that the electron-updater's install-on-quit mechanism can complete successfully. ```typescript app.on("will-quit", (event) => { if (isUpdatePendingInstall()) { event.preventDefault(); } else { process.reallyExit(0); } }); ``` -------------------------------- ### Run Cate Development and Build Commands Source: https://github.com/0-ai-ug/cate/blob/main/README.md Commands to run the development server with hot reload, type checking, unit tests, end-to-end tests, production build, and packaging for distribution. ```bash bun run dev # dev server with hot reload bun run typecheck bun run test # unit tests (vitest) bun run test:e2e # Playwright integration tests bun run build # production build bun run package # package for distribution (:mac, :win, :linux) ``` -------------------------------- ### Symlink Workflow Prompts Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Symlinks workflow prompt templates into the pi agent directory. These define multi-step agent workflows. ```bash # Symlink workflow prompts mkdir -p ~/.pi/agent/prompts for f in packages/coding-agent/examples/extensions/subagent/prompts/*.md; do ln -sf "$(pwd)/$f" ~/.pi/agent/prompts/$(basename "$f") done ``` -------------------------------- ### Generate Base64 for Code Signing Certificate Source: https://github.com/0-ai-ug/cate/blob/main/docs/RELEASING.md Use this command to convert your certificate file (e.g., .pfx) into a base64 encoded string for use in repository secrets. Paste the output directly into the secret value. ```bash base64 -i path/to/cert.pfx | tr -d '\n' # paste the output into the secret ``` -------------------------------- ### Agent Definition Structure Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Illustrates the structure of an agent definition markdown file, including YAML frontmatter for configuration and a system prompt. ```markdown --- name: my-agent description: What this agent does tools: read, grep, find, ls model: claude-haiku-4-5 --- System prompt for the agent goes here. ``` -------------------------------- ### Run Development Checks Source: https://github.com/0-ai-ug/cate/blob/main/CONTRIBUTING.md Executes various checks including type checking, unit tests, build, and linting. These should pass before pushing changes. ```bash npm run typecheck npm run test:unit npm run build npm run typecheck npm run lint ``` -------------------------------- ### Public Entry Point: loadLayoutIntoCanvas Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md Loads a saved layout into a specified canvas, used by the empty-canvas overlay. It delegates to applyLayoutToCanvas and handles clearing an empty canvas gracefully. ```typescript function loadLayoutIntoCanvas(name: string, wsId: WorkspaceId, canvasPanelId: PanelId, storeApi: AppStoreApi) { const snap = getLayoutSnapshot(name); applyLayoutToCanvas(wsId, canvasPanelId, storeApi, snap); } ``` -------------------------------- ### Rebuild Companion Daemon Tarball Source: https://github.com/0-ai-ug/cate/blob/main/README.md Re-run this command to rebuild the companion daemon, especially after making changes to the source files under `src/companion/`. ```bash bun run companion:tarball ``` -------------------------------- ### Symlink Agent Definitions Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Symlinks agent definition markdown files into the pi agent directory. This makes custom agents discoverable. ```bash # Symlink agents mkdir -p ~/.pi/agent/agents for f in packages/coding-agent/examples/extensions/subagent/agents/*.md; do ln -sf "$(pwd)/$f" ~/.pi/agent/agents/$(basename "$f") done ``` -------------------------------- ### Validate Theme Schema with Ajv Source: https://github.com/0-ai-ug/cate/blob/main/skills/cate-theme/SKILL.md Use Ajv to validate a theme JSON file against its schema. This command-line approach is useful for automated checks. ```bash npx ajv validate -s theme.schema.json -d mytheme.json ``` -------------------------------- ### Symlink Subagent Extension Source: https://github.com/0-ai-ug/cate/blob/main/src/agent/extensions/subagent/README.md Symlinks the subagent extension files into the pi agent directory. This is a prerequisite for using the extension. ```bash # Symlink the extension (must be in a subdirectory with index.ts) mkdir -p ~/.pi/agent/extensions/subagent ln -sf "$(pwd)/packages/coding-agent/examples/extensions/subagent/index.ts" ~/.pi/agent/extensions/subagent/index.ts ln -sf "$(pwd)/packages/coding-agent/examples/extensions/subagent/agents.ts" ~/.pi/agent/extensions/subagent/agents.ts ``` -------------------------------- ### Core Helper: applyLayoutToCanvas Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md A core helper function that clears the existing panels on a target canvas and then recreates the nodes from a layout snapshot. It also handles setting the active panel and zooming to fit. ```typescript function applyLayoutToCanvas(wsId: WorkspaceId, canvasPanelId: PanelId, storeApi: AppStoreApi, snap: LayoutSnapshot) { // Clear existing panels on the target canvas const panelIds = nodes(storeApi).map(n => n.panelId); for (const pid of panelIds) app.closePanel(wsId, pid); // Set the active panel and recreate nodes from the snapshot setActivePanel(canvasPanelId); recreateNodes(wsId, canvasPanelId, snap); // Zoom to fit the canvas contents storeApi.getState().zoomToFit(); } ``` -------------------------------- ### Public Entry Point: loadLayoutIntoActiveCanvas Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md Resolves the active canvas and delegates to applyLayoutToCanvas to load a saved layout. This function is used by the saved layouts manager dialog and the native menu. ```typescript function loadLayoutIntoActiveCanvas(name: string) { const canvasPanelId = getActiveCanvasPanelId(); const storeApi = ensureCanvasOpsForPanel(canvasPanelId); const snap = getLayoutSnapshot(name); applyLayoutToCanvas(storeApi.getState().workspace.id, canvasPanelId, storeApi, snap); } ``` -------------------------------- ### Forward Size in placePanel Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md Modifies the placePanel function to forward the 'size' property from placement when the target is a canvas. This ensures that panel sizes are passed to the node creation process. ```typescript async placePanel(placement: PanelPlacement, ops: CanvasOperations) { // ... existing code ... if (placement.target === "canvas") { // Forward placement.size (when target === 'canvas') into ops.addNodeAndFocus(...) await ops.addNodeAndFocus(placement.canvasPanelId, placement.position, placement.size); // Pass size here } else { // ... existing code for dock target ... } // ... existing code ... } ``` -------------------------------- ### Update CanvasOperations.addNodeAndFocus Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md Updates the CanvasOperations.addNodeAndFocus method to accept an optional 'size' parameter. This size is then passed down to the addNode function. ```typescript async addNodeAndFocus(panelId: PanelId, position: Point, size?: Size) { // ... existing code ... // Pass the optional size to addNode const node = await this.addNode(panelId, position, size); // ... existing code ... } ``` -------------------------------- ### Modify recreateNodes for Target Canvas and Size Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md Enhances the recreateNodes function to honor the target canvas and include panel size in the placement object. It also adds support for recreating 'agent' panels. ```typescript function recreateNodes(wsId: WorkspaceId, canvasPanelId: PanelId, snap: LayoutSnapshot) { // ... existing code ... for (const node of snap.nodes) { const placement: PanelPlacement = { target: "canvas", canvasPanelId, position: node.origin, size: node.size, // Include saved size }; switch (node.type) { case "terminal": case "editor": case "document": case "browser": // Guard editor/document recreation on a non-empty filePath if (node.type === "editor" || node.type === "document") { if (!node.filePath) continue; } createNode(wsId, node.type, placement); break; case "agent": // Add case for 'agent' panels createAgent(wsId, node.origin, placement); break; default: // ... existing code ... } } } ``` -------------------------------- ### macOS Translocation Check Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/plans/2026-06-07-update-install-rearchitecture.md This snippet checks if the application is eligible for self-update on macOS, specifically addressing translocation issues where the app is not in the /Applications folder. If ineligible, it disables automatic updates and prompts the user to move the app to Applications. ```typescript if (process.platform === "darwin" && !app.isInApplicationsFolder()) { canSelfUpdate = false; } ``` -------------------------------- ### Update PanelPlacement Type Source: https://github.com/0-ai-ug/cate/blob/main/docs/superpowers/specs/2026-06-07-saved-layout-apply-design.md Adds an optional 'size' property to the PanelPlacement type for canvas variants. This allows saving and restoring panel dimensions. ```typescript type PanelPlacement = { target: "canvas"; canvasPanelId: PanelId; position: Point; size?: Size; // Added for saving/restoring panel dimensions } | { target: "dock"; dockId: DockId; position: Point; }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.