roast-ai 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/CLAUDE.md +3 -1
  4. data/Gemfile +1 -0
  5. data/Gemfile.lock +15 -10
  6. data/README.md +189 -20
  7. data/examples/bash_prototyping/README.md +53 -0
  8. data/examples/bash_prototyping/analyze_network/prompt.md +13 -0
  9. data/examples/bash_prototyping/analyze_system/prompt.md +11 -0
  10. data/examples/bash_prototyping/api_testing.yml +14 -0
  11. data/examples/bash_prototyping/check_processes/prompt.md +11 -0
  12. data/examples/bash_prototyping/generate_report/prompt.md +16 -0
  13. data/examples/bash_prototyping/process_json_response/prompt.md +24 -0
  14. data/examples/bash_prototyping/system_analysis.yml +14 -0
  15. data/examples/bash_prototyping/test_public_api/prompt.md +22 -0
  16. data/examples/cmd/README.md +99 -0
  17. data/examples/cmd/analyze_project/prompt.md +57 -0
  18. data/examples/cmd/basic_demo/prompt.md +48 -0
  19. data/examples/cmd/basic_workflow.yml +17 -0
  20. data/examples/cmd/check_repository/prompt.md +57 -0
  21. data/examples/cmd/create_and_verify/prompt.md +56 -0
  22. data/examples/cmd/dev_workflow.yml +26 -0
  23. data/examples/cmd/explore_project/prompt.md +67 -0
  24. data/examples/cmd/explorer_workflow.yml +21 -0
  25. data/examples/cmd/smart_tool_selection/prompt.md +99 -0
  26. data/examples/grading/read_dependencies/prompt.md +4 -2
  27. data/examples/grading/run_coverage.rb +9 -0
  28. data/examples/grading/workflow.yml +0 -2
  29. data/examples/mcp/README.md +223 -0
  30. data/examples/mcp/analyze_changes/prompt.md +8 -0
  31. data/examples/mcp/analyze_issues/prompt.md +4 -0
  32. data/examples/mcp/analyze_schema/prompt.md +4 -0
  33. data/examples/mcp/check_data_quality/prompt.md +5 -0
  34. data/examples/mcp/check_documentation/prompt.md +4 -0
  35. data/examples/mcp/create_recommendations/prompt.md +5 -0
  36. data/examples/mcp/database_workflow.yml +29 -0
  37. data/examples/mcp/env_demo/workflow.yml +34 -0
  38. data/examples/mcp/fetch_pr_context/prompt.md +4 -0
  39. data/examples/mcp/filesystem_demo/create_test_file/prompt.md +2 -0
  40. data/examples/mcp/filesystem_demo/list_files/prompt.md +6 -0
  41. data/examples/mcp/filesystem_demo/read_with_mcp/prompt.md +7 -0
  42. data/examples/mcp/filesystem_demo/workflow.yml +38 -0
  43. data/examples/mcp/generate_insights/prompt.md +4 -0
  44. data/examples/mcp/generate_report/prompt.md +6 -0
  45. data/examples/mcp/generate_review/prompt.md +16 -0
  46. data/examples/mcp/github_workflow.yml +32 -0
  47. data/examples/mcp/multi_mcp_workflow.yml +58 -0
  48. data/examples/mcp/post_review/prompt.md +3 -0
  49. data/examples/mcp/save_report/prompt.md +6 -0
  50. data/examples/mcp/search_issues/prompt.md +2 -0
  51. data/examples/mcp/summarize/prompt.md +1 -0
  52. data/examples/mcp/test_filesystem/prompt.md +6 -0
  53. data/examples/mcp/test_github/prompt.md +8 -0
  54. data/examples/mcp/test_read/prompt.md +1 -0
  55. data/examples/mcp/workflow.yml +35 -0
  56. data/examples/shared_config/README.md +52 -0
  57. data/examples/shared_config/example_with_shared_config/workflow.yml +6 -0
  58. data/examples/shared_config/shared.yml +7 -0
  59. data/examples/step_configuration/README.md +0 -3
  60. data/examples/step_configuration/workflow.yml +0 -3
  61. data/examples/tool_config_example/README.md +109 -0
  62. data/examples/tool_config_example/example_step/prompt.md +42 -0
  63. data/examples/tool_config_example/workflow.yml +17 -0
  64. data/examples/workflow_generator/workflow.yml +0 -1
  65. data/lib/roast/helpers/function_caching_interceptor.rb +0 -4
  66. data/lib/roast/helpers/prompt_loader.rb +0 -1
  67. data/lib/roast/tools/bash.rb +62 -0
  68. data/lib/roast/tools/cmd.rb +121 -34
  69. data/lib/roast/tools/coding_agent.rb +86 -7
  70. data/lib/roast/tools/helpers/coding_agent_message_formatter.rb +87 -0
  71. data/lib/roast/tools/search_file.rb +13 -1
  72. data/lib/roast/tools.rb +5 -5
  73. data/lib/roast/version.rb +1 -1
  74. data/lib/roast/workflow/base_iteration_step.rb +5 -4
  75. data/lib/roast/workflow/base_step.rb +30 -21
  76. data/lib/roast/workflow/base_workflow.rb +8 -10
  77. data/lib/roast/workflow/configuration.rb +12 -3
  78. data/lib/roast/workflow/configuration_loader.rb +63 -4
  79. data/lib/roast/workflow/configuration_parser.rb +0 -3
  80. data/lib/roast/workflow/error_handler.rb +0 -1
  81. data/lib/roast/workflow/file_state_repository.rb +0 -1
  82. data/lib/roast/workflow/iteration_executor.rb +4 -2
  83. data/lib/roast/workflow/output_manager.rb +0 -1
  84. data/lib/roast/workflow/step_executor_coordinator.rb +5 -3
  85. data/lib/roast/workflow/step_executors/hash_step_executor.rb +1 -1
  86. data/lib/roast/workflow/step_loader.rb +35 -8
  87. data/lib/roast/workflow/step_orchestrator.rb +4 -2
  88. data/lib/roast/workflow/workflow_execution_context.rb +0 -2
  89. data/lib/roast/workflow/workflow_executor.rb +2 -4
  90. data/lib/roast/workflow/workflow_initializer.rb +66 -2
  91. data/lib/roast/workflow/workflow_runner.rb +1 -2
  92. data/lib/roast.rb +8 -0
  93. data/package-lock.json +6 -0
  94. data/roast.gemspec +2 -1
  95. metadata +72 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64b0bfad5bc7ce9abd2d750ff52695ba997a750556a403e3ab4fc449dfb28946
4
- data.tar.gz: 526beebc0ca0697df5ce2f871468fff246440615634ae516439b4c0740f8ce90
3
+ metadata.gz: 28055339ac18d63a1abd7151943558a114df2e48930c63aa63c65536d193061b
4
+ data.tar.gz: c5be17b70caa32f73dca316ab4816d0b92c0c7121747b3e5492f58124e815f87
5
5
  SHA512:
6
- metadata.gz: 0600537a7242638e683a884a0b22b4d5f7fd58bb02d0c7a04240c8720d197a1f4f5e2d5f44c1a7f0335506f7822b51b6c245fd1c5f25627c8a580319d63b1250
7
- data.tar.gz: e368630d036c6c3ac6efe00d102ddbf89d438332916ed1adb5aa54fe6cb5f9b34f9adf637c6e36c5baab07015c6f0fb848f675476d4233accd005a98b9630642
6
+ metadata.gz: d5b300fd001d8cc55ecdb5751bc891840732f63be8e951e2c4333a178fde6c2197a2b0063f3add45b48e85251e9b2ee28119d237322bb8f89af86c2208345c1f
7
+ data.tar.gz: c579010aedef591cd1a72fb6cd34c15db38fc225550aa17a841397e5f8849c09c5f87cf81da3f04f2300c5dcac704ab2d8a0f78fe8fd443fabfe62e67780a015
data/CHANGELOG.md CHANGED
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.0] - 2025-06-04
9
+
10
+ ### Changed
11
+ - **BREAKING**: Upgraded to Raix 1.0.0 (#141)
12
+ - Removed the deprecated `loop` parameter from chat_completion calls
13
+ - Raix 1.0 automatically continues after tool calls until providing a text response
14
+ - All chat completions now return strings (no longer arrays or complex structures)
15
+ - JSON responses are automatically parsed when `json: true` is specified
16
+ - **BREAKING**: Removed configurable `loop` and `auto_loop` options from workflow configuration (#140)
17
+ - The `loop:` and `auto_loop:` YAML configuration options have been removed entirely
18
+ - Looping behavior is now automatic: always enabled when tools are present, disabled when no tools exist
19
+ - This simplifies the codebase and makes behavior more predictable
20
+ - To migrate: remove any `loop: true/false` or `auto_loop: true/false` settings from your workflow YAML files
21
+
22
+ ### Fixed
23
+ - Enhanced boolean coercion to treat empty strings as false
24
+ - Improved iterable coercion to handle JSON array strings
25
+ - Fixed all tests to work with Raix 1.0's string-only responses
26
+
27
+ ## [0.2.3] - 2025-05-29
28
+
29
+ ### Fixed
30
+ - Model inheritance for nested steps in iteration steps (#105)
31
+ - Nested steps within `repeat` and `each` blocks now properly inherit model configuration
32
+ - Configuration hierarchy works correctly: step-specific → workflow-level → default model
33
+ - Previously, nested steps always used the default model regardless of configuration
34
+
8
35
  ## [0.2.2] - 2025-05-29
9
36
 
10
37
  ### Added
data/CLAUDE.md CHANGED
@@ -55,6 +55,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
55
  ## Guidance and Expectations
56
56
 
57
57
  - Do not decide unilaterally to leave code for the sake of "backwards compatibility"... always run those decisions by me first.
58
+ - Don't ever commit and push changes unless directly told to do so
58
59
 
59
60
  ## Git Workflow Practices
60
61
 
@@ -165,4 +166,5 @@ gh pr diff {pr_number}
165
166
  18. Prioritize code readability while encouraging performance optimizations:
166
167
  - Avoid premature optimization outside of hot paths
167
168
  - Consider the tradeoff between readability and performance
168
- - Suggest optimizations that improve both clarity and performance
169
+ - Suggest optimizations that improve both clarity and performance
170
+ ```
data/Gemfile CHANGED
@@ -17,3 +17,4 @@ gem "rake", require: false
17
17
  gem "rubocop-shopify", require: false
18
18
  gem "vcr", require: false
19
19
  gem "webmock", require: false
20
+ gem "minitest-rg"
data/Gemfile.lock CHANGED
@@ -1,19 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roast-ai (0.2.2)
4
+ roast-ai (0.3.0)
5
5
  activesupport (>= 7.0)
6
6
  cli-ui
7
7
  diff-lcs (~> 1.5)
8
8
  faraday-retry
9
9
  json-schema
10
- raix (~> 0.8.6)
10
+ open_router (~> 0.3)
11
+ raix (~> 1.0)
11
12
  thor (~> 1.3)
12
13
 
13
14
  GEM
14
15
  remote: https://rubygems.org/
15
16
  specs:
16
- activesupport (7.2.2.1)
17
+ activesupport (8.0.2)
17
18
  base64
18
19
  benchmark (>= 0.3)
19
20
  bigdecimal
@@ -25,12 +26,13 @@ GEM
25
26
  minitest (>= 5.1)
26
27
  securerandom (>= 0.3)
27
28
  tzinfo (~> 2.0, >= 2.0.5)
29
+ uri (>= 0.13.1)
28
30
  addressable (2.8.7)
29
31
  public_suffix (>= 2.0.2, < 7.0)
30
32
  ast (2.4.3)
31
- base64 (0.2.0)
32
- benchmark (0.4.0)
33
- bigdecimal (3.1.9)
33
+ base64 (0.3.0)
34
+ benchmark (0.4.1)
35
+ bigdecimal (3.2.2)
34
36
  cgi (0.4.2)
35
37
  cli-ui (2.3.1)
36
38
  coderay (1.1.3)
@@ -41,7 +43,7 @@ GEM
41
43
  rexml
42
44
  diff-lcs (1.6.1)
43
45
  dotenv (3.1.8)
44
- drb (2.2.1)
46
+ drb (2.2.3)
45
47
  event_stream_parser (1.0.0)
46
48
  faraday (2.13.1)
47
49
  faraday-net_http (>= 2.0, < 3.5)
@@ -53,7 +55,6 @@ GEM
53
55
  net-http (>= 0.5.0)
54
56
  faraday-retry (2.3.1)
55
57
  faraday (~> 2.0)
56
- ffi (1.17.2)
57
58
  ffi (1.17.2-arm64-darwin)
58
59
  ffi (1.17.2-x86_64-linux-gnu)
59
60
  formatador (1.1.0)
@@ -75,7 +76,7 @@ GEM
75
76
  hashdiff (1.1.2)
76
77
  i18n (1.14.7)
77
78
  concurrent-ruby (~> 1.0)
78
- json (2.12.0)
79
+ json (2.12.2)
79
80
  json-schema (5.1.1)
80
81
  addressable (~> 2.8)
81
82
  bigdecimal (~> 3.1)
@@ -88,6 +89,8 @@ GEM
88
89
  lumberjack (1.2.10)
89
90
  method_source (1.1.0)
90
91
  minitest (5.25.5)
92
+ minitest-rg (5.3.0)
93
+ minitest (~> 5.0)
91
94
  mocha (2.7.1)
92
95
  ruby2_keywords (>= 0.0.5)
93
96
  multipart-post (2.4.1)
@@ -114,10 +117,11 @@ GEM
114
117
  public_suffix (6.0.1)
115
118
  racc (1.8.1)
116
119
  rainbow (3.1.1)
117
- raix (0.8.6)
120
+ raix (1.0.0)
118
121
  activesupport (>= 6.0)
119
122
  faraday-retry (~> 2.0)
120
123
  open_router (~> 0.2)
124
+ ostruct
121
125
  ruby-openai (~> 7)
122
126
  rake (13.2.1)
123
127
  rb-fsevent (0.11.2)
@@ -173,6 +177,7 @@ DEPENDENCIES
173
177
  dotenv
174
178
  guard
175
179
  guard-minitest
180
+ minitest-rg
176
181
  mocha
177
182
  rake
178
183
  roast-ai!
data/README.md CHANGED
@@ -51,6 +51,10 @@ steps:
51
51
  analyze_coverage:
52
52
  model: gpt-4-turbo
53
53
  json: true
54
+
55
+ # Step-specific config that specifies a custom path, not in the current directory
56
+ generate_report:
57
+ path: ../reporting/generate_report
54
58
  ```
55
59
 
56
60
  Each step can have its own prompt file (e.g., `analyze_coverage/prompt.md`) and configuration. Steps can be run in parallel by nesting them in arrays:
@@ -78,7 +82,7 @@ steps:
78
82
 
79
83
  ## Try it
80
84
 
81
- If you dont have one already, get an OpenAI key from [here](https://platform.openai.com/settings/organization/api-keys). You will need an account with a credit card, make sure that a basic completion works.
85
+ If you don't have one already, get an OpenAI key from [here](https://platform.openai.com/settings/organization/api-keys). You will need an account with a credit card, make sure that a basic completion works.
82
86
 
83
87
  ```bash
84
88
  export OPENAI_API_KEY=sk-proj-....
@@ -169,7 +173,7 @@ Roast supports several types of steps:
169
173
  steps:
170
174
  - lint_check: $(rubocop {{file}})
171
175
  - fix_issues
172
-
176
+
173
177
  # Step configuration
174
178
  lint_check:
175
179
  exit_on_error: false # Continue workflow even if command fails
@@ -186,13 +190,13 @@ Roast supports several types of steps:
186
190
  - notify_team
187
191
  else:
188
192
  - run_development_setup
189
-
193
+
190
194
  - verify_dependencies:
191
195
  unless: "$(bundle check)"
192
196
  then:
193
197
  - bundle_install: "$(bundle install)"
194
198
  ```
195
-
199
+
196
200
  Conditions can be:
197
201
  - Ruby expressions: `if: "{{output['count'] > 5}}"`
198
202
  - Bash commands: `if: "$(test -f config.yml && echo true)"` (exit code 0 = true)
@@ -209,7 +213,7 @@ Roast supports several types of steps:
209
213
  steps:
210
214
  - analyze_file
211
215
  - Generate a report for {{current_file}}
212
-
216
+
213
217
  # Repeat until a condition is met
214
218
  - improve_code:
215
219
  repeat:
@@ -219,12 +223,12 @@ Roast supports several types of steps:
219
223
  - run_tests
220
224
  - fix_issues
221
225
  ```
222
-
226
+
223
227
  Each loops support:
224
228
  - Collections from Ruby expressions: `each: "{{[1, 2, 3]}}"`
225
229
  - Command output: `each: "$(ls *.rb)"`
226
230
  - Step references: `each: "file_list"`
227
-
231
+
228
232
  Repeat loops support:
229
233
  - Until conditions: `until: "{{condition}}"`
230
234
  - Maximum iterations: `max_iterations: 10`
@@ -233,7 +237,7 @@ Roast supports several types of steps:
233
237
  ```yaml
234
238
  steps:
235
239
  - detect_language
236
-
240
+
237
241
  - case: "{{ workflow.output.detect_language }}"
238
242
  when:
239
243
  ruby:
@@ -249,13 +253,13 @@ Roast supports several types of steps:
249
253
  - analyze_generic
250
254
  - generate_basic_report
251
255
  ```
252
-
256
+
253
257
  Case expressions can be:
254
258
  - Workflow outputs: `case: "{{ workflow.output.variable }}"`
255
259
  - Ruby expressions: `case: "{{ count > 10 ? 'high' : 'low' }}"`
256
260
  - Bash commands: `case: "$(echo $ENVIRONMENT)"`
257
261
  - Direct values: `case: "production"`
258
-
262
+
259
263
  The value is compared against each key in the `when` clause, and matching steps are executed.
260
264
  If no match is found, the `else` steps are executed (if provided).
261
265
 
@@ -266,6 +270,43 @@ Roast supports several types of steps:
266
270
  ```
267
271
  This creates a simple prompt-response interaction without tool calls or looping. It's detected by the presence of spaces in the step name and is useful for summarization or simple questions at the end of a workflow.
268
272
 
273
+ #### Shared Configuration
274
+
275
+ Roast supports sharing common configuration and steps across multiple workflows using a `shared.yml` file.
276
+
277
+ 1. Place a `shared.yml` file one level above your workflow directory
278
+ 2. Define YAML anchors for common configurations like tools, models or steps
279
+ 3. Reference these anchors in your workflow files using YAML alias syntax
280
+
281
+ **Example structure:**
282
+ ```
283
+ my_project/
284
+ ├── shared.yml # Common configuration anchors
285
+ └── workflows/
286
+ ├── analyze_code.yml
287
+ ├── generate_docs.yml
288
+ └── test_suite.yml
289
+ ```
290
+
291
+ **Example `shared.yml`:**
292
+ ```yaml
293
+ # Define common tools
294
+ standard_tools: &standard_tools
295
+ - Roast::Tools::Grep
296
+ - Roast::Tools::ReadFile
297
+ - Roast::Tools::WriteFile
298
+ - Roast::Tools::SearchFile
299
+ ```
300
+
301
+ **Using in workflows:**
302
+ ```yaml
303
+ name: Code Analysis Workflow
304
+ tools: *standard_tools # Reference shared tools
305
+
306
+ steps:
307
+ ...
308
+ ```
309
+
269
310
  #### Data Flow Between Steps
270
311
 
271
312
  Roast handles data flow between steps in three primary ways:
@@ -542,6 +583,56 @@ Roast provides extensive instrumentation capabilities using ActiveSupport::Notif
542
583
 
543
584
  Roast provides several built-in tools that you can use in your workflows:
544
585
 
586
+ #### Tool Configuration
587
+
588
+ Tools can be configured using a hash format in your workflow YAML:
589
+
590
+ ```yaml
591
+ tools:
592
+ - Roast::Tools::ReadFile # No configuration needed
593
+ - Roast::Tools::Cmd: # With configuration
594
+ allowed_commands:
595
+ - git
596
+ - npm
597
+ - yarn
598
+ - Roast::Tools::CodingAgent: # Optional configuration
599
+ coding_agent_command: claude --model opus -p --allowedTools "Bash, Glob, Grep, LS, Read"
600
+ ```
601
+
602
+ Currently supported configurations:
603
+ - `Roast::Tools::Cmd` via `allowed_commands`: restricts which commands can be executed (defaults to: `pwd`, `find`, `ls`, `rake`, `ruby`, `dev`, `mkdir`)
604
+ - `Roast::Tools::CodingAgent` via `coding_agent_command`: customizes the Claude Code CLI command used by the agent
605
+
606
+ ##### Cmd Tool Configuration
607
+
608
+ The `Cmd` tool's `allowed_commands` can be configured in two ways:
609
+
610
+ **1. Simple String Format** (uses default descriptions):
611
+ ```yaml
612
+ tools:
613
+ - Roast::Tools::Cmd:
614
+ allowed_commands:
615
+ - pwd
616
+ - ls
617
+ - git
618
+ ```
619
+
620
+ **2. Hash Format with Custom Descriptions**:
621
+ ```yaml
622
+ tools:
623
+ - Roast::Tools::Cmd:
624
+ allowed_commands:
625
+ - pwd
626
+ - name: git
627
+ description: "git CLI - version control system with subcommands like status, commit, push"
628
+ - name: npm
629
+ description: "npm CLI - Node.js package manager with subcommands like install, run"
630
+ - name: docker
631
+ description: "Docker CLI - container platform with subcommands like build, run, ps"
632
+ ```
633
+
634
+ Custom descriptions help the LLM understand when and how to use each command, making your workflows more effective.
635
+
545
636
  #### ReadFile
546
637
 
547
638
  Reads the contents of a file from the filesystem.
@@ -649,23 +740,43 @@ search_file(query: "class User", file_path: "app/models")
649
740
 
650
741
  #### Cmd
651
742
 
652
- Executes shell commands and returns their output.
743
+ Executes shell commands with configurable restrictions. By default, only allows specific safe commands.
653
744
 
654
745
  ```ruby
655
- # Execute a simple command
746
+ # Execute allowed commands (pwd, find, ls, rake, ruby, dev, mkdir by default)
747
+ pwd(args: "-L")
748
+ ls(args: "-la")
749
+ ruby(args: "-e 'puts RUBY_VERSION'")
750
+
751
+ # Or use the legacy cmd function with full command
656
752
  cmd(command: "ls -la")
753
+ ```
754
+
755
+ - Commands are registered as individual functions based on allowed_commands configuration
756
+ - Default allowed commands: pwd, find, ls, rake, ruby, dev, mkdir
757
+ - Each command has built-in descriptions to help the LLM understand usage
758
+ - Configurable via workflow YAML (see Tool Configuration section)
759
+
760
+ #### Bash
657
761
 
658
- # With working directory specified
659
- cmd(command: "npm list", cwd: "/path/to/project")
762
+ Executes shell commands without restrictions. **⚠️ WARNING: Use only in trusted environments!**
763
+
764
+ ```ruby
765
+ # Execute any command - no restrictions
766
+ bash(command: "curl https://api.example.com | jq '.data'")
660
767
 
661
- # With environment variables
662
- cmd(command: "deploy", env: { "NODE_ENV" => "production" })
768
+ # Complex operations with pipes and redirects
769
+ bash(command: "find . -name '*.log' -mtime +30 -delete")
770
+
771
+ # System administration tasks
772
+ bash(command: "ps aux | grep ruby | awk '{print $2}'")
663
773
  ```
664
774
 
665
- - Provides access to shell commands for more complex operations
666
- - Can specify working directory and environment variables
667
- - Captures and returns command output
668
- - Useful for integrating with existing tools and scripts
775
+ - **No command restrictions** - full shell access
776
+ - Designed for prototyping and development environments
777
+ - Logs warnings by default (disable with `ROAST_BASH_WARNINGS=false`)
778
+ - Should NOT be used in production or untrusted contexts
779
+ - See `examples/bash_prototyping/` for usage examples
669
780
 
670
781
  #### CodingAgent
671
782
 
@@ -683,6 +794,64 @@ coding_agent(
683
794
  - Useful for tasks that require deep code understanding or multi-step changes
684
795
  - Can work across multiple files and languages
685
796
 
797
+ ### MCP (Model Context Protocol) Tools
798
+
799
+ Roast supports MCP tools, allowing you to integrate external services and tools through the Model Context Protocol standard. MCP enables seamless connections to databases, APIs, and specialized tools.
800
+
801
+ #### Configuring MCP Tools
802
+
803
+ MCP tools are configured in the `tools` section of your workflow YAML alongside traditional Roast tools:
804
+
805
+ ```yaml
806
+ tools:
807
+ # Traditional Roast tools
808
+ - Roast::Tools::ReadFile
809
+
810
+ # MCP tools with SSE (Server-Sent Events)
811
+ - Documentation:
812
+ url: https://gitmcp.io/myorg/myrepo/docs
813
+ env:
814
+ - "Authorization: Bearer {{env.API_TOKEN}}"
815
+
816
+ # MCP tools with stdio
817
+ - GitHub:
818
+ command: npx
819
+ args: ["-y", "@modelcontextprotocol/server-github"]
820
+ env:
821
+ GITHUB_PERSONAL_ACCESS_TOKEN: "{{env.GITHUB_TOKEN}}"
822
+ only:
823
+ - search_repositories
824
+ - get_issue
825
+ - create_issue
826
+ ```
827
+
828
+ #### SSE MCP Tools
829
+
830
+ Connect to HTTP endpoints implementing the MCP protocol:
831
+
832
+ ```yaml
833
+ - Tool Name:
834
+ url: https://example.com/mcp-endpoint
835
+ env:
836
+ - "Authorization: Bearer {{resource.api_token}}"
837
+ only: [function1, function2] # Optional whitelist
838
+ except: [function3] # Optional blacklist
839
+ ```
840
+
841
+ #### Stdio MCP Tools
842
+
843
+ Connect to local processes implementing the MCP protocol:
844
+
845
+ ```yaml
846
+ - Tool Name:
847
+ command: docker
848
+ args: ["run", "-i", "--rm", "ghcr.io/example/mcp-server"]
849
+ env:
850
+ API_KEY: "{{env.API_KEY}}"
851
+ ```
852
+
853
+ See the [MCP tools example](examples/mcp/) for complete documentation and more examples.
854
+
686
855
  ### Custom Tools
687
856
 
688
857
  You can create your own tools using the [Raix function dispatch pattern](https://github.com/OlympiaAI/raix-rails?tab=readme-ov-file#use-of-toolsfunctions). Custom tools should be placed in `.roast/initializers/` (subdirectories are supported):
@@ -0,0 +1,53 @@
1
+ # Bash Tool Examples
2
+
3
+ This directory contains example workflows demonstrating the Bash tool, which provides unrestricted command execution for prototyping scenarios.
4
+
5
+ ## ⚠️ Security Warning
6
+
7
+ The Bash tool executes commands without any restrictions. Only use it in:
8
+ - Development environments
9
+ - Trusted contexts
10
+ - Prototyping scenarios where you explicitly want unrestricted access
11
+
12
+ **Never use the Bash tool in production workflows or with untrusted input!**
13
+
14
+ ## Examples
15
+
16
+ ### 1. System Analysis Workflow (`system_analysis.yml`)
17
+
18
+ Demonstrates using Bash for system inspection and analysis tasks that would be restricted by the Cmd tool.
19
+
20
+ ### 2. API Testing Workflow (`api_testing.yml`)
21
+
22
+ Shows how to use Bash for making API calls with curl and processing responses with jq.
23
+
24
+ ### 3. DevOps Automation (`devops_workflow.yml`)
25
+
26
+ Example of using Bash for DevOps tasks like container management and log analysis.
27
+
28
+ ## Disabling Warnings
29
+
30
+ By default, the Bash tool logs warnings about unrestricted execution. To disable these warnings:
31
+
32
+ ```bash
33
+ export ROAST_BASH_WARNINGS=false
34
+ roast execute workflow.yml
35
+ ```
36
+
37
+ ## Best Practices
38
+
39
+ 1. **Use Cmd tool when possible**: If your commands fit within Cmd's allowed list, use it instead
40
+ 2. **Validate inputs**: Always validate any user input before passing to Bash
41
+ 3. **Limit scope**: Use the most restrictive tool that meets your needs
42
+ 4. **Document risks**: Clearly document when and why Bash tool is necessary
43
+ 5. **Environment isolation**: Run Bash workflows in isolated environments when possible
44
+
45
+ ## Comparison with Cmd Tool
46
+
47
+ | Feature | Cmd Tool | Bash Tool |
48
+ |---------|----------|-----------|
49
+ | Command restrictions | Yes (configurable) | No |
50
+ | Default allowed commands | pwd, find, ls, rake, ruby, dev, mkdir | All commands |
51
+ | Security warnings | No | Yes (can be disabled) |
52
+ | Recommended for production | Yes | No |
53
+ | Use case | General automation | Prototyping & development |
@@ -0,0 +1,13 @@
1
+ # Analyze Network Configuration
2
+
3
+ Use the bash tool to gather network information:
4
+
5
+ 1. Check network interfaces (ifconfig or ip addr)
6
+ 2. Display routing table (netstat -nr or ip route)
7
+ 3. Check listening ports (netstat -an | grep LISTEN or lsof -i -P | grep LISTEN)
8
+ 4. Test DNS resolution (nslookup example.com or dig example.com)
9
+ 5. Check current network connections
10
+
11
+ Provide a summary of the network configuration and any interesting findings.
12
+
13
+ Note: Some commands may require different syntax on macOS vs Linux.
@@ -0,0 +1,11 @@
1
+ # Analyze System Information
2
+
3
+ Use the bash tool to gather system information including:
4
+
5
+ 1. Operating system details (uname -a)
6
+ 2. Current disk usage (df -h)
7
+ 3. Memory information (if available via free -m on Linux or vm_stat on macOS)
8
+ 4. Current user and groups (whoami, groups)
9
+ 5. Environment variables (env | grep -E "PATH|HOME|USER")
10
+
11
+ Gather this information and provide a summary of the system's current state.
@@ -0,0 +1,14 @@
1
+ name: API Testing with Bash
2
+ model: gpt-4o-mini
3
+ tools:
4
+ - Roast::Tools::Bash
5
+ - Roast::Tools::WriteFile
6
+
7
+ # Demonstrates using Bash for API testing with curl and jq
8
+ # These commands would be restricted by the Cmd tool
9
+
10
+ steps:
11
+ - test_public_api
12
+ - process_json_response
13
+ - test_multiple_endpoints
14
+ - generate_api_report
@@ -0,0 +1,11 @@
1
+ # Check Running Processes
2
+
3
+ Use the bash tool to analyze running processes:
4
+
5
+ 1. List all processes (ps aux or ps -ef)
6
+ 2. Find the top 5 CPU-consuming processes
7
+ 3. Find the top 5 memory-consuming processes
8
+ 4. Check if any specific development services are running (like databases, web servers)
9
+ 5. Count total number of processes
10
+
11
+ Note: The exact commands may vary between macOS and Linux. Use appropriate commands for the detected OS.
@@ -0,0 +1,16 @@
1
+ # Generate System Analysis Report
2
+
3
+ Based on all the information gathered in previous steps:
4
+
5
+ 1. Create a comprehensive markdown report summarizing:
6
+ - System specifications and OS details
7
+ - Resource usage (CPU, memory, disk)
8
+ - Active processes and services
9
+ - Network configuration
10
+ - Any potential issues or interesting findings
11
+
12
+ 2. Save the report to `system_analysis_report.md` using the write_file tool
13
+
14
+ 3. Include timestamps and organize the information in a clear, readable format
15
+
16
+ The report should be suitable for sharing with other developers or for documentation purposes.
@@ -0,0 +1,24 @@
1
+ # Process JSON Responses
2
+
3
+ Use bash with jq (if available) to process JSON responses:
4
+
5
+ 1. First check if jq is installed:
6
+ ```bash
7
+ which jq
8
+ ```
9
+
10
+ 2. If jq is available, use it to parse JSON:
11
+ ```bash
12
+ curl -s https://api.github.com/users/github | jq '.name, .public_repos'
13
+ ```
14
+
15
+ 3. If jq is not available, use alternative methods like:
16
+ - grep with regular expressions
17
+ - sed/awk for parsing
18
+ - Python one-liners if Python is available
19
+
20
+ 4. Extract specific fields from the API responses
21
+ 5. Count items in arrays
22
+ 6. Filter data based on conditions
23
+
24
+ Show different approaches for JSON processing depending on available tools.
@@ -0,0 +1,14 @@
1
+ name: System Analysis with Bash
2
+ model: gpt-4o-mini
3
+ tools:
4
+ - Roast::Tools::Bash
5
+ - Roast::Tools::WriteFile
6
+
7
+ # This workflow demonstrates using Bash for system analysis tasks
8
+ # that would be restricted by the Cmd tool
9
+
10
+ steps:
11
+ - analyze_system
12
+ - check_processes
13
+ - analyze_network
14
+ - generate_report
@@ -0,0 +1,22 @@
1
+ # Test Public API Endpoints
2
+
3
+ Use the bash tool to test various public APIs:
4
+
5
+ 1. Test GitHub API:
6
+ ```bash
7
+ curl -s https://api.github.com/users/github
8
+ ```
9
+
10
+ 2. Test a public JSON placeholder API:
11
+ ```bash
12
+ curl -s https://jsonplaceholder.typicode.com/posts/1
13
+ ```
14
+
15
+ 3. Check response headers:
16
+ ```bash
17
+ curl -I https://api.github.com
18
+ ```
19
+
20
+ 4. Test with different HTTP methods if appropriate
21
+
22
+ Analyze the responses and note the structure of the returned data.