110 Commits

Author SHA1 Message Date
Dominik Jain
d3e531ec7c Improve REPL
- Add full command history navigation with arrow up/down keys
- Show history indicator while browsing (yellow box with position)
- Auto-resize textarea to fit content
- Improve scroll behavior to show output after execution
- Remove redundant auto-fill of previous code
- Streamline page layout (remove heading, fix scrollbar issues)
2026-01-28 19:50:21 +01:00
Dominik Jain
9903bdf2dd Add instructions to work around counter-intuitive child ordering #28 #32
This is a temporary solution until the issue can be resolved in the API
2026-01-27 23:17:46 +01:00
Dominik Jain
8480ff63e8 Improve prompts on layouts 2026-01-27 14:42:42 +01:00
Dominik Jain
669a931b07 Add information on text resizing and asynchronous property updates 2026-01-20 12:25:50 +01:00
Dominik Jain
ef37434fa4 Improve prompts on containment checks 2026-01-20 12:25:50 +01:00
Dominik Jain
b055eafd0c Mention reverse order of children in flex layouts 2026-01-20 12:23:33 +01:00
Dominik Jain
20524a3a0d Instruct model to copy selection immediately 2026-01-19 21:40:41 +01:00
Dominik Jain
b82fd2cea8 Retain the readonly designation in API docs 2026-01-19 17:31:21 +01:00
Dominik Jain
c2484f312a PluginBridge: Improve logging 2026-01-15 23:50:47 +01:00
Dominik Jain
45f8c9b1df Add small section on revising designs, minor reordering #26 2026-01-15 18:08:44 +01:00
Dominik Jain
892098d63e Encourage use of the storage object 2026-01-15 17:32:59 +01:00
Dominik Jain
07300fea2d PenpotUtils.analyzeDescendants: Try more explicit args (root, shape) for evaluator #26
This can perhaps prevent usage errors
2026-01-15 17:30:36 +01:00
Dominik Jain
e993c74636 Improve prompt pertaining to image handling 2026-01-15 17:02:52 +01:00
Dominik Jain
d23b0dbe91 Improve prompts pertaining to hierarchy/reparenting #26
Remove redundant section
2026-01-15 17:02:38 +01:00
Dominik Jain
90459f0ba4 Add PenpotUtils.analyzeDescendants as a powerful utility function for validation #26 2026-01-15 16:42:47 +01:00
Dominik Jain
c4c37adb25 PenpotUtils: Add isContainedIn and setParentXY #26 2026-01-14 22:21:20 +01:00
Dominik Jain
3c1bd875d8 PenpotUtils.shapeStructure: Add essential information on layouts #26 2026-01-14 21:49:52 +01:00
Dominik Jain
4353f67322 Move 'Executing Code' section to the top 2026-01-14 21:49:52 +01:00
Dominik Jain
57c99d98f7 Initial prompt improvements inspired by design linter experiment #26 2026-01-14 21:49:42 +01:00
Dominik Jain
3dc2411130 Extend ExportShapeTool to support the export of image fill content
Add new tool parameter `mode` ("shape" or "fill") to support this

Since the fill's format is not guaranteed to be PNG, include dependency
`sharp` to handle image format conversion

Because the export logic has become more complex, introduce
PenpotUtils.exportImage utility function for minimal code to be
sent to the plugin for execution

Resolves #12
2026-01-14 16:15:36 +01:00
Dominik Jain
ec798e0363 Improve docstrings 2026-01-13 21:09:44 +01:00
Dominik Jain
28cad04e50 Remove test code 2026-01-13 20:55:56 +01:00
Dominik Jain
2b1a287f15 Update dependencies 2026-01-13 20:12:19 +01:00
Dominik Jain
c40fd3aefd Make MCP server listen address configurable, using localhost by default 2026-01-13 18:13:04 +01:00
Dominik Jain
055f717207 Standardise configuration with environment variables
Replace CLI parameters with environment variables, keeping only --multi-user and --help

