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:
@@ -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.**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user