Skip to content

Switch to @onkernel/cu-playwright package and template refactoring #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bigboateng
Copy link

@bigboateng bigboateng commented Jun 23, 2025

Description

πŸ”„ Implementation Changes

  • Switched from custom inline implementation to @onkernel/cu-playwright package

πŸ“¦ Template Restructuring

  • Renamed templates/python/computer-use β†’ templates/python/claude-cu
  • Renamed templates/typescript/anthropic-computer-use β†’ templates/typescript/claude-cu
  • Both Python and TypeScript now use the same template name: claude-cu (shorter and cleaner)

Updated app names for consistency:
Python: python-cu β†’ python-claude-cu
TypeScript: ts-anthropic-cu β†’ ts-claude-cu

# Unified template name
npx create-kernel-app my-app --template claude-cu --language python
npx create-kernel-app my-app --template claude-cu --language typescript

Implementation Checklist

  • Implemented this change in TypeScript
  • Implemented this change in Python (updated app name and template structure)

Everything below is not applicable

Testing

  • All tests pass locally
  • Linted
  • Added tests for new functionality (if applicable)

Docs

  • Link to a PR in our docs repo documenting your change (if applicable)

Visual Proof

  1. Template selection of ts-claude-cuI

image

  1. Successful deployment of the template generated ts app

image
3. *Sucessful run of a query *

image

Related Issue

maybe related?

Additional Notes

  • Used git mv to preserve file history during template renames for python

- Remove templates/typescript/computer-use directory and all related files
- Update CLI to make computer-use template Python-only
- Remove TypeScript-specific computer-use examples from invoke samples
- Simplify template offerings while preserving Python computer-use functionality
- TypeScript users can use the cua template for computer use functionality
@bigboateng bigboateng marked this pull request as ready for review June 23, 2025 16:22
@juecd juecd self-requested a review June 23, 2025 17:25
@juecd
Copy link
Contributor

juecd commented Jun 23, 2025

I think we still want to include a cu sample app in create-kernel-app, so kernel invoke ts-cu cu-task --payload '{"query": "Search for the top 3 restaurants in NYC according to Pete Wells"}' still works. But it should reference our published SDK instead. Does that make sense? e.g. in /typescript/cu the repo should basically be:

// index.ts
import { ComputerUseAgent } from '@onkernel/cu-playwright-ts';
const agent = new ComputerUseAgent({
  apiKey: process.env.ANTHROPIC_API_KEY!,
  page,
});
const answer = await agent.execute(payload.query); // payload from app.action("cu-task"), ...

@bigboateng
Copy link
Author

I think we still want to include a cu sample app in create-kernel-app, so kernel invoke ts-cu cu-task --payload '{"query": "Search for the top 3 restaurants in NYC according to Pete Wells"}' still works. But it should reference our published SDK instead. Does that make sense? e.g. in /typescript/cu the repo should basically be:

// index.ts
import { ComputerUseAgent } from '@onkernel/cu-playwright-ts';
const agent = new ComputerUseAgent({
  apiKey: process.env.ANTHROPIC_API_KEY!,
  page,
});
const answer = await agent.execute(payload.query); // payload from app.action("cu-task"), ...

Yep working on the cu sample here #42 should we put that in this pr too? I thought seperating will be cleaner

@bigboateng bigboateng mentioned this pull request Jun 27, 2025
6 tasks
- Rename templates/python/computer-use -> templates/python/claude-cu
- Rename templates/typescript/anthropic-computer-use -> templates/typescript/claude-cu
- Update index.ts to use 'claude-cu' template name for both Python and TypeScript
- Update app names: python-cu -> python-claude-cu, ts-anthropic-cu -> ts-claude-cu
- Update README.md with new template names and examples
- Maintain git history with git mv for clean diffs
@bigboateng bigboateng changed the title refactor: remove TypeScript computer-use template Switch to @onkernel/cu-playwright package and template refactoring Jun 30, 2025
@bigboateng
Copy link
Author

@juecd made the changes

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.

What Changed

This PR overhauls the computer-use templates. The key change is the removal of the custom implementation in templates/typescript/computer-use and its replacement with a new, simpler template that leverages the @onkernel/cu-playwright package. For consistency, both the Python and TypeScript templates have been renamed to claude-cu, providing a unified name for users of create-kernel-app. The new TypeScript template also introduces modern tooling like ESLint and Prettier, improving code quality.

Risks / Concerns

This is a fantastic refactor that simplifies the codebase by abstracting complex logic into the @onkernel/cu-playwright package. The changes are well-structured and significantly improve the developer experience by unifying the template names. The only minor point of feedback was a suggestion to fully delete a _gitignore file instead of leaving it empty in a removed template directory, which is a trivial cleanup. No significant risks were identified.

25 files reviewed | 1 comments | Review on Mesa | Edit Reviewer Settings

@@ -1,39 +0,0 @@
# Dependencies
Copy link

Choose a reason for hiding this comment

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

Since this entire template directory is being removed in favor of the new claude-cu template, this file should probably be deleted entirely rather than just emptied. An empty gitignore file in a deprecated template directory doesn't serve any purpose.

Type: Logic | Severity: Low

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.

2 participants