openpencil/apps/web/public/logo-openai.svg
Kayshen Xu 2b06d95cc1 V0.5.0 (#67)
* docs: add image search & generation design spec and implementation plan

- Spec: dual-source image search (Openverse + Wikimedia), multi-provider image generation
- Plan: 16 tasks covering types, server endpoints, settings UI, property panel, auto-search pipeline, MCP integration

* feat(types): add image service types and imagePrompt to ImageNode

* feat(server): add image service API key validation endpoint

Adds POST /api/ai/image-service-test that validates credentials for
openverse (client_credentials), openai/custom (Bearer + /v1/models),
gemini (API key + v1beta/models), and replicate (Bearer + /v1/models).

* feat(server): add multi-provider image generation endpoint

* feat(server): add dual-source image search endpoint (Openverse + Wikimedia)

POST /api/ai/image-search searches freely-licensed images via Openverse
with automatic fallback to Wikimedia Commons on 429 rate-limit responses.
Supports optional OAuth credentials for authenticated Openverse requests.

* feat(store): add imageSearchStatuses to canvas store for runtime status tracking

* feat(store): add image generation config and Openverse OAuth to agent settings

* feat(editor): add Images tab to agent settings dialog

Adds Popover primitive, ImagesPage component with Image Search (Openverse OAuth, test) and Image Generation (provider select, API key, model, base URL) sections, and wires them into the settings dialog sidebar.

* feat(panels): add image search popover with Openverse/Wikimedia results grid

* feat(panels): add image generate popover with multi-provider support

* feat(panels): add Search and Generate buttons to image property section

* feat(ai): update prompts to use imagePrompt instead of src for image nodes

* feat(ai): add auto-search pipeline with Openverse/Wikimedia fallback

* feat(ai): trigger auto image search after design generation completes

* feat(mcp): implement G() operation for image search in batch design DSL

Adds the G(parent, mode, prompt) operation to batch_design DSL that creates
an image node and optionally fetches a real image URL via the image-search
API when mode is "search". Converts executeLine to async to support the
network call.

* feat(mcp): auto-fill images after design refinement in layered pipeline

* feat(ai): split imageSearchQuery and imagePrompt for search vs generation

- ImageNode now has both imageSearchQuery (short keywords for search)
  and imagePrompt (long description for AI image generation)
- AI prompts instruct LLM to generate both fields
- Search pipeline and popovers use imageSearchQuery
- Generate popover uses imagePrompt
- Server-side simplifySearchQuery kept as fallback for manual input

* fix(ai): hook auto image search into orchestrator completion path

The primary generation path uses executeOrchestration -> insertStreamingNode,
not applyNodesToCanvas/animateNodesToCanvas. Added scanAndFillImages call
to orchestrator.ts after all sub-agents complete. Added debug logging.
Removed plan/spec docs from git.

* style(editor): remove provider names from image search ready status

* fix(panels): clean up image gen error display and settings UI

- Parse API error response to show concise message instead of raw JSON
- Limit error text to 2 lines with line-clamp
- Fix image gen test button sending wrong service name
- Inline Image Search ready indicator with section header
- Remove debug logging from image search pipeline

* style(panels): allow up to 4 lines for image gen error message

* fix: avoid 1-frame delay when resizing canvas (#60)

rAF callbacks run before ResizeObserver in the same frame.
Scheduling render in ResizeObserver via rAF defers it to the next frame.

Invoke render() synchronously to leverage ResizeObserver's pre-paint timing
and ensure immediate visual update.

* feat(electron): implement desktop application structure and auto-updater

- Introduced a new Electron desktop application with a structured directory for apps and packages.
- Added auto-updater functionality to manage application updates seamlessly.
- Created a comprehensive menu system for the desktop app.
- Implemented logging capabilities for better debugging and error tracking.
- Configured build settings for various platforms (macOS, Windows, Linux) using electron-builder.
- Established TypeScript configurations for both the desktop and web applications.
- Integrated Vite for the web application with support for React and Tailwind CSS.
- Added icons and assets for the desktop application.

* chore: update package versions to 0.5.0 across all package.json files and add pre-commit hook for version synchronization

- Bumped version to 0.5.0 in package.json files for the main project, desktop app, web app, and all packages.
- Introduced a pre-commit hook to automatically sync version numbers from branch names to all package.json files.

* chore: update package versions to 0.5.0 and refactor Skia components

- Bumped version to 0.5.0 in bun.lock and all relevant package.json files.
- Refactored Skia components to utilize shared functionality from @zseven-w/pen-renderer, including image loading, hit testing, and path utilities.
- Removed redundant code and improved modularity by re-exporting necessary functions and classes from the renderer package.

* fix(panels): handle string fill values in icon nodes (#61)

AI-generated icon/path nodes may have fill stored as a raw string
instead of a PenFill[] array, causing "Cannot use 'in' operator"
crash when selecting the node in the property panel.

* chore: update documentation and project structure for monorepo organization

- Added a new version bump command to synchronize all package.json files.
- Updated the project structure to reflect a monorepo setup with organized workspaces for apps and packages.
- Enhanced README files in multiple languages to include the new structure and commands.
- Adjusted image paths in documentation to point to the correct locations for the desktop application.

* feat(ai): incremental image search and improved image generation prompts

- Refactor image search from batch post-generation to incremental queue:
  enqueueImageForSearch() triggers as each image node is inserted during
  streaming, so images appear progressively instead of all at once after
  generation completes. scanAndFillImages() remains as a final sweep.
- Update imagePrompt guidance to avoid "transparent background" and
  similar phrases that many models cannot reliably produce.
- Pass node width/height from image panel to generation endpoint for
  aspect-ratio-aware output (Gemini aspect ratio mapping, OpenAI size
  selection, Replicate dimensions).

* feat(ai): multi-profile image generation config and cleaner error messages

- Support multiple image generation profiles with active selection;
  first configured profile becomes default. Old single-config migrated
  automatically on hydrate.
- Fix Gemini aspect ratio: move to generationConfig.imageConfig per API spec.
- Extract clean error messages from provider JSON responses (Gemini
  error.message, OpenAI error.message, Replicate detail) instead of
  returning raw JSON text.
- Remove destructive client-side regex that mangled error display.

* feat(design-md): integrate design system panel and functionality

- Added a new DesignMdPanel component for managing design system specifications.
- Implemented functionality to toggle the design system panel in the editor layout and toolbar.
- Introduced new commands for importing, exporting, and auto-generating design.md content.
- Updated AI chat handlers to utilize design.md data for enhanced design generation.
- Enhanced localization support for design system features across multiple languages.

* perf(canvas): skip draw calls for nodes outside the viewport (#64)

Add viewport culling in render() to avoid issuing CanvasKit draw calls
  for off-screen nodes. A 64px screen-space buffer is kept around the
  viewport edges so nearby nodes are pre-rendered, preventing pop-in
  during fast panning.

* feat(utils): enhance Windows process spawning for CLI scripts

- Updated the buildSpawnClaudeCodeProcess function to handle .cmd and .ps1 scripts appropriately.
- Implemented PowerShell invocation for .ps1 files and ensured safe defaults for .cmd and .exe files.
- Improved handling of command execution to avoid limitations of cmd.exe.

* feat(ai): add support for Gemini CLI integration

- Extended the AI provider options to include 'gemini' across various components and APIs.
- Implemented functions for generating, validating, and connecting to the Gemini CLI.
- Added Gemini-specific error handling and model fetching logic.
- Updated UI components to display Gemini as a selectable provider with appropriate icons and labels.
- Enhanced localization support for Gemini-related features in multiple languages.

* feat(editor): warn before closing with unsaved changes

Intercept window/tab close when isDirty is true:
- Electron: native dialog with Save / Don't Save / Cancel
- Web: beforeunload handler + confirm on New/Open actions
- i18n: close-confirm strings for all 15 locales

* feat(ipc): extract IPC handlers to a dedicated module

- Moved IPC dialog handling and updater functions from main.ts to ipc-handlers.ts for better organization and maintainability.
- Implemented file open/save dialogs, theme setting, and preferences management through IPC.
- Enhanced updater functionality with state management and auto-update settings.
- Improved code structure by separating concerns, making it easier to manage IPC-related logic.

* feat(docs): update CLAUDE documentation and add new files for desktop and web apps

- Enhanced CLAUDE.md with detailed module documentation references for `packages/` and `apps/`.
- Updated `pen-core` description to include clone utilities in `pen-core`.
- Added new documentation files for the desktop and web applications, outlining their structure, components, and functionalities.
- Included IPC handler details in the desktop app documentation for better clarity on file dialogs and theme synchronization.

* feat(docker): add Gemini CLI support and update documentation

- Introduced a new Docker build stage for the Gemini CLI, allowing users to install and run it.
- Updated the Dockerfile to include the installation of the Gemini CLI alongside existing CLI tools.
- Enhanced README files in multiple languages to document the new `openpencil-gemini` image variant.
- Added Gemini CLI connection instructions to the main README for better user guidance.

* feat(docs): add Gemini CLI connection instructions to multiple language READMEs

- Updated README files in German, Spanish, French, Hindi, Indonesian, Japanese, Korean, Portuguese, Russian, Thai, Turkish, Vietnamese, and both Traditional and Simplified Chinese to include connection instructions for the Gemini CLI.
- Enhanced documentation to improve user guidance for connecting the Gemini CLI in agent settings.

* perf(renderer): replace count-based text cache limits with memory-based eviction (#66)

previous limits (PARA_CACHE_MAX=200, TEXT_CACHE_MAX=300) were too small
  for scenes with many nodes, causing constant cache churn and paragraph
  rebuilds every frame, which dropped FPS significantly during canvas pan.

  - switch to byte-budget limits (64 MB paragraphs, 256 MB bitmaps)
  - bitmap size measured exactly as cw*ch*4; paragraph WASM heap estimated
    as content.length*64+4096
  - eviction uses Map insertion order (FIFO) instead of a separate string[]
    array, replacing O(n) array.shift() with O(1) Map.entries().next()
  - evict before insert so the budget check includes the incoming entry

---------

Co-authored-by: Fini <fini.yang@gmail.com>
Co-authored-by: leinaldo <60176594+leinaldo@users.noreply.github.com>
2026-03-22 09:44:04 +08:00

11 lines
7 KiB
XML

<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_740_1823)">
<path d="M51.0515 31.4958C51.4895 32.4869 51.7674 33.5463 51.8811 34.627C51.9906 35.7078 51.9359 36.8013 51.7085 37.865C51.4853 38.9286 51.0978 39.9496 50.5588 40.8894C50.205 41.5173 49.7881 42.1068 49.308 42.6493C48.8321 43.1875 48.3015 43.6745 47.7246 44.1017C47.1434 44.5289 46.5243 44.8877 45.8674 45.1824C45.2146 45.4729 44.5324 45.695 43.8333 45.8403C43.5048 46.874 43.0163 47.8523 42.3846 48.7322C41.7571 49.6122 40.9949 50.3854 40.1273 51.0219C39.2598 51.6626 38.2996 52.1582 37.2805 52.4914C36.2613 52.8288 35.1958 52.9954 34.122 52.9954C33.4102 52.9997 32.6943 52.9228 31.9952 52.7776C31.3004 52.6281 30.6181 52.4017 29.9654 52.1069C29.3126 51.8122 28.6935 51.4448 28.1166 51.0176C27.5439 50.5904 27.0132 50.0992 26.5416 49.5567C25.4887 49.7874 24.4106 49.8429 23.3452 49.7318C22.2797 49.6165 21.2353 49.3346 20.254 48.8903C19.277 48.4503 18.3716 47.8523 17.5756 47.1218C16.7797 46.3913 16.1017 45.537 15.5668 44.5972C15.2089 43.9693 14.9141 43.3072 14.6909 42.6194C14.4677 41.9317 14.3203 41.2226 14.2445 40.5006C14.1687 39.783 14.1729 39.0568 14.2487 38.3349C14.3245 37.6172 14.4803 36.9081 14.7035 36.2204C13.9876 35.413 13.398 34.4946 12.96 33.5035C12.5262 32.5082 12.2441 31.4531 12.1346 30.3724C12.0209 29.2916 12.0798 28.1981 12.303 27.1344C12.5262 26.0707 12.9137 25.0498 13.4527 24.11C13.8065 23.4821 14.2234 22.8883 14.6993 22.3501C15.1752 21.8118 15.71 21.3249 16.287 20.8977C16.8639 20.4705 17.4872 20.1074 18.1399 19.8169C18.7969 19.5222 19.4792 19.3043 20.1782 19.1591C20.5067 18.1211 20.9952 17.1471 21.6227 16.2671C22.2544 15.3872 23.0167 14.614 23.8842 13.9732C24.7517 13.3367 25.7119 12.8412 26.7311 12.5038C27.7502 12.1706 28.8157 11.9997 29.8896 12.004C30.6013 11.9997 31.3172 12.0723 32.0163 12.2218C32.7154 12.3713 33.3976 12.5935 34.0504 12.8882C34.7031 13.1872 35.3222 13.5503 35.8991 13.9775C36.4761 14.4089 37.0067 14.8959 37.4784 15.4384C38.527 15.212 39.6051 15.1565 40.6706 15.2676C41.736 15.3786 42.7762 15.6648 43.7575 16.1048C44.7345 16.5491 45.6399 17.1428 46.4359 17.8733C47.2318 18.5995 47.9099 19.4496 48.4447 20.3936C48.8027 21.0173 49.0975 21.6794 49.3207 22.3714C49.5439 23.0592 49.6955 23.7683 49.7671 24.4902C49.8429 25.2121 49.8429 25.9383 49.7628 26.6602C49.687 27.3822 49.5312 28.0913 49.308 28.779C50.0282 29.5864 50.6135 30.5005 51.0515 31.4958ZM37.0194 49.7318C37.9374 49.3474 38.7713 48.7792 39.4746 48.0659C40.1779 47.3525 40.738 46.5067 41.117 45.5712C41.496 44.6399 41.6939 43.6403 41.6939 42.6322V33.1063C41.6911 33.0977 41.6883 33.0878 41.6855 33.0764C41.6827 33.0678 41.6785 33.0593 41.6729 33.0507C41.6673 33.0422 41.6602 33.0351 41.6518 33.0294C41.6434 33.0208 41.635 33.0151 41.6265 33.0123L38.228 31.0217V42.5297C38.228 42.645 38.2112 42.7646 38.1817 42.8757C38.1522 42.991 38.1101 43.0978 38.0511 43.2004C37.9922 43.3029 37.9248 43.3969 37.8406 43.478C37.7587 43.5608 37.6667 43.6326 37.5668 43.6916L29.519 48.4033C29.4516 48.446 29.3379 48.5058 29.2789 48.54C29.6116 48.8262 29.9738 49.0783 30.3528 49.3004C30.736 49.5225 31.1319 49.7105 31.5446 49.8642C31.9573 50.0138 32.3827 50.1291 32.8122 50.206C33.246 50.2829 33.684 50.3213 34.122 50.3213C35.1158 50.3213 36.1013 50.1206 37.0194 49.7318ZM17.8536 43.2644C18.3547 44.1401 19.0159 44.9005 19.8034 45.5156C20.5952 46.1308 21.4922 46.5793 22.4524 46.8399C23.4125 47.1004 24.4148 47.1688 25.4003 47.0364C26.3857 46.9039 27.3333 46.5793 28.1966 46.0752L36.3329 41.3123L36.354 41.2909C36.3596 41.2852 36.3638 41.2767 36.3666 41.2653C36.3722 41.2567 36.3764 41.2482 36.3792 41.2396V37.2242L26.5584 42.9868C26.4573 43.0466 26.352 43.0893 26.2426 43.1235C26.1288 43.1534 26.0151 43.1662 25.8972 43.1662C25.7835 43.1662 25.6698 43.1534 25.5561 43.1235C25.4466 43.0893 25.3371 43.0466 25.236 42.9868L17.1882 38.2708C17.1166 38.2281 17.0113 38.164 16.9524 38.1256C16.8765 38.5655 16.8386 39.0098 16.8386 39.4541C16.8386 39.8983 16.8808 40.3426 16.9566 40.7826C17.0324 41.2183 17.1503 41.6497 17.2977 42.0684C17.4493 42.487 17.6346 42.8885 17.8536 43.273V43.2644ZM15.7395 25.4513C15.2426 26.3271 14.9225 27.2925 14.7919 28.292C14.6614 29.2916 14.7288 30.304 14.9857 31.2823C15.2426 32.2562 15.6847 33.1661 16.2912 33.9692C16.8976 34.768 17.6514 35.4386 18.5105 35.9427L26.6426 40.7099C26.6511 40.7128 26.6609 40.7156 26.6721 40.7185H26.7016C26.7128 40.7185 26.7226 40.7156 26.7311 40.7099C26.7395 40.7071 26.7479 40.7028 26.7563 40.6971L30.1675 38.698L20.3467 32.9482C20.2498 32.8884 20.1572 32.8158 20.073 32.7346C19.9913 32.6516 19.9206 32.5583 19.8624 32.457C19.8076 32.3545 19.7613 32.2477 19.7318 32.1323C19.7024 32.0213 19.6855 31.9059 19.6897 31.7863V22.0852C19.277 22.239 18.8769 22.427 18.4979 22.6491C18.1189 22.8755 17.7609 23.1318 17.424 23.418C17.0913 23.7042 16.7797 24.0203 16.4975 24.3621C16.2154 24.6995 15.9669 25.0669 15.7479 25.4513H15.7395ZM43.6733 32.0469C43.7743 32.1067 43.867 32.175 43.9512 32.2605C44.0312 32.3416 44.1028 32.4356 44.1618 32.5381C44.2165 32.6407 44.2628 32.7517 44.2923 32.8628C44.3176 32.9781 44.3344 33.0935 44.3302 33.2131V42.9142C45.6821 42.4101 46.8612 41.5258 47.733 40.3639C48.6089 39.202 49.1354 37.8137 49.2575 36.3613C49.3796 34.9089 49.0932 33.448 48.4278 32.1537C47.7625 30.8594 46.7475 29.7829 45.501 29.0567L37.3689 24.2894C37.3605 24.2866 37.3506 24.2837 37.3394 24.2809H37.3099C37.3015 24.2837 37.2917 24.2866 37.2805 24.2894C37.272 24.2923 37.2636 24.2966 37.2552 24.3023L33.8609 26.2929L43.6817 32.0469H43.6733ZM47.0634 26.8781H47.0592V26.8824L47.0634 26.8781ZM47.0592 26.8738C47.3034 25.4385 47.1392 23.9605 46.5833 22.6149C46.0316 21.2693 45.1093 20.1117 43.9301 19.2744C42.751 18.4414 41.3612 17.963 39.9252 17.8989C38.4849 17.8391 37.0615 18.1937 35.8149 18.9199L27.6828 23.6829C27.6744 23.6886 27.6674 23.6957 27.6618 23.7042L27.6449 23.7298C27.6421 23.7384 27.6393 23.7484 27.6365 23.7597C27.6337 23.7683 27.6323 23.7783 27.6323 23.7896V27.7709L37.4531 22.0169C37.5542 21.9571 37.6637 21.9144 37.7732 21.8802C37.8869 21.8503 38.0006 21.8375 38.1143 21.8375C38.2322 21.8375 38.3459 21.8503 38.4596 21.8802C38.5691 21.9144 38.6744 21.9571 38.7755 22.0169L46.8233 26.7329C46.8949 26.7756 47.0002 26.8354 47.0592 26.8738ZM25.7793 22.4654C25.7793 22.3501 25.7962 22.2347 25.8256 22.1194C25.8551 22.0083 25.8972 21.8973 25.9562 21.7948C26.0151 21.6965 26.0825 21.6025 26.1667 21.5171C26.2468 21.4359 26.3394 21.3633 26.4405 21.3078L34.4883 16.5961C34.5641 16.5491 34.6694 16.4893 34.7284 16.4594C33.625 15.5239 32.2774 14.9258 30.8498 14.7421C29.4221 14.5542 27.9734 14.7849 26.6721 15.4043C25.3666 16.0237 24.2632 17.0104 23.4926 18.2407C22.7219 19.4752 22.3134 20.902 22.3134 22.3629V31.8888C22.3162 31.9002 22.319 31.9102 22.3218 31.9187C22.3246 31.9273 22.3288 31.9358 22.3344 31.9444C22.3401 31.9529 22.3471 31.9615 22.3555 31.97C22.3611 31.9757 22.3695 31.9814 22.3808 31.9871L25.7793 33.9777V22.4654ZM27.6239 35.0542L31.9994 37.6172L36.375 35.0542V29.9324L32.0037 27.3694L27.6281 29.9324L27.6239 35.0542Z" fill="#3D3D3D"/>
</g>
<defs>
<clipPath id="clip0_740_1823">
<rect width="40" height="41" fill="white" transform="translate(12 12)"/>
</clipPath>
</defs>
</svg>