A next.js web application that integrates AI capabilities with draw.io diagrams. This app allows you to create, modify, and enhance diagrams through natural language commands and AI-assisted visualization.
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 个月前 | ||
test: add Vitest and Playwright testing infrastructure (#512) * test: add Vitest and Playwright testing infrastructure - Add Vitest for unit tests (39 tests) - cached-responses.test.ts - ai-providers.test.ts - chat-helpers.test.ts - utils.test.ts - Add Playwright for E2E tests (3 smoke tests) - Homepage load - Japanese locale - Settings dialog - Add CI workflow (.github/workflows/test.yml) - Add vitest.config.mts and playwright.config.ts - Update .gitignore for test artifacts * test: add more E2E tests for UI components - Chat panel tests (interactive elements, iframe) - Settings tests (dark mode, language, draw.io theme) - Save dialog tests (buttons exist) - History dialog tests - Model config tests - Keyboard interaction tests - Upload area tests Total: 15 E2E tests, all passing * test: fix E2E test issues from review Fixes based on Gemini and Codex review: - Remove brittle nth(1) selector in keyboard tests - Remove waitForTimeout(500) race condition - Remove if(isVisible) silent skip patterns - Add proper assertions instead of no-op checks - Remove expect(count >= 0) that always passes - Remove unused hasProviderUI variable All 14 E2E tests and 39 unit tests pass. * style: auto-format with Biome * fix: resolve lint errors for CI * test(e2e): add diagram generation tests with mocked AI responses - Add tests for generate, edit, and append diagram operations - Use SSE mocked responses matching AI SDK UI message stream format - Generate mxCell XML directly in tests for deterministic assertions - Tests verify tool card rendering and 'Complete' badge state * test: add comprehensive E2E tests for all major features - Error handling tests (API errors, rate limits, network timeout, truncated XML) - Multi-turn conversation tests (sequential requests, history preservation) - File upload tests (upload button, file preview, sending with message) - Theme switching tests (dark mode toggle, persistence, system preference) - Language switching tests (EN/JA/ZH, persistence, locale URLs) - Iframe interaction tests (draw.io loading, toolbar, diagram rendering) - Copy/paste tests (chat input, XML input, special characters) - History restore tests (new chat, persistence, browser navigation) * refactor: extract shared test helpers and improve error assertions - Create tests/e2e/lib/helpers.ts with shared SSE mock functions - Add proper error UI assertions to error-handling.spec.ts - Remove waitForTimeout calls in favor of real assertions - Update 6 test files to use shared helpers * docs: add testing section to CONTRIBUTING.md * fix: improve test infrastructure based on PR review - Fix double build in CI: remove redundant build from playwright webServer - Export chat helpers from shared module for proper unit testing - Replace waitForTimeout with explicit waits in E2E tests - Add data-testid attributes to settings and new chat buttons - Add list reporter for CI to show failures in logs - Add Playwright browser caching to speed up CI - Add vitest coverage configuration - Fix conditional test assertions to use test.skip() instead of silent pass - Remove unused variables flagged by linter * fix: improve E2E test assertions and remove silent skips - Replace silent test.skip() with explicit conditional skips - Add actual persistence assertion after page reload - Use data-testid selector for new chat button test * refactor: add shared fixtures and test.step() patterns - Add tests/e2e/lib/fixtures.ts with shared test helpers - Add tests/e2e/fixtures/diagrams.ts with XML test data - Add expectBeforeAndAfterReload() helper for persistence tests - Add test.step() for better test reporting in complex tests - Consolidate mock helpers into fixtures module - Reduce code duplication across 17 test files * fix: make persistence tests more reliable - Remove expectBeforeAndAfterReload from mocked API tests - Add explicit test.step() for before/after reload checks - Add retry config for flaky clipboard tests - Add sleep after reload for language persistence test * test: remove flaky XML paste test * docs: run both unit and e2e tests before PR * chore: add type check and unit test git hooks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 5 个月前 | |
chore: add Biome for formatting and linting (#116) - Add Biome as formatter and linter (replaces Prettier) - Configure Husky + lint-staged for pre-commit hooks - Add VS Code settings for format on save - Ignore components/ui/ (shadcn generated code) - Remove semicolons, use 4-space indent - Reformat all files to new style | 6 个月前 | |
feat: Update some tool demos in english about page (#598) * feat: update about page examples with new diagrams Replace old cloud architecture and cat examples with ResNet50, RAG, Authentication, Agile Scrum, and Open Innovation diagrams. Update all three language versions (EN, CN, JA) for consistency. * fix: correct ResNet50 prompt text and keep prompts in English Update the ResNet50 example prompt to match the actual diagram. Keep all prompt texts in English across CN and JA about pages since prompts are what users type into the AI. * docs: update README examples to match about page Replace GCP, AWS, Azure examples with ResNet50, RAG, Auth, Agile Scrum, and Open Innovation. Keep Animated Transformer and Cat Sketch. Keep prompts in English across all versions. * docs: remove ResNet50 and Agile Scrum examples from READMEs --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 2 个月前 | |
fix: show all enabled panels on chat lobby instead of only templates (#802) | 2 个月前 | |
fix: zoom reset on drag and IndexedDB version conflict (#776) - Fix zoom resetting when dragging items (#775): removed useEffect that called load() on every autosave-triggered chartXML change, which reset the viewport. Moved diagram restore logic to onDrawioLoad where it only fires on remount. - Fix IndexedDB VersionError: template-storage.ts shared the same DB name as session-storage.ts but at version 2, causing session storage to fail with "requested version (1) < existing version (2)". Give templates their own DB ("next-ai-drawio-templates"). | 3 个月前 | |
feat: Update some tool demos in english about page (#598) * feat: update about page examples with new diagrams Replace old cloud architecture and cat examples with ResNet50, RAG, Authentication, Agile Scrum, and Open Innovation diagrams. Update all three language versions (EN, CN, JA) for consistency. * fix: correct ResNet50 prompt text and keep prompts in English Update the ResNet50 example prompt to match the actual diagram. Keep all prompt texts in English across CN and JA about pages since prompts are what users type into the AI. * docs: update README examples to match about page Replace GCP, AWS, Azure examples with ResNet50, RAG, Auth, Agile Scrum, and Open Innovation. Keep Animated Transformer and Cat Sketch. Keep prompts in English across all versions. * docs: remove ResNet50 and Agile Scrum examples from READMEs --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 2 个月前 | |
test: add Vitest and Playwright testing infrastructure (#512) * test: add Vitest and Playwright testing infrastructure - Add Vitest for unit tests (39 tests) - cached-responses.test.ts - ai-providers.test.ts - chat-helpers.test.ts - utils.test.ts - Add Playwright for E2E tests (3 smoke tests) - Homepage load - Japanese locale - Settings dialog - Add CI workflow (.github/workflows/test.yml) - Add vitest.config.mts and playwright.config.ts - Update .gitignore for test artifacts * test: add more E2E tests for UI components - Chat panel tests (interactive elements, iframe) - Settings tests (dark mode, language, draw.io theme) - Save dialog tests (buttons exist) - History dialog tests - Model config tests - Keyboard interaction tests - Upload area tests Total: 15 E2E tests, all passing * test: fix E2E test issues from review Fixes based on Gemini and Codex review: - Remove brittle nth(1) selector in keyboard tests - Remove waitForTimeout(500) race condition - Remove if(isVisible) silent skip patterns - Add proper assertions instead of no-op checks - Remove expect(count >= 0) that always passes - Remove unused hasProviderUI variable All 14 E2E tests and 39 unit tests pass. * style: auto-format with Biome * fix: resolve lint errors for CI * test(e2e): add diagram generation tests with mocked AI responses - Add tests for generate, edit, and append diagram operations - Use SSE mocked responses matching AI SDK UI message stream format - Generate mxCell XML directly in tests for deterministic assertions - Tests verify tool card rendering and 'Complete' badge state * test: add comprehensive E2E tests for all major features - Error handling tests (API errors, rate limits, network timeout, truncated XML) - Multi-turn conversation tests (sequential requests, history preservation) - File upload tests (upload button, file preview, sending with message) - Theme switching tests (dark mode toggle, persistence, system preference) - Language switching tests (EN/JA/ZH, persistence, locale URLs) - Iframe interaction tests (draw.io loading, toolbar, diagram rendering) - Copy/paste tests (chat input, XML input, special characters) - History restore tests (new chat, persistence, browser navigation) * refactor: extract shared test helpers and improve error assertions - Create tests/e2e/lib/helpers.ts with shared SSE mock functions - Add proper error UI assertions to error-handling.spec.ts - Remove waitForTimeout calls in favor of real assertions - Update 6 test files to use shared helpers * docs: add testing section to CONTRIBUTING.md * fix: improve test infrastructure based on PR review - Fix double build in CI: remove redundant build from playwright webServer - Export chat helpers from shared module for proper unit testing - Replace waitForTimeout with explicit waits in E2E tests - Add data-testid attributes to settings and new chat buttons - Add list reporter for CI to show failures in logs - Add Playwright browser caching to speed up CI - Add vitest coverage configuration - Fix conditional test assertions to use test.skip() instead of silent pass - Remove unused variables flagged by linter * fix: improve E2E test assertions and remove silent skips - Replace silent test.skip() with explicit conditional skips - Add actual persistence assertion after page reload - Use data-testid selector for new chat button test * refactor: add shared fixtures and test.step() patterns - Add tests/e2e/lib/fixtures.ts with shared test helpers - Add tests/e2e/fixtures/diagrams.ts with XML test data - Add expectBeforeAndAfterReload() helper for persistence tests - Add test.step() for better test reporting in complex tests - Consolidate mock helpers into fixtures module - Reduce code duplication across 17 test files * fix: make persistence tests more reliable - Remove expectBeforeAndAfterReload from mocked API tests - Add explicit test.step() for before/after reload checks - Add retry config for flaky clipboard tests - Add sleep after reload for language persistence test * test: remove flaky XML paste test * docs: run both unit and e2e tests before PR * chore: add type check and unit test git hooks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 5 个月前 | |
feat: add rpm target to electron-builder for Linux distribution (#806) Added rpm target (x64 + arm64) alongside existing deb and AppImage targets. No CI changes required since electron-builder handles both deb and rpm generation under the --linux flag. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> | 2 个月前 | |
Uses dynamic API base path for model fetch Replaces the hardcoded API endpoint with a function that retrieves the correct base path for server model requests. Improves compatibility with deployments where the API is not served from the root path. | 5 个月前 | |
fix: allow QvQ (Qwen Visual QA) models to use image input (#808) QvQ models (e.g. qvq-72b-preview, qvq-max) are visual reasoning models from the Qwen family that support image input. When accessed via providers that prefix model names with 'qwen/' (e.g., OpenRouter), these models contain 'qwen' in their ID but lack the 'vl' or 'vision' indicator. This caused supportsImageInput() to incorrectly return false for model IDs like 'qwen/qvq-72b-preview', blocking image uploads for vision-capable models. Add 'qvq' as an explicit exception in the Qwen text-model check so that QvQ models are correctly allowed to receive image input regardless of the provider prefix. Co-authored-by: octo-patch <octo-patch@github.com> | 2 个月前 | |
fix: improve create_new_diagram tool description to prevent misuse and bump to v0.2.0 (#803) | 2 个月前 | |
feat: Update some tool demos in english about page (#598) * feat: update about page examples with new diagrams Replace old cloud architecture and cat examples with ResNet50, RAG, Authentication, Agile Scrum, and Open Innovation diagrams. Update all three language versions (EN, CN, JA) for consistency. * fix: correct ResNet50 prompt text and keep prompts in English Update the ResNet50 example prompt to match the actual diagram. Keep all prompt texts in English across CN and JA about pages since prompts are what users type into the AI. * docs: update README examples to match about page Replace GCP, AWS, Azure examples with ResNet50, RAG, Auth, Agile Scrum, and Open Innovation. Keep Animated Transformer and Cat Sketch. Keep prompts in English across all versions. * docs: remove ResNet50 and Agile Scrum examples from READMEs --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 2 个月前 | |
chore: update app icons with new diagram hierarchy design (#350) | 6 个月前 | |
feat(electron): bundle draw.io for offline support (#629) * feat(electron): bundle draw.io for offline support - Download draw.io static files during CI build (v29.3.5) - Detect Electron and use local draw.io files instead of CDN - Add offline=1 parameter to disable external service calls - Skip /drawio path from i18n middleware redirect - Add public/drawio/ to .gitignore (downloaded during build) This allows the Electron app to work completely offline. * chore: bump version to 0.4.12-beta.3 for offline test * fix(electron): ad-hoc sign macOS app for bundled draw.io compatibility * chore: bump version to 0.4.12-beta.4 for ad-hoc sign test * fix(electron): disable electron-builder signing to use custom ad-hoc signing * chore: bump version to 0.4.12-beta.5 | 5 个月前 | |
fix: allow QvQ (Qwen Visual QA) models to use image input (#808) QvQ models (e.g. qvq-72b-preview, qvq-max) are visual reasoning models from the Qwen family that support image input. When accessed via providers that prefix model names with 'qwen/' (e.g., OpenRouter), these models contain 'qwen' in their ID but lack the 'vl' or 'vision' indicator. This caused supportsImageInput() to incorrectly return false for model IDs like 'qwen/qvq-72b-preview', blocking image uploads for vision-capable models. Add 'qvq' as an explicit exception in the Qwen text-model check so that QvQ models are correctly allowed to receive image input regardless of the provider prefix. Co-authored-by: octo-patch <octo-patch@github.com> | 2 个月前 | |
feat: add Docker support with multi-stage build | 7 个月前 | |
chore: add Biome for formatting and linting (#116) - Add Biome as formatter and linter (replaces Prettier) - Configure Husky + lint-staged for pre-commit hooks - Add VS Code settings for format on save - Ignore components/ui/ (shadcn generated code) - Remove semicolons, use 4-space indent - Reformat all files to new style | 6 个月前 | |
feat: add personal My Templates library alongside Quick Examples (#773) * 增加了ralph自动化编程梳理 * feat: US-001 - 为模板库建立独立的 IndexedDB 存储层 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-002 - 在空聊天状态用我的模板库替换官方示例 - 将 ChatLobby 中的 Quick Examples 替换为 TemplatePanel - 当没有历史会话时,展示完整的模板库面板 - 当有历史会话时,展示可折叠的 "My Templates" 区域 - 使用 TemplatePanel 组件展示用户的个人模板库 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-004 - Provide template creation flow - Create TemplateCreateDialog component with form fields for prompt, title, description, tags, and pinned - Add i18n translations for template creation UI in en, zh, zh-Hant, ja - Update TemplatePanel to integrate the create dialog - Support initialPrompt prop for pre-filling from current input - Validate required prompt field (empty prompt not allowed) - Auto-generate default title from first 20 chars of Pin templates appear at top of list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-005 - 为模板卡片提供编辑、删除和复制操作 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-006 - Send template directly on click and record usage statistics - Implement click-to-send template functionality with confirmation dialog - Add clickCount and runCount increment logic - Display runCount and lastUsedAt on template card - Add i18n translations for confirmation dialog (en, zh, zh-Hant, ja) - Pass onSendTemplate and currentInput props through component hierarchy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-007 - Support template search, pin and default sorting - Add search bar to TemplatePanel with real-time filtering by title, description, and tags - Add pin/unpin toggle button on template cards (uses Bookmark icon with fill indicator) - Search uses existing searchTemplates function from template-storage - Sort uses existing sortTemplates function (pinned desc, runCount desc, lastUsedAt desc, updatedAt desc) - Show empty state with Search icon when search returns no results - List re-sorts immediately after pin/unpin toggle - Add i18n keys: searchPlaceholder, searchNoResults, pin, unpin for all 4 languages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-008 - Support saving current input as template Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-009 - Support saving historical user message as template - Add "Save as Template" button to user messages - Pre-fill prompt with original user message text - Only show on user messages,- Dialog opens TemplateCreateDialog on click - Template appears in list immediately after saving Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: US-010 - Support template import and export Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove local-only dirs from git tracking (.agents, .cursor, scripts, screenshots) These directories contain local IDE configs, agent scripts, and dev tooling that should not be part of the upstream repository. Added them to .gitignore to prevent future accidental commits. * chore: remove AGENTS.md from git tracking * fix: add missing i18n keys for template export/import (en/zh/zh-Hant/ja) * fix: review fixes for my-templates PR - Fix fragile querySelector("form") with id-based lookup - Add objectStoreNames.contains guards for IndexedDB upgrades - Remove duplicate TemplateSchema, import from template-storage - Revert contributor-specific .gitignore additions - Fix broken i18n placeholders and missing translations (zh/ja/zh-Hant) - Remove unused setFiles prop from ChatLobby - Remove tags feature (unnecessary complexity) - Improve template card layout: overlay icons on hover, align stats - Add break-all and overflow-hidden for long prompt text in dialogs - Move incrementClickCount into sendTemplate for accurate tracking - Use Intl.RelativeTimeFormat for locale-aware relative time * feat: restore Quick Examples panel and add lobby panel visibility settings Bring back the ExamplePanel as a third collapsible section in ChatLobby alongside Recent Chats and My Templates. Add toggle switches in Settings to show/hide each lobby panel, persisted via localStorage. * fix: template send race condition, import defaults, and empty title bug - Use flushSync instead of setTimeout(0) in handleSendTemplate to ensure React state is flushed before form submission - Explicitly validate and default all fields in importTemplates to prevent undefined counters from malformed import JSON - Fall back to existing title in edit dialog instead of writing undefined * fix: address Copilot review comments and remove PRD file - Fix fallback formatLastUsed returning "Not used yet" for recent usage - Remove dead mounted flag in TemplatePanel useEffect - Respect panel visibility settings in no-history lobby state - Reject empty/whitespace titles in import validation - Trim title/prompt in importTemplates with default title fallback - Remove tasks/prd-template-library-replaces-examples.md from repo * fix: remove double sort, dead code, redundant stats, and break-all CSS - Remove redundant sortTemplates call in loadTemplates (already sorted by getAllTemplates) - Remove unused createEmptyTemplateInput and sortTemplates import - Show "Not used yet" only once for unused templates instead of twice - Use break-words instead of break-all on prompt textareas --------- Co-authored-by: 杜雷 <dreamfly@126.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 3 个月前 | |
feat: Turn off certain features of quota popup for self-hosting (#703) * feat: Turn off certain features of quota popup for self-hosting This commit introduces a new variable, NEXT_PUBLIC_SELFHOSTED, that alters the behavior of the quota popup. Downstream consumers of the application may have their own quota-checking logic, and the front-end reacts to the 429 error by displaying the quota popup. In the case of a self-hosted version of the app, it is inappropriate to ask for sponsorship or provide a hyperlink to the public version of the tool to apply for an increased quota. An alternative string translation is provided with an empty message for adopter customization. To use this feature, compile with NEXT_PUBLIC_SELFHOSTED=true and those parts of the quota popup will be omitted. The downstream consumer is still expected to customize the internationalized strings for the popup content to be appropriate to their organization on their local forks. Signed-off-by: Bryon Nevis <bryon.nevis@intel.com> * refactor: improve readability and provide sensible selfhosted defaults - Extract nested ternary expressions into quotaMessage and tipHtml variables - Combine two separate !isSelfHosted conditional blocks into one - Replace null tipSelfHosted with meaningful default strings across all locales --------- Signed-off-by: Bryon Nevis <bryon.nevis@intel.com> Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 4 个月前 | |
chore: add Apache 2.0 license and update gitignore (#68) * feat: integrate Langfuse for LLM observability - Add instrumentation.ts with Langfuse OpenTelemetry exporter - Enable experimental telemetry on streamText calls - Add instrumentationHook to Next.js config - Install required dependencies (@vercel/otel, langfuse-vercel, etc.) * feat: add optional Langfuse observability integration - Add session tracking with unique sessionId per conversation - Add user tracking via IP address (x-forwarded-for header) - Make telemetry conditional - only enabled if LANGFUSE_PUBLIC_KEY is set - Add environment variable validation in instrumentation.ts - Add sessionId validation (type check + 200 char limit) - Update env.example with Langfuse configuration docs - Remove unused langfuse-vercel and @vercel/otel packages * fix: remove deprecated instrumentationHook (enabled by default in Next.js 15) * chore: add Apache 2.0 license and update gitignore | 7 个月前 | |
feat: Update some tool demos in english about page (#598) * feat: update about page examples with new diagrams Replace old cloud architecture and cat examples with ResNet50, RAG, Authentication, Agile Scrum, and Open Innovation diagrams. Update all three language versions (EN, CN, JA) for consistency. * fix: correct ResNet50 prompt text and keep prompts in English Update the ResNet50 example prompt to match the actual diagram. Keep all prompt texts in English across CN and JA about pages since prompts are what users type into the AI. * docs: update README examples to match about page Replace GCP, AWS, Azure examples with ResNet50, RAG, Auth, Agile Scrum, and Open Innovation. Keep Animated Transformer and Cat Sketch. Keep prompts in English across all versions. * docs: remove ResNet50 and Agile Scrum examples from READMEs --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 2 个月前 | |
fix: Eliminate spurious biome schema version errors on "biome ci" command (#716) * fix: Eliminate spurious biome schema version errors on "biome ci" command Stronger fix for commit dd9d79d2d67a47fdd5ca9d72cdf3aa4f1103f956 Apply the BKM at https://biomejs.dev/internals/versioning/ that recommends pinning a specific version of biome (current version of package-lock.json uses 2.4.4, which was previously installed with ^2.3.10) Otherwise, if npm is allowed to upgrade at its discretion, project will have to continually chase the latest schema version. The specific error that is fixed when "biome ci" is invoked: ℹ The configuration schema version does not match the CLI version (local installed version) > 2 │ "$schema": "https://biomejs.dev/schemas/2.3.14/schema.json", │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ package-lock.json is also updated to reflect the package.json change. Signed-off-by: Bryon Nevis <bryon.nevis@intel.com> * fix: clean up unrelated package-lock.json changes Revert unrelated peer/encoding metadata changes that were artifacts of a different npm version, keeping only the biome version pin change. Signed-off-by: Dayuan Jiang <dayuan.jiang@gmail.com> --------- Signed-off-by: Bryon Nevis <bryon.nevis@intel.com> Signed-off-by: Dayuan Jiang <dayuan.jiang@gmail.com> Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 4 个月前 | |
chore: add Biome for formatting and linting (#116) - Add Biome as formatter and linter (replaces Prettier) - Configure Husky + lint-staged for pre-commit hooks - Add VS Code settings for format on save - Ignore components/ui/ (shadcn generated code) - Remove semicolons, use 4-space indent - Reformat all files to new style | 6 个月前 | |
fix(docker): fix invalid YAML syntax in docker-compose.yml (#498) Empty environment mapping caused validation error: 'services.next-ai-draw-io.environment must be a mapping' | 6 个月前 | |
feat: add EdgeOne Pages as AI provider (#456) * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * feat: edit diagram * feat: edit diagram * feat: edit diagram * feat: edit diagram * feat: edit diagram * feat: edit diagram * feat: edit diagram * feat: add edgeone provider * feat: add edgeone provider * feat: add edgeone provider * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: add cookie * fix: add cookie * fix: add cookie * fix: add cookie * fix: add cookie * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * fix: build error * feat: validate * feat: document link --------- Co-authored-by: zoejiezhou <zoejiezhou@tencent.com> | 6 个月前 | |
docs: add Novita AI config to env.example Add NOVITA_API_KEY and NOVITA_BASE_URL to env.example so users can discover the configuration variables. Also add novita to the AI_PROVIDER options list. | 3 个月前 | |
fix: filter Langfuse traces to only export chat and AI SDK spans (#392) Switch from blocklist to whitelist approach - only export spans named 'chat' or starting with 'ai.' to filter out Next.js infrastructure noise (HEAD, fetch, POST requests). | 6 个月前 | |
[Feature] Add Cloudflare Worker as deployment option (#170) * docs(cloudflare): add detailed Cloudflare Workers + R2 deploy guide * separated cloudflare deploy guide from readme.md * Missing R2 bucket binding for incremental cache * docs: move Cloudflare guide to docs/ and improve documentation - Move Cloudflare_Deploy.md to docs/ folder - Add 'Deploy without R2' option for simple/free deployments - Add workers.dev subdomain registration instructions - Add missing global_fetch_strictly_public flag - Add troubleshooting for common deployment issues - Update README.md link to new location * fix: conditional import for cloudflare dev and regenerate lockfile - Use dynamic import for @opennextjs/cloudflare to avoid loading workerd during builds - Regenerate package-lock.json with cross-platform dependencies * fix: use main lockfile with cloudflare deps added - Use main branch's package-lock.json as base to ensure cross-platform deps - Add @opennextjs/cloudflare and wrangler --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 6 个月前 | |
[Feature] Add Cloudflare Worker as deployment option (#170) * docs(cloudflare): add detailed Cloudflare Workers + R2 deploy guide * separated cloudflare deploy guide from readme.md * Missing R2 bucket binding for incremental cache * docs: move Cloudflare guide to docs/ and improve documentation - Move Cloudflare_Deploy.md to docs/ folder - Add 'Deploy without R2' option for simple/free deployments - Add workers.dev subdomain registration instructions - Add missing global_fetch_strictly_public flag - Add troubleshooting for common deployment issues - Update README.md link to new location * fix: conditional import for cloudflare dev and regenerate lockfile - Use dynamic import for @opennextjs/cloudflare to avoid loading workerd during builds - Regenerate package-lock.json with cross-platform dependencies * fix: use main lockfile with cloudflare deps added - Use main branch's package-lock.json as base to ensure cross-platform deps - Add @opennextjs/cloudflare and wrangler --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 6 个月前 | |
fix(deps): update minor and patch dependencies (#767) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> | 3 个月前 | |
chore: bump version to 0.4.15 (#810) | 2 个月前 | |
test: add Vitest and Playwright testing infrastructure (#512) * test: add Vitest and Playwright testing infrastructure - Add Vitest for unit tests (39 tests) - cached-responses.test.ts - ai-providers.test.ts - chat-helpers.test.ts - utils.test.ts - Add Playwright for E2E tests (3 smoke tests) - Homepage load - Japanese locale - Settings dialog - Add CI workflow (.github/workflows/test.yml) - Add vitest.config.mts and playwright.config.ts - Update .gitignore for test artifacts * test: add more E2E tests for UI components - Chat panel tests (interactive elements, iframe) - Settings tests (dark mode, language, draw.io theme) - Save dialog tests (buttons exist) - History dialog tests - Model config tests - Keyboard interaction tests - Upload area tests Total: 15 E2E tests, all passing * test: fix E2E test issues from review Fixes based on Gemini and Codex review: - Remove brittle nth(1) selector in keyboard tests - Remove waitForTimeout(500) race condition - Remove if(isVisible) silent skip patterns - Add proper assertions instead of no-op checks - Remove expect(count >= 0) that always passes - Remove unused hasProviderUI variable All 14 E2E tests and 39 unit tests pass. * style: auto-format with Biome * fix: resolve lint errors for CI * test(e2e): add diagram generation tests with mocked AI responses - Add tests for generate, edit, and append diagram operations - Use SSE mocked responses matching AI SDK UI message stream format - Generate mxCell XML directly in tests for deterministic assertions - Tests verify tool card rendering and 'Complete' badge state * test: add comprehensive E2E tests for all major features - Error handling tests (API errors, rate limits, network timeout, truncated XML) - Multi-turn conversation tests (sequential requests, history preservation) - File upload tests (upload button, file preview, sending with message) - Theme switching tests (dark mode toggle, persistence, system preference) - Language switching tests (EN/JA/ZH, persistence, locale URLs) - Iframe interaction tests (draw.io loading, toolbar, diagram rendering) - Copy/paste tests (chat input, XML input, special characters) - History restore tests (new chat, persistence, browser navigation) * refactor: extract shared test helpers and improve error assertions - Create tests/e2e/lib/helpers.ts with shared SSE mock functions - Add proper error UI assertions to error-handling.spec.ts - Remove waitForTimeout calls in favor of real assertions - Update 6 test files to use shared helpers * docs: add testing section to CONTRIBUTING.md * fix: improve test infrastructure based on PR review - Fix double build in CI: remove redundant build from playwright webServer - Export chat helpers from shared module for proper unit testing - Replace waitForTimeout with explicit waits in E2E tests - Add data-testid attributes to settings and new chat buttons - Add list reporter for CI to show failures in logs - Add Playwright browser caching to speed up CI - Add vitest coverage configuration - Fix conditional test assertions to use test.skip() instead of silent pass - Remove unused variables flagged by linter * fix: improve E2E test assertions and remove silent skips - Replace silent test.skip() with explicit conditional skips - Add actual persistence assertion after page reload - Use data-testid selector for new chat button test * refactor: add shared fixtures and test.step() patterns - Add tests/e2e/lib/fixtures.ts with shared test helpers - Add tests/e2e/fixtures/diagrams.ts with XML test data - Add expectBeforeAndAfterReload() helper for persistence tests - Add test.step() for better test reporting in complex tests - Consolidate mock helpers into fixtures module - Reduce code duplication across 17 test files * fix: make persistence tests more reliable - Remove expectBeforeAndAfterReload from mocked API tests - Add explicit test.step() for before/after reload checks - Add retry config for flaky clipboard tests - Add sleep after reload for language persistence test * test: remove flaky XML paste test * docs: run both unit and e2e tests before PR * chore: add type check and unit test git hooks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 5 个月前 | |
chore: add Biome for formatting and linting (#116) - Add Biome as formatter and linter (replaces Prettier) - Configure Husky + lint-staged for pre-commit hooks - Add VS Code settings for format on save - Ignore components/ui/ (shadcn generated code) - Remove semicolons, use 4-space indent - Reformat all files to new style | 6 个月前 | |
feat(electron): bundle draw.io for offline support (#629) * feat(electron): bundle draw.io for offline support - Download draw.io static files during CI build (v29.3.5) - Detect Electron and use local draw.io files instead of CDN - Add offline=1 parameter to disable external service calls - Skip /drawio path from i18n middleware redirect - Add public/drawio/ to .gitignore (downloaded during build) This allows the Electron app to work completely offline. * chore: bump version to 0.4.12-beta.3 for offline test * fix(electron): ad-hoc sign macOS app for bundled draw.io compatibility * chore: bump version to 0.4.12-beta.4 for ad-hoc sign test * fix(electron): disable electron-builder signing to use custom ad-hoc signing * chore: bump version to 0.4.12-beta.5 | 5 个月前 | |
fix: bind MCP server HTTP to 127.0.0.1 only (#787) The embedded HTTP sidecar was using server.listen(port) without a host argument, which defaults to 0.0.0.0 (all interfaces). This exposed the server to the local network. Now explicitly binds to 127.0.0.1. Also excludes release/ from tsconfig to fix pre-existing TS errors. Bumps @next-ai-drawio/mcp-server to 0.1.18. | 3 个月前 | |
chore: optimize Vercel costs by removing analytics and configuring functions (#238) - Create vercel.json with optimized function settings: - Chat API: 512MB memory, 120s timeout - Other APIs: 256MB memory, 10s timeout - Remove @vercel/analytics package and imports - Reduce chat route maxDuration from 300s to 120s Expected savings: $2-4/month, keeping costs under $20 included credit | 6 个月前 | |
test: add Vitest and Playwright testing infrastructure (#512) * test: add Vitest and Playwright testing infrastructure - Add Vitest for unit tests (39 tests) - cached-responses.test.ts - ai-providers.test.ts - chat-helpers.test.ts - utils.test.ts - Add Playwright for E2E tests (3 smoke tests) - Homepage load - Japanese locale - Settings dialog - Add CI workflow (.github/workflows/test.yml) - Add vitest.config.mts and playwright.config.ts - Update .gitignore for test artifacts * test: add more E2E tests for UI components - Chat panel tests (interactive elements, iframe) - Settings tests (dark mode, language, draw.io theme) - Save dialog tests (buttons exist) - History dialog tests - Model config tests - Keyboard interaction tests - Upload area tests Total: 15 E2E tests, all passing * test: fix E2E test issues from review Fixes based on Gemini and Codex review: - Remove brittle nth(1) selector in keyboard tests - Remove waitForTimeout(500) race condition - Remove if(isVisible) silent skip patterns - Add proper assertions instead of no-op checks - Remove expect(count >= 0) that always passes - Remove unused hasProviderUI variable All 14 E2E tests and 39 unit tests pass. * style: auto-format with Biome * fix: resolve lint errors for CI * test(e2e): add diagram generation tests with mocked AI responses - Add tests for generate, edit, and append diagram operations - Use SSE mocked responses matching AI SDK UI message stream format - Generate mxCell XML directly in tests for deterministic assertions - Tests verify tool card rendering and 'Complete' badge state * test: add comprehensive E2E tests for all major features - Error handling tests (API errors, rate limits, network timeout, truncated XML) - Multi-turn conversation tests (sequential requests, history preservation) - File upload tests (upload button, file preview, sending with message) - Theme switching tests (dark mode toggle, persistence, system preference) - Language switching tests (EN/JA/ZH, persistence, locale URLs) - Iframe interaction tests (draw.io loading, toolbar, diagram rendering) - Copy/paste tests (chat input, XML input, special characters) - History restore tests (new chat, persistence, browser navigation) * refactor: extract shared test helpers and improve error assertions - Create tests/e2e/lib/helpers.ts with shared SSE mock functions - Add proper error UI assertions to error-handling.spec.ts - Remove waitForTimeout calls in favor of real assertions - Update 6 test files to use shared helpers * docs: add testing section to CONTRIBUTING.md * fix: improve test infrastructure based on PR review - Fix double build in CI: remove redundant build from playwright webServer - Export chat helpers from shared module for proper unit testing - Replace waitForTimeout with explicit waits in E2E tests - Add data-testid attributes to settings and new chat buttons - Add list reporter for CI to show failures in logs - Add Playwright browser caching to speed up CI - Add vitest coverage configuration - Fix conditional test assertions to use test.skip() instead of silent pass - Remove unused variables flagged by linter * fix: improve E2E test assertions and remove silent skips - Replace silent test.skip() with explicit conditional skips - Add actual persistence assertion after page reload - Use data-testid selector for new chat button test * refactor: add shared fixtures and test.step() patterns - Add tests/e2e/lib/fixtures.ts with shared test helpers - Add tests/e2e/fixtures/diagrams.ts with XML test data - Add expectBeforeAndAfterReload() helper for persistence tests - Add test.step() for better test reporting in complex tests - Consolidate mock helpers into fixtures module - Reduce code duplication across 17 test files * fix: make persistence tests more reliable - Remove expectBeforeAndAfterReload from mocked API tests - Add explicit test.step() for before/after reload checks - Add retry config for flaky clipboard tests - Add sleep after reload for language persistence test * test: remove flaky XML paste test * docs: run both unit and e2e tests before PR * chore: add type check and unit test git hooks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 5 个月前 | |
[Feature] Add Cloudflare Worker as deployment option (#170) * docs(cloudflare): add detailed Cloudflare Workers + R2 deploy guide * separated cloudflare deploy guide from readme.md * Missing R2 bucket binding for incremental cache * docs: move Cloudflare guide to docs/ and improve documentation - Move Cloudflare_Deploy.md to docs/ folder - Add 'Deploy without R2' option for simple/free deployments - Add workers.dev subdomain registration instructions - Add missing global_fetch_strictly_public flag - Add troubleshooting for common deployment issues - Update README.md link to new location * fix: conditional import for cloudflare dev and regenerate lockfile - Use dynamic import for @opennextjs/cloudflare to avoid loading workerd during builds - Regenerate package-lock.json with cross-platform dependencies * fix: use main lockfile with cloudflare deps added - Use main branch's package-lock.json as base to ensure cross-platform deps - Add @opennextjs/cloudflare and wrangler --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com> | 6 个月前 |
Next AI Draw.io
一款集成AI功能与draw.io图表的Next.js Web应用。通过自然语言命令和AI辅助可视化,创建、修改和增强图表。
注意:感谢
字节跳动豆包 的赞助,演示站点现已采用强大的glm-4.7模型!
https://github.com/user-attachments/assets/9d60a3e8-4a1c-4b5e-acbb-26af2d3eabd1
目录
示例
以下是一些示例提示词及其生成的图表:
|
带动画的Transformer连接线 提示词: 给我一个Transformer架构的**动画连接线**图表。 |
|
|
RAG技术图表 提示词: 为**聊天应用**生成一个RAG架构图表。数据摄入部分使用连接式图表。 |
使用React和AWS的身份验证 提示词: 生成使用React和**AWS**的身份验证流程。采用无服务器架构。 |
|
开放式创新 提示词: 创建亨利·切萨布鲁夫(Henry Chesbrough)开放式创新模型的可视化图表。 |
猫咪素描 提示词: 帮我画一只可爱的猫。 |
功能特性
- LLM驱动的图表创建:利用大型语言模型(LLM),通过自然语言命令直接创建和操作draw.io图表
- 基于图像的图表复制:上传现有图表或图像,AI会自动复制并增强它们
- PDF和文本文件上传:上传PDF文档和文本文件,从现有文档中提取内容并生成图表
- AI推理过程展示:支持查看AI的思考过程(适用于OpenAI o1/o3、Gemini、Claude等模型)
- 图表历史记录:全面的版本控制功能,可跟踪所有更改,让您查看并恢复AI编辑前的图表历史版本
- 交互式聊天界面:与AI实时沟通,精确调整您的图表
- 云架构图表支持:专门支持生成云架构图表(AWS、GCP、Azure)
- 动画连接线:在图表元素之间创建动态动画连接线,提升可视化效果
MCP 服务器
通过 MCP(模型上下文协议),可将 Next AI Draw.io 与 Claude Desktop、Cursor 及 VS Code 等 AI 代理配合使用。
{
"mcpServers": {
"drawio": {
"command": "npx",
"args": ["@next-ai-drawio/mcp-server@latest"]
}
}
}
Claude 代码命令行界面
claude mcp add drawio -- npx @next-ai-drawio/mcp-server@latest
然后让 Claude 创建图表:
"创建一个展示用户认证流程的流程图,包含登录、MFA 和会话管理"
图表会实时显示在你的浏览器中!
有关 VS Code、Cursor 和其他客户端配置,请参阅 MCP Server README。
开始使用
在线试用
无需安装!直接在我们的演示网站上试用该应用:
使用你自己的 API 密钥:你可以使用自己的 API 密钥来绕过演示网站的使用限制。点击聊天面板中的设置图标,配置你的服务提供商和 API 密钥。你的密钥仅存储在浏览器本地,绝不会存储在服务器上。
桌面应用
从 发布页面 下载适用于你平台的原生桌面应用:
支持的平台:Windows、macOS、Linux。
使用 Docker 运行
安装步骤
- 克隆仓库:
git clone https://github.com/DayuanJiang/next-ai-draw-io
cd next-ai-draw-io
npm install
cp env.example .env.local
有关每个提供商的详细设置说明,请参阅提供商配置指南。
- 运行开发服务器:
npm run dev
- 在浏览器中打开 http://localhost:6002 即可查看应用。
部署
部署至 EdgeOne Pages
您可以使用 腾讯 EdgeOne Pages 一键部署。
通过以下按钮部署:
查看 腾讯 EdgeOne Pages 文档 了解更多详情。
此外,通过腾讯 EdgeOne Pages 部署还将为您提供 DeepSeek 模型的每日免费额度。
部署至 Vercel
最简单的部署方式是使用 Vercel(Next.js 的创建者)。请务必在 Vercel 控制台中设置环境变量,操作方式与本地 .env.local 文件相同。
查看 Next.js 部署文档 了解更多详情。
部署至 Cloudflare Workers
多提供商支持
- 字节跳动豆包
- AWS Bedrock(默认)
- OpenAI
- Anthropic
- Google AI
- Google Vertex AI
- Azure OpenAI
- Ollama
- OpenRouter
- DeepSeek
- SiliconFlow
- ModelScope
- SGLang
- Vercel AI Gateway
除 AWS Bedrock 和 OpenRouter 外,所有提供商均支持自定义端点。
📖 详细提供商配置指南 - 查看各提供商的设置说明。
服务器端多模型配置
管理员可以配置多个服务器端模型,供所有用户使用,无需个人 API 密钥。通过 AI_MODELS_CONFIG 环境变量(JSON 字符串)或 ai-models.json 文件进行配置。
模型要求:此任务需要强大的模型能力来生成具有严格格式约束(draw.io XML)的长文本。推荐模型包括 Claude Sonnet 4.5、GPT-5.1、Gemini 3 Pro 以及 DeepSeek V3.2/R1。
请注意,claude 系列已针对包含 AWS、Azure、GCP 等云架构图标的 draw.io 图表进行了训练。因此,如果您需要创建云架构图,这是最佳选择。
工作原理
本应用采用以下技术构建:
- Next.js:用于前端框架和路由管理
- Vercel AI SDK(
ai+@ai-sdk/*):用于AI响应流式传输和多提供商支持 - react-drawio:用于图表展示和操作
图表以可在draw.io中渲染的XML格式存储。AI会处理您的指令,并据此生成或修改该XML内容。
支持与联系
特别感谢字节跳动豆包赞助演示站点的API令牌使用! 注册ARK平台即可获得所有模型的500K免费令牌!
如果您觉得本项目有用,欢迎考虑赞助以支持演示站点的持续运营!
如需支持或有任何疑问,请在GitHub仓库提交issue或通过以下方式联系维护者:
- 邮箱:me[at]jiang.jp
常见问题
有关常见问题及解决方案,请参见FAQ。
星标历史
项目介绍
A next.js web application that integrates AI capabilities with draw.io diagrams. This app allows you to create, modify, and enhance diagrams through natural language commands and AI-assisted visualization.
定制我的领域