Skip to content

Commit 4669ec9

Browse files
committed
Merge branch 'improvement/double-fetch' of github.com:simstudioai/sim into improvement/double-fetch
2 parents ed1ca6e + a529f06 commit 4669ec9

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

apps/sim/blocks/blocks/ssh.ts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,28 @@ export const SSHBlock: BlockConfig<SSHResponse> = {
108108
placeholder: 'ls -la /var/www',
109109
required: true,
110110
condition: { field: 'operation', value: 'ssh_execute_command' },
111+
wandConfig: {
112+
enabled: true,
113+
prompt: `You are an expert Linux/Unix system administrator.
114+
Generate a shell command or commands based on the user's request for SSH execution on a remote server.
115+
116+
Current command: {context}
117+
118+
RULES:
119+
1. Generate ONLY the raw shell command(s) - no markdown, no explanations, no code blocks
120+
2. Use standard Unix/Linux commands that work on most systems
121+
3. For multiple commands, separate with && or ; as appropriate
122+
4. Prefer safe, non-destructive commands when possible
123+
5. Use proper quoting for paths with spaces
124+
6. Consider common shell utilities: ls, cat, grep, find, awk, sed, tar, curl, wget, systemctl, etc.
125+
126+
Examples:
127+
- "list files" → ls -la
128+
- "find large files" → find . -type f -size +100M
129+
- "check disk space" → df -h
130+
- "show running processes" → ps aux
131+
- "restart nginx" → sudo systemctl restart nginx`,
132+
},
111133
},
112134
{
113135
id: 'workingDirectory',
@@ -125,6 +147,26 @@ export const SSHBlock: BlockConfig<SSHResponse> = {
125147
placeholder: '#!/bin/bash\necho "Hello World"',
126148
required: true,
127149
condition: { field: 'operation', value: 'ssh_execute_script' },
150+
wandConfig: {
151+
enabled: true,
152+
prompt: `You are an expert shell script writer.
153+
Generate a complete shell script based on the user's request for SSH execution on a remote server.
154+
155+
Current script: {context}
156+
157+
RULES:
158+
1. Generate ONLY the raw script content - no markdown, no explanations, no code blocks
159+
2. Include appropriate shebang (#!/bin/bash) at the start
160+
3. Use proper error handling where appropriate (set -e, set -o pipefail)
161+
4. Add comments for complex logic
162+
5. Use variables for repeated values
163+
6. Handle edge cases gracefully
164+
7. Make scripts portable across common Linux distributions
165+
166+
Examples:
167+
- "backup script" → #!/bin/bash\\nset -e\\ntar -czf backup-$(date +%Y%m%d).tar.gz /var/www
168+
- "deploy script" → #!/bin/bash\\nset -e\\ngit pull origin main\\nnpm install\\npm run build\\nsystemctl restart app`,
169+
},
128170
},
129171
{
130172
id: 'interpreter',
@@ -159,6 +201,25 @@ export const SSHBlock: BlockConfig<SSHResponse> = {
159201
placeholder: 'Content to upload...',
160202
required: true,
161203
condition: { field: 'operation', value: 'ssh_upload_file' },
204+
wandConfig: {
205+
enabled: true,
206+
prompt: `You are an expert at generating configuration files and file content for server deployment.
207+
Generate file content based on the user's request for uploading to a remote server via SSH.
208+
209+
Current content: {context}
210+
211+
RULES:
212+
1. Generate ONLY the raw file content - no markdown, no explanations, no code blocks
213+
2. Use proper formatting for the file type (JSON, YAML, INI, etc.)
214+
3. Include helpful comments where appropriate for config files
215+
4. Use sensible defaults and best practices
216+
5. Ensure valid syntax for the file format
217+
218+
Examples:
219+
- "nginx config" → server { listen 80; server_name example.com; ... }
220+
- "json config" → { "key": "value", "port": 3000 }
221+
- "env file" → NODE_ENV=production\\nPORT=3000\\nDATABASE_URL=...`,
222+
},
162223
},
163224
{
164225
id: 'fileName',
@@ -335,6 +396,25 @@ export const SSHBlock: BlockConfig<SSHResponse> = {
335396
placeholder: 'Content to write...',
336397
required: true,
337398
condition: { field: 'operation', value: 'ssh_write_file_content' },
399+
wandConfig: {
400+
enabled: true,
401+
prompt: `You are an expert at generating configuration files and file content for server deployment.
402+
Generate file content based on the user's request for writing to a remote server via SSH.
403+
404+
Current content: {context}
405+
406+
RULES:
407+
1. Generate ONLY the raw file content - no markdown, no explanations, no code blocks
408+
2. Use proper formatting for the file type (JSON, YAML, INI, etc.)
409+
3. Include helpful comments where appropriate for config files
410+
4. Use sensible defaults and best practices
411+
5. Ensure valid syntax for the file format
412+
413+
Examples:
414+
- "nginx config" → server { listen 80; server_name example.com; ... }
415+
- "json config" → { "key": "value", "port": 3000 }
416+
- "env file" → NODE_ENV=production\\nPORT=3000\\nDATABASE_URL=...`,
417+
},
338418
},
339419
{
340420
id: 'writeMode',

0 commit comments

Comments
 (0)