Skip to content

Create authoring assistant example application #59

@geoffjay

Description

@geoffjay

Summary

Create a purpose-built example at examples/assistant/app.xml that demonstrates the full generate-preview-iterate loop: a chat panel with Nemo-specific system prompt, a code editor showing the generated config, and a launch preview button.

Context

This example becomes the recommended entry point for new Nemo developers. It combines:

  • A <chat> panel with a Nemo-specific system prompt that includes the full component schema
  • A <code-editor> pane displaying the current generated config
  • A "Launch Preview" button that writes the code editor content to a temp file and runs the Nemo app
  • A simplified component reference panel (leveraging the storybook from the Component Storybook epic)

The application should feel like pair-programming with an AI that knows Nemo.

Acceptance Criteria

  • Example directory created at examples/assistant/ with:
    • app.xml — main config
    • scripts/handlers.rhai — event handlers for launch, edit, navigation
    • README.md — setup and usage instructions
  • Layout: horizontal split with chat panel (left) and preview panel (right)
  • Chat panel initialized with Nemo-specific system prompt (from generated schema reference)
  • Code editor pane displays the most recent generated config with syntax highlighting (language="xml")
  • "Launch Preview" button writes editor content to a temp XML file in $TMPDIR/nemo-preview/
  • "Launch Preview" invokes the Nemo runtime to load and render the temp file
  • Component reference panel (right sidebar or bottom section) shows a compact list of available components from the registry
  • Panel includes search/filter input for components
  • README documents: prerequisites (LLM API key), how to launch, workflow description
  • Handles the on-response event from <chat> to update the code editor

Relevant Files

  • examples/ — existing examples for reference
  • crates/nemo/src/components/code_editor.rs — code editor component
  • crates/nemo/src/runtime.rs — NemoRuntime for temp file loading

Stack Base

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions