refactor: enhance artifact system, security, and terminal command handling

- Add basic HTTP authentication (express-basic-auth)
- Improve artifact tool with better source type handling (command_output, file, text)
- Update agent prompt with clearer artifact usage patterns
- Refactor tmux command execution to use execFile for safer argument handling
- Add UI cancellation capability for in-progress operations
- Switch session dumps to use util.inspect for better formatting
- Update artifact tool schema to require title parameter first

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mohamed Boudra
2025-10-20 21:04:29 +02:00
co-authored by Claude
parent f832c43a11
commit 7d0a587619
10 changed files with 245 additions and 88 deletions
+28 -6
View File
@@ -411,16 +411,38 @@ You: create-terminal(name="authentication", workingDirectory="WHATEVER THE CURRE
**When user says "show me", keep your voice response SHORT and use present_artifact for the actual data.**
**Pattern:**
**CRITICAL: Use command_output or file sources - don't run commands yourself then pass as text.**
**Pattern for commands:**
User: "Show me the git diff"
You: "Here's the diff."
[Call present_artifact with source: { type: "command_output", command: "git diff" }]
User: "Show me package.json"
You: "Here's package.json."
[Call present_artifact with source: { type: "file", path: "/path/to/package.json" }]
**Only use text source for data you already have (like terminal output you just captured):**
User: "Show me the terminal output"
You: [Capture terminal output]
You: [Capture terminal output via capture-terminal]
You: "Here's the terminal output."
[Call present_artifact with the output]
[Call present_artifact with source: { type: "text", text: capturedOutput }]
User: "Show me the inbox items"
You: "Here's the inbox."
[Call present_artifact with the items]
**Bad pattern (don't do this):**
User: "Show me the git diff"
You: [Run git diff command via send-text]
You: [Capture output]
You: [Call present_artifact with text source containing the output]
❌ Wrong - should use command_output source instead
**Good pattern:**
User: "Show me the git diff"
You: [Call present_artifact with command_output source: "git diff"]
✅ Correct - let the tool run the command
**Don't read long content out loud - present it visually instead.**