Skip to content

feat: add browser-native playground#3123

Open
anish-sahoo wants to merge 14 commits into
mainfrom
cog-playground-spa
Open

feat: add browser-native playground#3123
anish-sahoo wants to merge 14 commits into
mainfrom
cog-playground-spa

Conversation

@anish-sahoo

Copy link
Copy Markdown
Member

Summary

  • add an embedded, browser-native cog playground SPA with no production frontend build
  • preserve schema inputs, sync/stream/async predictions, files, validation, inspectors, CodeMirror, themes, and responsive behavior
  • add a protected Go proxy/webhook server, frozen vendored assets, dependency-free integration tests, and one path-gated CI check

Testing

  • mise run test:playground
  • mise run typecheck:playground
  • mise run lint:playground
  • mise run fmt:playground
  • go test ./pkg/cli
  • mise run lint:go
  • mise run fmt:go
  • mise run docs:llm:check
  • mise run docs:cli:check
  • mise run fmt:docs
  • mise run lint:docs
  • mise run build:cog

@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests. The Go server code is well-structured with proper security headers, CORS bypass via proxying, and loopback-only protection for UI routes. Tests cover proxy behavior, SSE framing, webhook concurrency limits, and asset integrity.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it neither depends on playground:install nor specifies tools. This breaks mise run test for developers without Node already in their PATH.

Comment thread mise.toml
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests. The Go server code is well-structured with proper security headers, CORS bypass via proxying, and loopback-only protection for UI routes. Tests cover proxy behavior, SSE framing, webhook concurrency limits, and asset integrity.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it neither depends on playground:install nor specifies tools. This breaks mise run test for developers without Node already in their PATH.

I've posted a review with a suggestion on mise.toml:322.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests. The Go server code is well-structured with proper security headers, CORS bypass via proxying, and loopback-only protection for UI routes. Tests cover proxy behavior, SSE framing, webhook concurrency limits, and asset integrity.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH.

Comment thread mise.toml
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The task runs node but has no depends or tools declaration, breaking mise run test for developers without Node in PATH.

Posted a suggestion on mise.toml:322.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

Comment thread mise.toml
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

Posted a suggestion on mise.toml:325.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

Comment thread mise.toml
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

I've posted a review with a suggestion on mise.toml:325.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

Comment thread mise.toml
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

I've posted a review with a suggestion on mise.toml:324.

github run

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

Comment thread mise.toml
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

This PR adds a new cog playground command with an embedded browser-native SPA, reverse proxy, webhook relay, and comprehensive tests.

One issue found:

  1. test:playground task doesn't ensure Node.js is installed — The test:playground mise task runs node --test '*.test.js' but doesn't declare node as a tool dependency. Unlike fmt:playground, lint:playground, and typecheck:playground, it has no depends or tools declaration. This breaks mise run test for developers without Node already in their PATH. The CI job works around this with actions/setup-node, but local development is affected.

Posted a suggestion on mise.toml:324.

github run

@anish-sahoo
anish-sahoo marked this pull request as ready for review July 20, 2026 22:17
@anish-sahoo
anish-sahoo requested a review from a team as a code owner July 20, 2026 22:17
@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@anish-sahoo Bonk workflow was cancelled.

View workflow run · To retry, trigger Bonk again.

@ask-bonk

ask-bonk Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

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.

1 participant