Skip to content

Conversation

@archandatta
Copy link
Contributor

@archandatta archandatta commented Dec 5, 2025

Description

  • adds templates from onkernel/create-kernel-app/templates
  • adds template validation, catching edge cases from the user

Testing

  • uncomment line 133 in root.go
  • run make build && ./bin/kernel create
  • should walk through the prompts and create a new app with both languages
  • should present a set of templates respective to the language chosen

Note

Adds comprehensive Python and TypeScript app templates (Computer Use, CUA, Stagehand, Gemini CUA, Magnitude, samples) and updates template embedding to include all assets.

  • Templates (TypeScript):
    • Add computer-use (Anthropic), cua (OpenAI CUA), stagehand, gemini-cua (Gemini 2.5 + Stagehand), magnitude, and a basic sample app with Playwright integration.
    • Include project configs (package.json, tsconfig.json), lockfiles, and utility code (tools, loops, utils).
  • Templates (Python):
    • Add computer-use (Anthropic) with a full sampling loop, Playwright-based computer tools, and Kernel app entrypoint.
    • Add cua (OpenAI) with Playwright computers (local + Kernel), agent loop, and utilities.
    • Include pyproject.toml, uv.lock, READMEs, and _gitignore files.
  • Template loader:
    • Change pkg/templates/templates.go to embed all:* so non-TS assets are included.
  • Misc:
    • Update TypeScript sample app deps and docs; add base TS config and .gitignore.

Written by Cursor Bugbot for commit 97f7d38. This will update automatically on new commits. Configure here.

@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Dec 5, 2025

Mesa Description

Description

  • adds templates from onkernel/create-kernel-app/templates
  • adds template validation, catching edge cases from the user
  • The CLI now supports creating new applications with a choice of Python or TypeScript templates, including advanced samples for browser automation and computer use agents.

Testing

  • uncomment line 133 in root.go
  • run make build && ./bin/kernel create
  • should walk through the prompts and create a new app with both languages
  • should present a set of templates respective to the language chosen

Description generated by Mesa. Update settings

@archandatta archandatta marked this pull request as ready for review December 5, 2025 19:02
@archandatta archandatta requested a review from rgarcia December 5, 2025 19:02
Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed full review of 89aa20b...0d15518

Analysis

  1. Non-Deterministic Template Ordering: The GetSupportedTemplatesForLanguage function uses unordered map iteration, causing templates to appear in random order each time users run the command, creating an inconsistent UX. Templates should be sorted before display.

  2. Insufficient Validation: No verification that template directories exist in the embedded filesystem, required files are present, or that template metadata matches actual directories. This creates risk of runtime failures when templates are used.

  3. Eliminated Test Coverage: Removal of TestTemplates leaves the template registry without automated validation, increasing risk of misconfiguration with the expanded template set.

  4. Overly Broad Embed Directive: Changing from //go:embed all:typescript to //go:embed all:* now embeds ALL files, including potentially sensitive or unnecessary hidden files, which could lead to bloated binaries or security issues.

  5. Suboptimal Error Handling: Error handling in GetTemplateKeyFromValue lacks wrapped sentinel errors, making it difficult for callers to distinguish between different error types.

Tip

Help

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

102 files reviewed | 0 comments | Edit Agent SettingsRead Docs

@archandatta archandatta mentioned this pull request Dec 8, 2025
@archandatta archandatta force-pushed the archand/add-templates branch from 0d15518 to ed1d016 Compare December 8, 2025 17:38
Base automatically changed from archand/port/create-kernel-app to main December 9, 2025 19:32
await page.evaluate(
"""(width, height) => {window.resizeTo(width, height)}""",
**self.browser_profile.window_size,
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect unpacking of arguments in page.evaluate call

The page.evaluate call uses **self.browser_profile.window_size which unpacks the dictionary as keyword arguments (width=1024, height=786). However, Playwright's page.evaluate method signature is evaluate(expression, arg=None) - it accepts a single positional arg parameter, not keyword arguments. This will raise a TypeError because evaluate() doesn't accept width and height as keyword parameters. The dictionary needs to be passed directly as a single argument, and the JavaScript expression updated to destructure it.

Fix in Cursor Fix in Web

@archandatta archandatta merged commit 80cfeb4 into main Dec 9, 2025
2 checks passed
@archandatta archandatta deleted the archand/add-templates branch December 9, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants