aia 2.0.0.0.pre.beta2 → 2.0.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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/CHANGELOG.md +146 -228
  4. data/README.md +41 -18
  5. data/bin/aia +8 -3
  6. data/lib/aia/aia_completion.bash +2 -3
  7. data/lib/aia/aia_completion.fish +6 -5
  8. data/lib/aia/aia_completion.zsh +2 -3
  9. data/lib/aia/chat_loop.rb +16 -14
  10. data/lib/aia/config/cli_parser.rb +123 -91
  11. data/lib/aia/config/defaults.yml +12 -39
  12. data/lib/aia/config/mcp_parser.rb +30 -36
  13. data/lib/aia/config/model_spec.rb +8 -14
  14. data/lib/aia/config/validator.rb +102 -103
  15. data/lib/aia/config/value_caster.rb +76 -0
  16. data/lib/aia/config.rb +70 -53
  17. data/lib/aia/crew.rb +29 -19
  18. data/lib/aia/debate_handler.rb +27 -10
  19. data/lib/aia/directives/configuration_directives.rb +55 -14
  20. data/lib/aia/directives/context_directives.rb +24 -12
  21. data/lib/aia/directives/execution_directives.rb +18 -23
  22. data/lib/aia/directives/model_directives.rb +41 -104
  23. data/lib/aia/directives/utility_directives.rb +16 -17
  24. data/lib/aia/directives/web_and_file_directives.rb +21 -14
  25. data/lib/aia/fact_asserter.rb +3 -3
  26. data/lib/aia/history_transfer.rb +64 -24
  27. data/lib/aia/logger.rb +10 -45
  28. data/lib/aia/mcp_config_normalizer.rb +27 -14
  29. data/lib/aia/mcp_connection_manager.rb +181 -184
  30. data/lib/aia/mcp_discovery.rb +43 -15
  31. data/lib/aia/mcp_grouper.rb +2 -1
  32. data/lib/aia/mcp_server_config.rb +20 -2
  33. data/lib/aia/mcp_utility.rb +24 -19
  34. data/lib/aia/mention_router.rb +15 -2
  35. data/lib/aia/modality_query.rb +36 -0
  36. data/lib/aia/model_alias_registry.rb +11 -11
  37. data/lib/aia/model_registry.rb +75 -0
  38. data/lib/aia/network_builder.rb +8 -7
  39. data/lib/aia/patches/ruby_llm_streaming_error.rb +21 -4
  40. data/lib/aia/patches/ruby_llm_tool_param_compat.rb +18 -0
  41. data/lib/aia/pipeline_orchestrator.rb +71 -38
  42. data/lib/aia/prompt_decomposer.rb +1 -1
  43. data/lib/aia/prompt_handler.rb +56 -29
  44. data/lib/aia/provider_registry.rb +105 -0
  45. data/lib/aia/robot_builder.rb +1 -1
  46. data/lib/aia/robot_factory.rb +67 -63
  47. data/lib/aia/robot_sync.rb +79 -0
  48. data/lib/aia/role_catalog.rb +89 -0
  49. data/lib/aia/session.rb +25 -11
  50. data/lib/aia/skill_utils.rb +60 -19
  51. data/lib/aia/spawn_handler.rb +16 -4
  52. data/lib/aia/spawn_spec_parser.rb +6 -7
  53. data/lib/aia/special_mode_handler.rb +28 -25
  54. data/lib/aia/speech.rb +70 -34
  55. data/lib/aia/startup_coordinator.rb +17 -92
  56. data/lib/aia/streaming_runner.rb +10 -2
  57. data/lib/aia/system_prompt_assembler.rb +12 -11
  58. data/lib/aia/task_board.rb +60 -0
  59. data/lib/aia/tool_approver.rb +205 -0
  60. data/lib/aia/tool_filter.rb +1 -10
  61. data/lib/aia/tool_filter_strategy.rb +12 -1
  62. data/lib/aia/tool_introspection.rb +9 -1
  63. data/lib/aia/tool_loader.rb +67 -33
  64. data/lib/aia/tool_utility.rb +6 -5
  65. data/lib/aia/tools/delegate_to_foreman_tool.rb +6 -4
  66. data/lib/aia/tools/recruit_robot_tool.rb +12 -12
  67. data/lib/aia/tools/reskill_robot_tool.rb +7 -7
  68. data/lib/aia/tools/task_board_tool.rb +16 -16
  69. data/lib/aia/trakflow_bridge.rb +14 -8
  70. data/lib/aia/turn_state.rb +31 -8
  71. data/lib/aia/ui_presenter.rb +16 -0
  72. data/lib/aia/utility.rb +6 -24
  73. data/lib/aia/variable_input_collector.rb +0 -3
  74. data/lib/aia/verification_network.rb +9 -10
  75. data/lib/aia.rb +33 -8
  76. metadata +19 -160
  77. data/.better-commits.json +0 -150
  78. data/.config/tocer/configuration.yml +0 -6
  79. data/.envrc +0 -19
  80. data/.loki +0 -11
  81. data/.reek.yml +0 -160
  82. data/.rubocop.yml +0 -116
  83. data/.rubocop_strict.yml +0 -15
  84. data/COMMITS.md +0 -196
  85. data/IMPLEMENTATION_PLAN.md +0 -506
  86. data/Rakefile +0 -47
  87. data/_typos.toml +0 -10
  88. data/aia.gemspec +0 -92
  89. data/architecture_review.md +0 -314
  90. data/config/aia.yml +0 -13
  91. data/docs/AGENTS.md +0 -40
  92. data/docs/advanced-prompting.md +0 -814
  93. data/docs/assets/images/aia.png +0 -0
  94. data/docs/cli-reference.md +0 -1241
  95. data/docs/configuration.md +0 -747
  96. data/docs/contributing.md +0 -386
  97. data/docs/directives-reference.md +0 -1145
  98. data/docs/examples/index.md +0 -277
  99. data/docs/examples/mcp/index.md +0 -475
  100. data/docs/examples/prompts/analysis/index.md +0 -78
  101. data/docs/examples/prompts/automation/index.md +0 -109
  102. data/docs/examples/prompts/development/index.md +0 -125
  103. data/docs/examples/prompts/index.md +0 -333
  104. data/docs/examples/prompts/learning/index.md +0 -127
  105. data/docs/examples/prompts/writing/index.md +0 -62
  106. data/docs/examples/tools/index.md +0 -282
  107. data/docs/faq.md +0 -578
  108. data/docs/guides/available-models.md +0 -366
  109. data/docs/guides/basic-usage.md +0 -478
  110. data/docs/guides/chat.md +0 -680
  111. data/docs/guides/crew.md +0 -239
  112. data/docs/guides/executable-prompts.md +0 -331
  113. data/docs/guides/first-prompt.md +0 -454
  114. data/docs/guides/getting-started.md +0 -455
  115. data/docs/guides/image-generation.md +0 -507
  116. data/docs/guides/index.md +0 -48
  117. data/docs/guides/local-models.md +0 -306
  118. data/docs/guides/migrate-prompts.md +0 -335
  119. data/docs/guides/models.md +0 -1017
  120. data/docs/guides/shared-tools.md +0 -254
  121. data/docs/guides/tools.md +0 -831
  122. data/docs/index.md +0 -259
  123. data/docs/installation.md +0 -274
  124. data/docs/mcp-integration.md +0 -603
  125. data/docs/prompt_management.md +0 -665
  126. data/docs/security.md +0 -674
  127. data/docs/special_projects_guide.md +0 -386
  128. data/docs/tools-and-mcp-examples.md +0 -1211
  129. data/docs/workflows-and-pipelines.md +0 -636
  130. data/examples/.gitignore +0 -2
  131. data/examples/00_setup_aia.sh +0 -111
  132. data/examples/01_basic_usage.sh +0 -23
  133. data/examples/02_frontmatter.sh +0 -33
  134. data/examples/03_shell_integration.sh +0 -55
  135. data/examples/04_erb_templating.sh +0 -56
  136. data/examples/05_shell_then_erb.sh +0 -38
  137. data/examples/06_prompt_chaining.sh +0 -59
  138. data/examples/07_pipeline.sh +0 -46
  139. data/examples/08_context_files.sh +0 -43
  140. data/examples/09_roles.sh +0 -67
  141. data/examples/10_stdin_piping.sh +0 -49
  142. data/examples/11_multi_model.sh +0 -65
  143. data/examples/12_token_usage.sh +0 -52
  144. data/examples/13_cost_tracking.sh +0 -68
  145. data/examples/14_output_file.sh +0 -91
  146. data/examples/15_parameters.sh +0 -68
  147. data/examples/16_directives.sh +0 -113
  148. data/examples/17_require_and_conditionals.sh +0 -68
  149. data/examples/18_tools.sh +0 -61
  150. data/examples/19_local_tools.sh +0 -34
  151. data/examples/20_mcp_servers.sh +0 -102
  152. data/examples/21_executable_prompts.sh +0 -78
  153. data/examples/22_chat_mode.sh +0 -217
  154. data/examples/23_verify.sh +0 -139
  155. data/examples/24_decompose.sh +0 -139
  156. data/examples/25_spawn.sh +0 -139
  157. data/examples/26_debate.sh +0 -97
  158. data/examples/27_mention_routing.sh +0 -157
  159. data/examples/28_model_switching.sh +0 -106
  160. data/examples/29_agent_harness.sh +0 -177
  161. data/examples/README.md +0 -321
  162. data/examples/advanced_multi_robot_capabilities_without_examples.md +0 -106
  163. data/examples/aia_config.yml +0 -22
  164. data/examples/aia_config_orchestrator.yml +0 -45
  165. data/examples/aia_config_with_mcp.yml +0 -21
  166. data/examples/common.sh +0 -39
  167. data/examples/context/project_goals.md +0 -6
  168. data/examples/context/tech_stack.md +0 -7
  169. data/examples/directives/timestamp_directive.rb +0 -22
  170. data/examples/mcp/filesystem.json +0 -9
  171. data/examples/prompts_dir/analyze.md +0 -2
  172. data/examples/prompts_dir/brainstorm.md +0 -2
  173. data/examples/prompts_dir/conditional.md +0 -17
  174. data/examples/prompts_dir/creative.md +0 -4
  175. data/examples/prompts_dir/erbinfo.md +0 -5
  176. data/examples/prompts_dir/erbinfo_raw.md +0 -8
  177. data/examples/prompts_dir/evaluate.md +0 -2
  178. data/examples/prompts_dir/explain_joke.md +0 -1
  179. data/examples/prompts_dir/explain_recursion.md +0 -1
  180. data/examples/prompts_dir/fun_fact +0 -3
  181. data/examples/prompts_dir/greeting.md +0 -8
  182. data/examples/prompts_dir/greeting_required.md +0 -7
  183. data/examples/prompts_dir/hello.md +0 -1
  184. data/examples/prompts_dir/includes/ruby_facts.md +0 -4
  185. data/examples/prompts_dir/limerick.md +0 -1
  186. data/examples/prompts_dir/list_with_mcp.md +0 -3
  187. data/examples/prompts_dir/pick_best.md +0 -2
  188. data/examples/prompts_dir/project_summary +0 -12
  189. data/examples/prompts_dir/quiz_with_include.md +0 -6
  190. data/examples/prompts_dir/require_demo.md +0 -5
  191. data/examples/prompts_dir/roles/formal.md +0 -3
  192. data/examples/prompts_dir/roles/orchestrator.md +0 -21
  193. data/examples/prompts_dir/roles/pirate.md +0 -3
  194. data/examples/prompts_dir/shell_then_erb.md +0 -6
  195. data/examples/prompts_dir/sort_compare.md +0 -2
  196. data/examples/prompts_dir/summarize_context.md +0 -2
  197. data/examples/prompts_dir/sysinfo.md +0 -5
  198. data/examples/prompts_dir/sysinfo_raw.md +0 -8
  199. data/examples/prompts_dir/tagline.md +0 -1
  200. data/examples/prompts_dir/tell_joke.md +0 -1
  201. data/examples/prompts_dir/tell_joke_with_next.md +0 -4
  202. data/examples/prompts_dir/use_local_tool.md +0 -8
  203. data/examples/prompts_dir/use_tools.md +0 -8
  204. data/examples/prompts_dir/weather.md +0 -2
  205. data/examples/prompts_dir/whats_new.md +0 -2
  206. data/examples/prompts_dir/with_timestamp.md +0 -5
  207. data/examples/requirements/sinatra_taskflow_app.md +0 -139
  208. data/examples/rules/01_classify_ruby.rb +0 -16
  209. data/examples/rules/02_prefer_claude_for_code.rb +0 -19
  210. data/examples/rules/03_gate_prompt_length.rb +0 -19
  211. data/examples/rules/04_tool_selection.rb +0 -41
  212. data/examples/rules/README.md +0 -30
  213. data/examples/run_all.sh +0 -294
  214. data/examples/tools/word_count_tool.rb +0 -30
  215. data/lib/AGENTS.md +0 -57
  216. data/lib/aia/model_switch_handler.rb +0 -100
  217. data/mcp_servers/README.md +0 -110
  218. data/mcp_servers/apple-mcp.json +0 -8
  219. data/mcp_servers/filesystem.json +0 -9
  220. data/mcp_servers/mcp_server_chart.json +0 -11
  221. data/mcp_servers/playwright_one.json +0 -8
  222. data/mcp_servers/playwright_server_definition.json +0 -9
  223. data/mcp_servers/playwright_two.json +0 -8
  224. data/mcp_servers/tavily_mcp_server.json +0 -8
  225. data/mkdocs.yml +0 -169
@@ -1,254 +0,0 @@
1
- # Shared Tools
2
-
3
- The [shared_tools gem](https://github.com/madbomber/shared_tools) provides a curated collection of ready-to-use tools for LLM-assisted workflows. These tools extend AIA's capabilities with file operations, web browsing, database access, system utilities, and more.
4
-
5
- ## Installation
6
-
7
- The `shared_tools` gem is installed separately:
8
-
9
- ```bash
10
- gem install shared_tools
11
- ```
12
-
13
- ## Usage
14
-
15
- Load shared tools into AIA with the `--require` option:
16
-
17
- ```bash
18
- # Load all shared tools
19
- aia --require shared_tools --chat
20
-
21
- # Load via the ruby_llm entry point (equivalent)
22
- aia --require shared_tools/ruby_llm --chat
23
-
24
- # Load a specific tool only
25
- aia --require shared_tools/ruby_llm/edit_file --chat
26
-
27
- # Combine with your own custom tools
28
- aia --require shared_tools --tools ~/my-tools/ --chat
29
-
30
- # Use in batch prompts (not just chat)
31
- aia --require shared_tools my_prompt input.txt
32
-
33
- # List what tools are available
34
- aia --require shared_tools --list-tools
35
- ```
36
-
37
- You can also load shared tools from within a prompt using a Ruby directive:
38
-
39
- ```ruby
40
- /ruby
41
- require 'shared_tools/ruby_llm'
42
- ```
43
-
44
- Or using an ERB block:
45
-
46
- ```erb
47
- <%= require 'shared_tools/ruby_llm'; '' %>
48
- ```
49
-
50
- ## Available Tools
51
-
52
- > **Tip:** Run `aia --require shared_tools --list-tools` to see the current list from your installed version. Redirect to a file for full markdown descriptions: `aia --require shared_tools --list-tools > tools.md`
53
-
54
- ### Data & Analysis
55
-
56
- #### `calculator`
57
-
58
- Perform advanced mathematical calculations with comprehensive error handling and validation.
59
- This tool supports basic arithmetic operations, parentheses, and common mathematical functions.
60
- It uses Dentaku for safe evaluation of mathematical expressions without executing arbitrary code,
61
- making it suitable for use in AI-assisted calculations where security is critical.
62
- The tool returns formatted results with configurable precision and helpful error messages
63
- when invalid expressions are provided.
64
-
65
- Supported operations:
66
- - Basic arithmetic: +, -, *, /, %
67
- - Parentheses for grouping: ( )
68
- - Exponentiation: ^ or pow(base, exponent)
69
- - Comparison operators: =, <, >, <=, >=, !=
70
- - Logical operators: and, or, not
71
- - Mathematical functions: sqrt, round, roundup, rounddown, abs
72
- - Trigonometric functions: sin, cos, tan
73
-
74
- #### `composite_analysis`
75
-
76
- Perform comprehensive multi-stage data analysis by orchestrating multiple specialized analysis steps
77
- to provide complete insights from various data sources. This composite tool automatically
78
- determines the appropriate data fetching method (web scraping for URLs, file reading for
79
- local paths), analyzes data structure and content, generates statistical insights,
80
- and suggests appropriate visualizations based on the data characteristics.
81
- Ideal for exploratory data analysis workflows where you need a complete picture
82
- from initial data loading through final insights. Handles CSV, JSON, and text data formats.
83
-
84
- ### Database
85
-
86
- #### `database_tool`
87
-
88
- Executes SQL commands (INSERT / UPDATE / SELECT / etc) on a database. Supports full read-write operations for data manipulation and schema management.
89
-
90
- #### `database_query`
91
-
92
- Execute safe, read-only database queries with automatic connection management and security controls.
93
- This tool is designed for secure data retrieval operations only, restricting access to SELECT statements
94
- to prevent any data modification. It includes automatic connection pooling, query result limiting,
95
- query timeout support, and comprehensive error handling. The tool supports multiple database configurations
96
- through environment variables and ensures all connections are properly closed after use.
97
-
98
- Security features:
99
- - SELECT-only queries (no INSERT, UPDATE, DELETE, DROP, etc.)
100
- - Automatic LIMIT clause enforcement
101
- - Query timeout protection
102
- - Prepared statement support to prevent SQL injection
103
- - Connection pooling with automatic cleanup
104
-
105
- Supported databases: PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and any database supported by Sequel.
106
-
107
- ### File & System Operations
108
-
109
- #### `disk_tool`
110
-
111
- A tool for interacting with a system. It is able to list, create, delete, move and modify directories and files.
112
-
113
- #### `clipboard`
114
-
115
- Read from or write to the system clipboard.
116
-
117
- This tool provides cross-platform clipboard access:
118
- - macOS: Uses pbcopy/pbpaste
119
- - Linux: Uses xclip or xsel (must be installed)
120
- - Windows: Uses clip/powershell
121
-
122
- Actions: `read`, `write`, `clear`.
123
-
124
- #### `system_info`
125
-
126
- Retrieve system information including operating system, CPU, memory, and disk details.
127
-
128
- This tool provides cross-platform system information:
129
- - macOS: Uses system_profiler, sysctl, and df commands
130
- - Linux: Uses /proc filesystem and df command
131
- - Windows: Uses wmic and powershell commands
132
-
133
- Categories: `all`, `os`, `cpu`, `memory`, `disk`, `network`.
134
-
135
- #### `computer_tool`
136
-
137
- A tool for interacting with a computer.
138
-
139
- ### Web & Network
140
-
141
- #### `browser_tool`
142
-
143
- Automates a web browser to perform various actions like visiting web pages, clicking elements, inspecting page content, and taking screenshots.
144
-
145
- Actions:
146
- 1. `visit` - Navigate to a website
147
- 2. `page_inspect` - Get page HTML or summary
148
- 3. `ui_inspect` - Find elements by text content
149
- 4. `selector_inspect` - Find elements by CSS selector
150
- 5. `click` - Click an element by CSS selector
151
- 6. `text_field_set` - Enter text in input fields/text areas
152
- 7. `screenshot` - Take a screenshot of the page or specific element
153
-
154
- #### `dns`
155
-
156
- Perform DNS lookups and reverse DNS queries.
157
-
158
- Uses Ruby's built-in Resolv library for cross-platform DNS resolution.
159
-
160
- Actions:
161
- - `lookup` - Resolve a hostname to IP addresses
162
- - `reverse` - Perform reverse DNS lookup (IP to hostname)
163
- - `mx` - Get MX (mail exchange) records for a domain
164
- - `txt` - Get TXT records for a domain
165
- - `ns` - Get NS (nameserver) records for a domain
166
- - `all` - Get all available DNS records for a domain
167
-
168
- Record types for lookup: `A` (IPv4), `AAAA` (IPv6), `CNAME`, `ANY`.
169
-
170
- ### Code Execution
171
-
172
- #### `eval_tool`
173
-
174
- Execute code in various programming languages (Ruby, Python, Shell).
175
-
176
- **WARNING**: This tool executes arbitrary code. All code execution requires user authorization for security.
177
-
178
- Actions:
179
- - `ruby` - Execute Ruby code
180
- - `python` - Execute Python code (requires python3 in system PATH)
181
- - `shell` - Execute shell commands
182
-
183
- ### Documents
184
-
185
- #### `doc_tool`
186
-
187
- Read and process various document formats.
188
-
189
- Actions:
190
- - `pdf_read` - Read specific pages from a PDF document
191
-
192
- The `page_numbers` parameter accepts single pages (`"5"`), multiple pages (`"1, 3, 5"`), and range notation (`"1-10"` or `"1, 3-5, 10"`).
193
-
194
- ### Scheduling & Time
195
-
196
- #### `current_date_time`
197
-
198
- Returns the current date, time, and timezone information from the system.
199
- This tool provides accurate temporal context for AI assistants that need
200
- to reason about time-sensitive information or schedule-related queries.
201
-
202
- Returns: date (ISO 8601), time (24-hour), timezone name and UTC offset, Unix timestamp, day of week, and week number.
203
-
204
- #### `cron`
205
-
206
- Parse, validate, and explain cron expressions.
207
-
208
- Supports standard 5-field cron format (minute, hour, day of month, month, day of week) with special characters: `*`, `,`, `-`, `/`.
209
-
210
- Actions:
211
- - `parse` - Parse and explain a cron expression
212
- - `validate` - Check if a cron expression is valid
213
- - `next` - Calculate the next N execution times
214
- - `generate` - Generate a cron expression from a description
215
-
216
- ### Workflow & Weather
217
-
218
- #### `workflow_manager`
219
-
220
- Manage complex multi-step workflows with persistent state tracking across tool invocations.
221
- This tool enables the creation and management of stateful workflows that can span multiple
222
- AI interactions and tool calls. It provides workflow initialization, step-by-step execution,
223
- status monitoring, and completion tracking. Each workflow maintains its state in persistent
224
- storage, allowing for resumption of long-running processes and coordination between
225
- multiple tools and AI interactions.
226
-
227
- Workflow lifecycle:
228
- 1. **Start** - Initialize a new workflow with initial data (returns workflow_id)
229
- 2. **Step** - Execute multiple workflow steps using the workflow_id
230
- 3. **Status** - Check workflow progress and state at any time
231
- 4. **Complete** - Finalize the workflow and clean up resources
232
-
233
- #### `weather_tool`
234
-
235
- Retrieve comprehensive current weather information for any city worldwide using the OpenWeatherMap API.
236
- This tool provides real-time weather data including temperature, atmospheric conditions, humidity,
237
- and wind information. Requires the `OPENWEATHER_API_KEY` environment variable.
238
-
239
- ### Development & Reference
240
-
241
- #### `error_handling_tool`
242
-
243
- Reference tool demonstrating comprehensive error handling patterns and resilience strategies
244
- for robust tool development. This tool showcases best practices for handling different
245
- types of errors including validation errors, network failures, authorization issues,
246
- and general exceptions. It implements retry mechanisms with exponential backoff,
247
- proper resource cleanup, detailed error categorization, and user-friendly error messages.
248
-
249
- ## Related Documentation
250
-
251
- - [Tools Guide](tools.md) - Custom tool development and configuration
252
- - [Chat Mode](chat.md) - Using tools in interactive mode
253
- - [MCP Integration](../mcp-integration.md) - Model Context Protocol tools
254
- - [CLI Reference](../cli-reference.md) - `--require`, `--tools`, `--list-tools` options