import type { TestSequence } from '../types'; import { standardSetup, handlebarsSetup, defaultPromptMd, basicCSSFile } from './setup-data'; export const testSequences: TestSequence[] = [ { id: 'seq-bash-read', name: 'Bash: Read Operations', category: 'bash', setupFiles: standardSetup, steps: [ { id: 'seq-bash-read-cat', name: 'Read file and extract value', prompt: 'Read index.html and tell me the page title.', assertions: [ { type: 'tool_used', toolName: 'bash', description: 'Used shell tool' }, { type: 'output_matches', pattern: 'Test App', description: 'Output contains page title' }, ], }, { id: 'seq-bash-read-head', name: 'Read partial file with head', prompt: 'Show me only the first 10 lines of index.html using head. What is the charset?', assertions: [ { type: 'tool_args_match', toolName: 'bash', pattern: 'head', description: 'Used head command' }, { type: 'output_matches', pattern: 'UTF-8', description: 'Found charset from first 10 lines' }, ], }, { id: 'seq-bash-read-tree', name: 'List files with tree', prompt: 'List all files in the project using tree, then tell me how many files there are.', assertions: [ { type: 'tool_args_match', toolName: 'bash', pattern: 'tree|ls|find', description: 'Used file listing command' }, { type: 'tool_output_matches', toolName: 'bash', pattern: 'index\\.html|styles\\.css|script\\.js', description: 'Output lists project files' }, ], }, ], }, { id: 'seq-bash-search', name: 'Bash: Search Operations', category: 'bash', setupFiles: standardSetup, steps: [ { id: 'seq-bash-search-grep', name: 'Search with grep', prompt: "Use grep to find all lines in index.html that contain 'class' and show line numbers.", assertions: [ { type: 'tool_args_match', toolName: 'bash', pattern: 'grep|rg', description: 'Used search command' }, { type: 'tool_output_matches', toolName: 'bash', pattern: 'class', description: 'Tool output contains class matches' }, ], }, { id: 'seq-bash-search-rg', name: 'Search across files with rg', prompt: "Search across all files for the word 'function' using rg.", assertions: [ { type: 'tool_args_match', toolName: 'bash', pattern: 'rg.*function', description: 'Used rg to search for function' }, { type: 'tool_output_matches', toolName: 'bash', pattern: 'function', description: 'Tool output contains function matches' }, ], }, { id: 'seq-bash-search-find', name: 'Find files by extension', prompt: 'Find all .css files in the project.', assertions: [ { type: 'tool_args_match', toolName: 'bash', pattern: 'find|ls|rg|grep', description: 'Used file discovery command' }, { type: 'tool_output_matches', toolName: 'bash', pattern: 'styles\\.css', description: 'Tool output contains styles.css' }, ], }, ], }, { id: 'seq-bash-write', name: 'Bash: Write & Text Processing', category: 'bash', setupFiles: standardSetup, steps: [ { id: 'seq-bash-write-mkdir', name: 'Create directories and files', prompt: "Create a directory called 'components' with three empty files: header.html, footer.html, sidebar.html.", assertions: [ { type: 'file_exists', path: '/components/header.html', description: 'header.html created' }, { type: 'file_exists', path: '/components/footer.html', description: 'footer.html created' }, { type: 'file_exists', path: '/components/sidebar.html', description: 'sidebar.html created' }, ], }, { id: 'seq-bash-write-cp-mv', name: 'Copy and rename files', prompt: 'Copy styles.css to styles-backup.css, then rename script.js to app.js.', assertions: [ { type: 'file_exists', path: '/styles-backup.css', description: 'styles-backup.css created' }, { type: 'file_exists', path: '/app.js', description: 'app.js exists (renamed)' }, { type: 'file_not_exists', path: '/script.js', description: 'script.js removed after rename' }, ], }, { id: 'seq-bash-write-echo', name: 'Create file with echo redirect', prompt: "Create a new file /data.json with a JSON object containing name 'Test' and version 1 using echo and redirect.", assertions: [ { type: 'file_exists', path: '/data.json', description: 'data.json created' }, { type: 'valid_json', path: '/data.json', description: 'data.json is valid JSON' }, { type: 'file_matches', path: '/data.json', pattern: '[Tt]est', description: 'Contains "Test" name' }, ], }, { id: 'seq-bash-write-sed', name: 'In-place substitution with sed', prompt: "Use sed to change all occurrences of '#007bff' to '#e74c3c' in styles.css.", assertions: [ { type: 'file_not_contains', path: '/styles.css', value: '#007bff', description: 'Old color removed' }, { type: 'file_contains', path: '/styles.css', value: '#e74c3c', description: 'New color applied' }, ], }, { id: 'seq-bash-write-pipe', name: 'Pipe cat through sed to new file', prompt: "Read index.html with cat, pipe through sed to replace 'Test App' with 'My App', redirect to /output.html.", assertions: [ { type: 'file_exists', path: '/output.html', description: 'output.html created' }, { type: 'file_contains', path: '/output.html', value: 'My App', description: 'Contains replaced text' }, ], }, { id: 'seq-bash-write-chain', name: 'Chained commands with &&', prompt: "Create a 'pages' directory, create about.html and contact.html inside it, list contents — single command with &&.", assertions: [ { type: 'file_exists', path: '/pages/about.html', description: 'about.html created in pages/' }, { type: 'file_exists', path: '/pages/contact.html', description: 'contact.html created in pages/' }, ], }, { id: 'seq-bash-write-pipe-chain', name: 'Multi-stage pipe chain', prompt: "Cat index.html, pipe through grep to find lines with 'nav', pipe through head for first 3 matches.", assertions: [ { type: 'tool_args_match', toolName: 'bash', pattern: '\\|', description: 'Used pipe operator' }, { type: 'tool_output_matches', toolName: 'bash', pattern: 'nav', description: 'Tool output contains nav matches' }, ], }, ], }, { id: 'seq-file-editing', name: 'File Editing: Basics', category: 'file-editing', setupFiles: standardSetup, steps: [ { id: 'seq-edit-update', name: 'Update text in file', prompt: "Change the page title from 'Test App' to 'My Application' in index.html.", assertions: [ { type: 'file_contains', path: '/index.html', value: 'My Application', description: 'New title present' }, { type: 'file_not_contains', path: '/index.html', value: 'Test App', description: 'Old title removed' }, ], }, { id: 'seq-edit-new-file', name: 'Create new file', prompt: "Create a new /about.html with heading 'About Us' and a paragraph of placeholder text.", assertions: [ { type: 'file_exists', path: '/about.html', description: 'about.html created' }, { type: 'file_matches', path: '/about.html', pattern: 'About Us', description: 'Contains About Us heading' }, ], }, { id: 'seq-edit-multi-op', name: 'Multiple edits to same file', prompt: "In index.html: update the h1 text to 'Portfolio', and add a footer before the closing body tag.", assertions: [ { type: 'file_matches', path: '/index.html', pattern: 'Portfolio', description: 'H1 text changed' }, { type: 'file_matches', path: '/index.html', pattern: 'footer', description: 'Footer added' }, ], }, { id: 'seq-edit-nav', name: 'Replace nav with new content', prompt: "Replace the nav element in index.html with a new nav containing a logo span 'MySite' and links to Home, Portfolio, Blog, and Contact.", assertions: [ { type: 'file_matches', path: '/index.html', pattern: 'MySite', description: 'Has logo text' }, { type: 'file_matches', path: '/index.html', pattern: 'Portfolio', description: 'Has Portfolio link' }, { type: 'file_matches', path: '/index.html', pattern: 'Blog', description: 'Has Blog link' }, ], }, { id: 'seq-edit-rewrite', name: 'Rewrite entire file', prompt: 'Replace styles.css entirely with a modern CSS reset.', assertions: [ { type: 'file_not_contains', path: '/styles.css', value: '.btn:hover', description: 'Original content replaced' }, { type: 'file_matches', path: '/styles.css', pattern: 'box-sizing|margin:\\s*0|border-box', description: 'Contains CSS reset content' }, ], }, { id: 'seq-edit-style-block', name: 'Replace specific CSS rule block', prompt: "In styles.css, add a .btn rule with padding: 12px 24px, background: #e74c3c, border-radius: 8px, and a .btn:hover that changes background to #c0392b and adds transform: translateY(-2px).", assertions: [ { type: 'file_contains', path: '/styles.css', value: '#e74c3c', description: 'New button color' }, { type: 'file_contains', path: '/styles.css', value: 'border-radius: 8px', description: 'New border-radius' }, { type: 'file_contains', path: '/styles.css', value: 'translateY', description: 'Has transform on hover' }, ], }, { id: 'seq-edit-js-handler', name: 'Replace JS event handler', prompt: "In script.js, replace the click event listener with one that adds an 'active' class to the clicked link, removes 'active' from all other links, and smoothly scrolls to the target section.", assertions: [ { type: 'file_matches', path: '/script.js', pattern: 'active', description: 'Uses active class' }, { type: 'file_matches', path: '/script.js', pattern: 'scroll|scrollIntoView|scrollTo', description: 'Has smooth scroll' }, { type: 'file_matches', path: '/script.js', pattern: 'DOMContentLoaded|addEventListener', description: 'Still has event listener structure' }, ], }, { id: 'seq-edit-entity-nav', name: 'Replace HTML entity (nav)', prompt: 'Replace the nav element in index.html with a new nav containing a logo and three links: Home, Portfolio, Contact.', assertions: [ { type: 'file_matches', path: '/index.html', pattern: 'logo|brand|site-name|site-title', description: 'Has logo/brand element' }, { type: 'file_matches', path: '/index.html', pattern: 'Portfolio|Contact', description: 'Has new nav links' }, ], }, ], }, { id: 'seq-file-editing-stress', name: 'File Editing: Stress Tests', category: 'file-editing', setupFiles: standardSetup, steps: [ { id: 'seq-stress-special-chars', name: 'Edit file with special characters', prompt: "Update index.html: change the script tag content to include a template literal that logs `Hello, ${name}! Welcome to \"OSW Studio\" — it's great.` and a regex /\\d+\\.\\d+/g.", assertions: [ { type: 'file_contains', path: '/index.html', value: '${name}', description: 'Contains template literal variable' }, { type: 'file_matches', path: '/index.html', pattern: 'it.s great', description: 'Contains apostrophe text' }, { type: 'file_matches', path: '/index.html', pattern: '\\\\d', description: 'Contains regex pattern' }, ], }, { id: 'seq-stress-sequential-edits', name: 'Sequential edits to same file', prompt: "Make these changes to index.html in order: 1) Change the title to 'My Portfolio', 2) Add a class 'dark-theme' to the body tag, 3) Add a footer with text 'Built with OSW Studio' before .", assertions: [ { type: 'file_contains', path: '/index.html', value: 'My Portfolio', description: 'Title changed' }, { type: 'file_contains', path: '/index.html', value: 'dark-theme', description: 'Body class added' }, { type: 'file_contains', path: '/index.html', value: 'Built with OSW Studio', description: 'Footer added' }, ], }, { id: 'seq-stress-json', name: 'Create and edit JSON file', prompt: "Create /config.json with a JSON object containing: name (string), version (string \"1.0.0\"), features (array of 3 strings), settings (nested object with theme: \"dark\", language: \"en\", debug: false).", assertions: [ { type: 'file_exists', path: '/config.json', description: 'config.json created' }, { type: 'valid_json', path: '/config.json', description: 'Valid JSON' }, { type: 'file_contains', path: '/config.json', value: '"version"', description: 'Has version field' }, { type: 'file_contains', path: '/config.json', value: '"debug"', description: 'Has nested debug setting' }, ], }, { id: 'seq-stress-css', name: 'Create complex CSS file', prompt: "Create /theme.css with: CSS custom properties on :root (--primary, --secondary, --bg, --text colors), a .container class with max-width, .btn with multiple states (:hover, :active, :disabled), a @media query for mobile, and a @keyframes fadeIn animation.", assertions: [ { type: 'file_exists', path: '/theme.css', description: 'theme.css created' }, { type: 'file_contains', path: '/theme.css', value: '--primary', description: 'Has CSS custom property' }, { type: 'file_matches', path: '/theme.css', pattern: ':hover', description: 'Has hover state' }, { type: 'file_matches', path: '/theme.css', pattern: '@media', description: 'Has media query' }, { type: 'file_matches', path: '/theme.css', pattern: '@keyframes', description: 'Has keyframes animation' }, ], }, { id: 'seq-stress-multiline', name: 'Update multi-line block', prompt: "Replace the entire nav element in index.html (from