Environment variables:
- PENPOT_MCP_SERVER_PORT (new, replaces CLI param)
- PENPOT_MCP_WEBSOCKET_PORT (new)
- PENPOT_MCP_REPL_PORT (new)
- PENPOT_MCP_SERVER_ADDRESS (new)
- PENPOT_MCP_REMOTE_MODE (existing)
- PENPOT_MCP_LOG_LEVEL (renamed from LOG_LEVEL, replaces CLI param)
- PENPOT_MCP_LOG_DIR (renamed from LOG_DIR, replaces CLI param)
- PENPOT_MCP_PLUGIN_SERVER_LISTEN_ADDRESS (renamed from PENPOT_MCP_PLUGIN_SERVER_ALLOWED_HOSTS)

Additional changes:
- Plugin now constructs WebSocket URL from server address and port (replaces PENPOT_MCP_WEBSOCKET_URL)
- Use configured server address in all startup log messages
- Document all configuration options in README.md
2026-01-12 22:55:17 +01:00
Dominik Jain
2598a57080 Add new concept of 'remote mode' (configurable via env var)
In particular, remote mode disables file system access
2026-01-12 20:51:32 +01:00
Dominik Jain
c51255cbe0 System prompt: Add new information on z-order handling 2026-01-12 14:01:50 +01:00
Dominik Jain
04a67ca60c Update API docs 2026-01-12 13:41:16 +01:00
Dominik Jain
445cf728b8 In multi-user mode, disable file system access in tools #20 2025-12-16 22:50:10 +01:00
Dominik Jain
3766124961 Introduce MCP server launch argument --multi-user and adjust NPM scripts
(adding :multi-user variants) #20
2025-12-16 22:28:02 +01:00
Dominik Jain
66af0d6b72 PluginBridge: Support multi-user mode via user tokens #20 2025-12-16 22:28:02 +01:00
Dominik Jain
df7245cb9d Support passing a user-specific token to MCP server requests
which can subsequently be accessed by downstream calls #20
2025-12-15 13:18:43 +01:00
Dominik Jain
81d6c70f39 Improve logging of tool arguments 2025-11-29 23:02:37 +01:00
Dominik Jain
60acaec396 Enable file logging (writing to mcp-server/logs at info level by default) 2025-11-29 22:38:52 +01:00
Dominik Jain
f01774ab6b System prompt: More information on shape positioning (particularly with respect to parent shapes) 2025-11-28 16:41:22 +01:00
Dominik Jain
82737f19d4 Add information on libraries to system prompt
Add structure to system prompt, adding headings
2025-11-28 12:39:40 +01:00
Dominik Jain
b223bec540 Improve system prompt
* Regroup shape-related information
  * Add info on semantics of location (x, y), z-order
  * Add info on deprecation of Image and use of fills
  * More uniform formatting
2025-11-14 13:45:17 +01:00
Dominik Jain
24ffeac2bf Move image import code to PenpotUtils 2025-11-14 12:58:04 +01:00
Dominik Jain
f8f440c7dd Add ImportImageTool
Add PenpotUtils.atob to support base64 conversion
(regular atob not available in plugin context)

Resolves #10
2025-11-13 19:09:27 +01:00
Juanfran
ca7187f81f Improve shape and image searching prompts 2025-11-05 15:21:35 +01:00
Dominik Jain
6fe80bb99c Apply prettier to .yml files 2025-11-05 13:46:57 +01:00
Dominik Jain
ef060c4da6 Improve description of ExecuteCodeTool 2025-10-19 23:03:22 +02:00
Dominik Jain
670b0d6b07 Disallow multiple plugin instances being connected in parallel 2025-10-16 19:20:17 +02:00
Dominik Jain
e3a9771f9c ExecuteCodeTool: Remove redundant preamble for success results 2025-10-16 16:17:00 +02:00
Dominik Jain
6c6204806f ExportShapeTool: Fix SVG export 2025-10-16 16:17:00 +02:00
Dominik Jain
bc5936365a REPL: Reuse last input 2025-10-15 17:45:47 +02:00
Dominik Jain
6daede99b2 REPL: Improve style for output number 2025-10-15 17:31:40 +02:00
Dominik Jain
8a6848a663 Move prettier configuration to top level 2025-10-11 22:56:57 +02:00
Dominik Jain
0b9404e2a2 Remove obsolete tool: PrintTextTool 2025-10-11 22:56:57 +02:00
Dominik Jain
4cbce1e009 Remove obsolete tool: HelloWorldTool 2025-10-11 22:56:57 +02:00