Skip to content

Commit 895c72f

Browse files
committed
feat: agent templates tab, security scan upgrade, page-view mode
- Added 9 new Agent templates (Plan a Feature, Review My Code, Security Scan, Clean Up Code, Generate Docs, Python Review, Design Architecture, Debug This Error, SQL Optimizer) - Added 5 ECC-inspired Agent templates (TDD Guide, Database Review, Generate E2E Tests, API Design Review, Fix Build Errors) - Upgraded Security Scan to 3-step pipeline (Vulnerability Scan → Attack Simulation → Remediation Plan) with language/framework/scanDepth variables - Added Agents category pill and bi-robot icon to template modal - Added page-view mode for A4-style document preview with pagebreak support - Fixed duplicate game tags in games.js and emoji encoding in maths quiz prebuilt - Minor README/docgen fixes
1 parent 1c86d60 commit 895c72f

2 files changed

Lines changed: 79 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
| **✉️ Email to Self** | Send documents directly to your inbox from the share modal — email address input with `.md` file attached + share link; powered by Google Apps Script (free, 100 emails/day); loading state + success/error feedback; email persisted in localStorage; zero third-party dependencies |
4848
| **💾 Disk Workspace** | Folder-backed storage via File System Access API — "Open Folder" in sidebar header; `.md` files read/written directly to disk; `.textagent/workspace.json` manifest; debounced autosave ("💾 Saved to disk" indicator); refresh from disk for external edits; disconnect to revert to localStorage; auto-reconnect on reload via IndexedDB handles; unified action modal for rename/duplicate/delete with confirmation; Chromium-only (hidden in unsupported browsers) |
4949
| **📈 Finance Dashboard** | Stock/crypto/index dashboard templates with live TradingView charts; dynamic grid via `data-var-prefix` (add/remove tickers in `@variables` table, grid auto-adjusts); configurable chart range (`1M`, `12M`, `36M`), interval (`D`, `W`, `M`), and EMA period (default 52); interactive 1M/1Y/3Y range + 52D/52W/52M EMA toggle buttons; `@variables` table persists after ⚡ Vars for re-editing; JS code block generates grid HTML from variables |
50-
| **Extras** | Auto-save (localStorage + cloud), table of contents, image paste, 109+ templates (13 categories: AI, Agents, Coding, Creative, Documentation, Finance, Games, Maths, PPT, Project, Quiz, Tables, Technical), AI Model Manager template (local model reference with sizes, privacy, and capabilities), template variable substitution (`$(varName)` with auto-detect), table spreadsheet tools (sort, filter, stats, chart, add row/col, inline cell edit, CSV/MD export), content statistics, modular codebase (13+ JS modules), fully responsive mobile UI with scrollable Quick Action Bar (Files, Search, TOC, Share, Copy, Tools, AI, Model, Upload, Help) and formatting toolbar, multi-file workspace sidebar, compact header mode with collapsible Tools dropdown (Presentation, Zen, Word Wrap, Focus, Voice, Dark Mode, Preview Theme), Clear All / Clear Selection buttons (undoable via Ctrl+Z) |
50+
| **Extras** | Auto-save (localStorage + cloud), table of contents, image paste, 123+ templates (14 categories: AI, Agents, Coding, Creative, Documentation, Finance, Games, Maths, PPT, Project, Quiz, Skills, Tables, Technical), AI Model Manager template (local model reference with sizes, privacy, and capabilities), template variable substitution (`$(varName)` with auto-detect), table spreadsheet tools (sort, filter, stats, chart, add row/col, inline cell edit, CSV/MD export), content statistics, modular codebase (13+ JS modules), fully responsive mobile UI with scrollable Quick Action Bar (Files, Search, TOC, Share, Copy, Tools, AI, Model, Upload, Help) and formatting toolbar, multi-file workspace sidebar, compact header mode with collapsible Tools dropdown (Presentation, Zen, Word Wrap, Focus, Voice, Dark Mode, Preview Theme), Clear All / Clear Selection buttons (undoable via Ctrl+Z) |
5151
| **Dev Tooling** | ESLint + Prettier (lint, format:check), Playwright test suite — 484 tests across smoke, feature, integration, dev, regression, performance, quality, and security categories (import, export, share, view-mode, editor, email-to-self, secure share, startup timing, export integrity, persistence, module loading, disk workspace, context memory, exec engine, build validation, load-time, accessibility, video player, TTS, STT, file converters, stock widget, embed grid, model registry, model tag, game tag, static analysis, code smell, XSS hardening, Florence-2 model, Docling model, TTS download), pre-commit changelog enforcement, GitHub Actions CI |
5252

5353
## 🤖 AI Assistant
@@ -460,6 +460,9 @@ TextAgent has undergone significant evolution since its inception. What started
460460
| Date | Commits | Feature / Update |
461461
|------|---------|-----------------|
462462
| **2026-03-16** | | 📄 **Page View (A4 Document Mode)** — new split-layout "Page" view mode (editor left, A4 page frames right) with automatic content reflow into 210×297mm page frames; `<!-- pagebreak -->` HTML comment markers force new pages; page counter, zoom dropdown (50%–125%), and Export PDF button in page header; `page-view.js` reflow engine measures element heights and distributes across pages; `page-view.css` with shadows, page numbers, dark mode, responsive mobile; button added to header/mobile/QAB; `setViewMode()` extended with `view-page` class and enter/exit lifecycle |
463+
| **2026-03-16** | | 🛡️ **Security Scan Upgrade & ECC-Inspired Agents** — upgraded Security Scan from single-pass OWASP checklist to 3-step pipeline (Vulnerability Scan → Attack Simulation → Remediation Plan) with language/framework/scanDepth variables, ❌/✅ code patterns, A-F grading, and pre-deployment checklist; added 5 new ECC-inspired agent templates (TDD Guide, Database Review, Generate E2E Tests, API Design Review, Fix Build Errors) |
464+
| **2026-03-16** | | 🤖 **Agent Templates Tab** — new Agents category with 9 specialized AI agent templates (Plan a Feature, Review My Code, Security Scan, Clean Up Code, Generate Docs, Python Review, Design Architecture, Debug This Error, SQL Optimizer); `bi-robot` icon; category pill in template modal; multi-step Agent pipelines with contextual variables |
465+
| **2026-03-16** | | 📄 **Page View Mode** — new A4-style paginated document preview with `<!-- pagebreak -->` support; `page-view.js` + `page-view.css` modules; `data-pagebreak` renderer support |
463466
| **2026-03-16** | | 📱 **Mobile Layout Gap Fix** — eliminated a massive white gap that appeared between the toolbar and editor/presentation preview on mobile devices (≤1080px) by fixing a CSS flexbox bug where the closed workspace sidebar still consumed vertical height in column mode |
464467
| **2026-03-16** | | 🐛 **File-Switch State Reset** — fixed Run All button staying in "Stop" mode when switching .md files; fixed document variables leaking across files; new `resetFileSessionState()` in `workspace.js` aborts execution, force-resets `_running` flag, clears Run All button/progress bar/variables/exec context on every file switch; new `forceReset()` in `exec-controller.js` for immediate hard-reset of internal state |
465468
| **2026-03-15** | | 🚀 **Run All Engine & TTS UX** — pre-execution model readiness check auto-loads all required models (AI + Kokoro TTS) before block execution starts; detailed `[RunAll]` console logging with `console.table` block summary, per-block timing, variable resolution status (✅/⚠), and completion summary; Stop button now works during model loading via `M._execAborted` cross-module flag; `ensureModelReadyAsync()` rewritten with fail-fast on missing consent/API key; compact preflight dialog (960px, smaller fonts, all 8 columns visible); `waitForModelReady()` handles Kokoro TTS via `M.tts.isKokoroReady()`; TTS card split into 3 buttons: ▶ Run (generate audio only), ▷ Play (replay stored audio), 💾 Save (download WAV); new `M.tts.generate()`, `playLastAudio()`, `isKokoroReady()`, `initKokoro()` APIs; AI model fallback in `run-requirements.js` correctly defaults to text models |
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Agent Templates & Page View — New Features
2+
3+
- Upgraded "Debug This Error" to 3-phase pipeline: triage & classify → root cause & fix → verify & prevent
4+
- Added `language` and `codeSnippet` variables to Debug template for framework-specific analysis
5+
- Added 14-pattern common-fix lookup table to Debug template (CORS, null ref, module not found, etc.)
6+
- Added DO/DON'T rules table and verification commands to Debug template
7+
- New agent template: Performance Profiler (N+1 detection, memory leaks, O(n²) loops, caching strategy)
8+
- New agent template: Implementation Planner (feature → phased plan with task breakdown, risk assessment)
9+
- New agent template: Git Commit Reviewer (diff → conventional commits, breaking change detection, changelog)
10+
- New agent template: Deployment Checklist (stack → CI/CD pipeline, Docker config, rollback plan)
11+
- New agent template: Cost-Aware LLM Pipeline (model routing, budget tracking, fallback strategies)
12+
- Added "Agents" category pill to template modal for filtering agent templates
13+
- Added `agents` category mapping in template loader (icon + color)
14+
- New: Page View mode (A4 document view with zoom and Export PDF button)
15+
- Added `<!-- pagebreak -->` comment parsing in renderer for document page breaks
16+
- Added `data-pagebreak` to DOMPurify allowed attributes
17+
- New game templates: Canvas 2D Arcade Classics (platformer, top-down shooter, rhythm, tile match, tower defense)
18+
- Fixed: Game prebuilt emoji encoding (HTML entities → native Unicode for Snake, Breakout, etc.)
19+
- Fixed: Snake game localStorage wrapped in try/catch for sandboxed iframes
20+
- Fixed: Breakout game touch event handlers for mobile play
21+
- Fixed: Game template duplicate code blocks removed (was showing source + rendered)
22+
- Fixed: Game iframe sandbox now allows `allow-same-origin` for proper asset loading
23+
24+
---
25+
26+
## Summary
27+
28+
Major agent template expansion and page view mode. Upgraded the Debug This Error template from a basic single-prompt to a systematic 3-phase debugging pipeline inspired by ECC's build-error-resolver. Added 5 brand-new agent templates covering performance profiling, implementation planning, git commit review, deployment checklists, and LLM cost optimization. Also added page view (A4 document mode) and fixed several game template issues.
29+
30+
---
31+
32+
## 1. Debug This Error Template Upgrade
33+
**Files:** `js/templates/agents.js`
34+
**What:** Replaced the single-phase AI prompt with a 3-phase pipeline: Phase 1 (Triage & Classify with error classification table and 14-pattern common-fix lookup), Phase 2 (Root Cause & Fix with before/after diffs, DO/DON'T rules), Phase 3 (Verify & Prevent via Agent multi-step with verification commands, preventive guard code, and related-issue sweep). Added `language` and `codeSnippet` template variables.
35+
**Impact:** Dramatically more actionable debug output — developers get categorized errors, known-pattern matching, minimal diffs, and exact verification commands instead of a generic analysis.
36+
37+
## 2. Five New Agent Templates
38+
**Files:** `js/templates/agents.js`
39+
**What:** Added Performance Profiler, Implementation Planner, Git Commit Reviewer, Deployment Checklist, and Cost-Aware LLM Pipeline templates. Each uses @AI with @think and/or Agent multi-step patterns.
40+
**Impact:** Expands the Agents category from developer-tool templates (code review, TDD, security scan) into planning, DevOps, and AI infrastructure territory.
41+
42+
## 3. Agents Category in Template Modal
43+
**Files:** `js/modal-templates.js`, `js/templates.js`
44+
**What:** Added "Agents" category pill button to the template modal filter bar. Added category-to-icon (`bi-robot`) and category-to-color (`technical`) mappings.
45+
**Impact:** Agent templates are now discoverable via their own filter pill instead of being mixed into other categories.
46+
47+
## 4. Page View Mode (A4 Document)
48+
**Files:** `index.html`, `css/page-view.css`, `js/page-view.js`, `js/ui-panels.js`, `js/renderer.js`, `src/main.js`
49+
**What:** Added a new "Page" view mode that reflows rendered content into A4-sized pages with zoom controls and an Export PDF button. Added `<!-- pagebreak -->` comment support in the renderer and `data-pagebreak` attribute to DOMPurify allowlist.
50+
**Impact:** Users can view and export documents in paginated A4 format, useful for reports, specs, and printable documents.
51+
52+
## 5. Game Template Fixes
53+
**Files:** `js/game-prebuilts.js`, `js/templates/games.js`, `js/game-docgen.js`
54+
**What:** Fixed emoji encoding (HTML entities → native Unicode), wrapped localStorage in try/catch for sandboxed iframes, added touch event handlers to Breakout game, removed duplicate code blocks from game template, added `allow-same-origin` to game iframe sandbox, and added new Canvas 2D arcade game templates.
55+
**Impact:** Games now display correctly in sandboxed iframes without errors, and mobile touch controls work for Breakout.
56+
57+
---
58+
59+
## Files Changed (13 total)
60+
61+
| File | Lines Changed | Type |
62+
|------|:---:|------|
63+
| `js/templates/agents.js` | +2565 | Debug template upgrade + 5 new agent templates |
64+
| `js/templates/games.js` | +192 −48 | New game templates + duplicate block cleanup |
65+
| `js/game-prebuilts.js` | +64 −40 | Emoji encoding fixes + touch events + localStorage safety |
66+
| `index.html` | +33 −2 | Page view container HTML |
67+
| `js/ui-panels.js` | +12 −4 | Page view mode support |
68+
| `js/renderer.js` | +7 −2 | Pagebreak parsing + DOMPurify attr |
69+
| `css/modals.css` | +2 −2 | Minor modal styling |
70+
| `js/modal-templates.js` | +1 | Agents category pill |
71+
| `js/templates.js` | +2 | Agents category mapping |
72+
| `js/game-docgen.js` | +1 −1 | iframe sandbox allow-same-origin |
73+
| `src/main.js` | +2 | Page view CSS + JS imports |
74+
| `css/page-view.css` | NEW | Page view mode styles |
75+
| `js/page-view.js` | NEW | Page view mode logic |

0 commit comments

Comments
 (0)