aia 2.0.0.0.pre.alpha → 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.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/CHANGELOG.md +151 -228
- data/README.md +42 -19
- data/bin/aia +8 -3
- data/lib/aia/aia_completion.bash +2 -3
- data/lib/aia/aia_completion.fish +6 -5
- data/lib/aia/aia_completion.zsh +2 -3
- data/lib/aia/chat_loop.rb +24 -66
- data/lib/aia/config/cli_parser.rb +164 -123
- data/lib/aia/config/defaults.yml +12 -39
- data/lib/aia/config/mcp_parser.rb +42 -40
- data/lib/aia/config/model_spec.rb +8 -14
- data/lib/aia/config/validator.rb +144 -156
- data/lib/aia/config/value_caster.rb +76 -0
- data/lib/aia/config.rb +72 -54
- data/lib/aia/content_extractor.rb +2 -0
- data/lib/aia/cost_calculator.rb +1 -0
- data/lib/aia/crew.rb +29 -19
- data/lib/aia/debate_handler.rb +45 -20
- data/lib/aia/delegate_handler.rb +7 -3
- data/lib/aia/directive.rb +10 -8
- data/lib/aia/directives/configuration_directives.rb +164 -109
- data/lib/aia/directives/context_directives.rb +55 -40
- data/lib/aia/directives/execution_directives.rb +25 -25
- data/lib/aia/directives/model_directives.rb +112 -195
- data/lib/aia/directives/trakflow_directives.rb +27 -9
- data/lib/aia/directives/utility_directives.rb +86 -87
- data/lib/aia/directives/web_and_file_directives.rb +83 -63
- data/lib/aia/fact_asserter.rb +3 -3
- data/lib/aia/history_transfer.rb +64 -24
- data/lib/aia/layered_orchestrator.rb +66 -43
- data/lib/aia/logger.rb +27 -62
- data/lib/aia/mcp_config_normalizer.rb +27 -14
- data/lib/aia/mcp_connection_manager.rb +193 -186
- data/lib/aia/mcp_discovery.rb +43 -15
- data/lib/aia/mcp_grouper.rb +2 -1
- data/lib/aia/mcp_server_config.rb +48 -0
- data/lib/aia/mcp_utility.rb +28 -20
- data/lib/aia/mention_router.rb +22 -52
- data/lib/aia/modality_query.rb +36 -0
- data/lib/aia/model_alias_registry.rb +11 -11
- data/lib/aia/model_registry.rb +75 -0
- data/lib/aia/network_builder.rb +17 -11
- data/lib/aia/network_memory_manager.rb +6 -6
- data/lib/aia/patches/ruby_llm_streaming_error.rb +21 -4
- data/lib/aia/patches/ruby_llm_tool_param_compat.rb +18 -0
- data/lib/aia/pipeline_orchestrator.rb +88 -45
- data/lib/aia/plugin_monitor.rb +9 -6
- data/lib/aia/prompt_decomposer.rb +6 -4
- data/lib/aia/prompt_handler.rb +90 -69
- data/lib/aia/provider_registry.rb +105 -0
- data/lib/aia/robot_builder.rb +1 -1
- data/lib/aia/robot_factory.rb +77 -69
- data/lib/aia/robot_namer.rb +2 -8
- data/lib/aia/robot_sync.rb +79 -0
- data/lib/aia/role_catalog.rb +89 -0
- data/lib/aia/session.rb +32 -14
- data/lib/aia/session_tracker.rb +39 -41
- data/lib/aia/similarity_scorer.rb +5 -3
- data/lib/aia/skill_utils.rb +60 -19
- data/lib/aia/spawn_handler.rb +16 -4
- data/lib/aia/spawn_spec_parser.rb +6 -7
- data/lib/aia/special_mode_handler.rb +80 -57
- data/lib/aia/speech.rb +103 -0
- data/lib/aia/startup_coordinator.rb +17 -91
- data/lib/aia/streaming_runner.rb +16 -5
- data/lib/aia/system_prompt_assembler.rb +20 -15
- data/lib/aia/task_board.rb +60 -0
- data/lib/aia/task_coordinator.rb +10 -5
- data/lib/aia/timing.rb +15 -0
- data/lib/aia/tool_approver.rb +205 -0
- data/lib/aia/tool_filter.rb +1 -9
- data/lib/aia/tool_filter_strategy.rb +39 -25
- data/lib/aia/tool_introspection.rb +25 -0
- data/lib/aia/tool_loader.rb +71 -31
- data/lib/aia/tool_utility.rb +6 -5
- data/lib/aia/tools/delegate_to_foreman_tool.rb +6 -4
- data/lib/aia/tools/recruit_robot_tool.rb +12 -12
- data/lib/aia/tools/reskill_robot_tool.rb +7 -7
- data/lib/aia/tools/task_board_tool.rb +17 -16
- data/lib/aia/trakflow_bridge.rb +19 -11
- data/lib/aia/turn_state.rb +32 -8
- data/lib/aia/ui_presenter.rb +83 -59
- data/lib/aia/utility.rb +8 -24
- data/lib/aia/variable_input_collector.rb +1 -3
- data/lib/aia/verification_network.rb +10 -12
- data/lib/aia.rb +49 -8
- metadata +27 -162
- data/.better-commits.json +0 -150
- data/.config/tocer/configuration.yml +0 -6
- data/.envrc +0 -15
- data/.loki +0 -231
- data/.quality/flay_baseline.txt +0 -1
- data/.quality/flog_baseline.txt +0 -29
- data/.quality/reek_baseline.txt +0 -80
- data/.rubocop.yml +0 -116
- data/COMMITS.md +0 -196
- data/IMPLEMENTATION_PLAN.md +0 -506
- data/Rakefile +0 -160
- data/architecture_review.md +0 -314
- data/docs/AGENTS.md +0 -40
- data/docs/advanced-prompting.md +0 -814
- data/docs/assets/images/aia.png +0 -0
- data/docs/cli-reference.md +0 -1241
- data/docs/configuration.md +0 -747
- data/docs/contributing.md +0 -386
- data/docs/directives-reference.md +0 -1145
- data/docs/examples/index.md +0 -277
- data/docs/examples/mcp/index.md +0 -475
- data/docs/examples/prompts/analysis/index.md +0 -78
- data/docs/examples/prompts/automation/index.md +0 -109
- data/docs/examples/prompts/development/index.md +0 -125
- data/docs/examples/prompts/index.md +0 -333
- data/docs/examples/prompts/learning/index.md +0 -127
- data/docs/examples/prompts/writing/index.md +0 -62
- data/docs/examples/tools/index.md +0 -282
- data/docs/faq.md +0 -578
- data/docs/guides/available-models.md +0 -366
- data/docs/guides/basic-usage.md +0 -478
- data/docs/guides/chat.md +0 -680
- data/docs/guides/crew.md +0 -239
- data/docs/guides/executable-prompts.md +0 -331
- data/docs/guides/first-prompt.md +0 -454
- data/docs/guides/getting-started.md +0 -455
- data/docs/guides/image-generation.md +0 -507
- data/docs/guides/index.md +0 -48
- data/docs/guides/local-models.md +0 -306
- data/docs/guides/migrate-prompts.md +0 -335
- data/docs/guides/models.md +0 -1017
- data/docs/guides/shared-tools.md +0 -254
- data/docs/guides/tools.md +0 -831
- data/docs/index.md +0 -259
- data/docs/installation.md +0 -274
- data/docs/mcp-integration.md +0 -603
- data/docs/prompt_management.md +0 -665
- data/docs/security.md +0 -674
- data/docs/special_projects_guide.md +0 -386
- data/docs/tools-and-mcp-examples.md +0 -1211
- data/docs/workflows-and-pipelines.md +0 -636
- data/examples/.gitignore +0 -2
- data/examples/00_setup_aia.sh +0 -111
- data/examples/01_basic_usage.sh +0 -23
- data/examples/02_frontmatter.sh +0 -33
- data/examples/03_shell_integration.sh +0 -55
- data/examples/04_erb_templating.sh +0 -56
- data/examples/05_shell_then_erb.sh +0 -38
- data/examples/06_prompt_chaining.sh +0 -59
- data/examples/07_pipeline.sh +0 -46
- data/examples/08_context_files.sh +0 -43
- data/examples/09_roles.sh +0 -67
- data/examples/10_stdin_piping.sh +0 -49
- data/examples/11_multi_model.sh +0 -65
- data/examples/12_token_usage.sh +0 -52
- data/examples/13_cost_tracking.sh +0 -68
- data/examples/14_output_file.sh +0 -91
- data/examples/15_parameters.sh +0 -68
- data/examples/16_directives.sh +0 -113
- data/examples/17_require_and_conditionals.sh +0 -68
- data/examples/18_tools.sh +0 -61
- data/examples/19_local_tools.sh +0 -34
- data/examples/20_mcp_servers.sh +0 -102
- data/examples/21_executable_prompts.sh +0 -78
- data/examples/22_chat_mode.sh +0 -217
- data/examples/23_verify.sh +0 -139
- data/examples/24_decompose.sh +0 -139
- data/examples/25_spawn.sh +0 -139
- data/examples/26_debate.sh +0 -97
- data/examples/27_mention_routing.sh +0 -157
- data/examples/28_model_switching.sh +0 -106
- data/examples/29_agent_harness.sh +0 -177
- data/examples/README.md +0 -321
- data/examples/advanced_multi_robot_capabilities_without_examples.md +0 -106
- data/examples/aia_config.yml +0 -22
- data/examples/aia_config_orchestrator.yml +0 -45
- data/examples/aia_config_with_mcp.yml +0 -21
- data/examples/common.sh +0 -39
- data/examples/context/project_goals.md +0 -6
- data/examples/context/tech_stack.md +0 -7
- data/examples/directives/timestamp_directive.rb +0 -22
- data/examples/mcp/filesystem.json +0 -9
- data/examples/prompts_dir/analyze.md +0 -2
- data/examples/prompts_dir/brainstorm.md +0 -2
- data/examples/prompts_dir/conditional.md +0 -17
- data/examples/prompts_dir/creative.md +0 -4
- data/examples/prompts_dir/erbinfo.md +0 -5
- data/examples/prompts_dir/erbinfo_raw.md +0 -8
- data/examples/prompts_dir/evaluate.md +0 -2
- data/examples/prompts_dir/explain_joke.md +0 -1
- data/examples/prompts_dir/explain_recursion.md +0 -1
- data/examples/prompts_dir/fun_fact +0 -3
- data/examples/prompts_dir/greeting.md +0 -8
- data/examples/prompts_dir/greeting_required.md +0 -7
- data/examples/prompts_dir/hello.md +0 -1
- data/examples/prompts_dir/includes/ruby_facts.md +0 -4
- data/examples/prompts_dir/limerick.md +0 -1
- data/examples/prompts_dir/list_with_mcp.md +0 -3
- data/examples/prompts_dir/pick_best.md +0 -2
- data/examples/prompts_dir/project_summary +0 -12
- data/examples/prompts_dir/quiz_with_include.md +0 -6
- data/examples/prompts_dir/require_demo.md +0 -5
- data/examples/prompts_dir/roles/formal.md +0 -3
- data/examples/prompts_dir/roles/orchestrator.md +0 -21
- data/examples/prompts_dir/roles/pirate.md +0 -3
- data/examples/prompts_dir/shell_then_erb.md +0 -6
- data/examples/prompts_dir/sort_compare.md +0 -2
- data/examples/prompts_dir/summarize_context.md +0 -2
- data/examples/prompts_dir/sysinfo.md +0 -5
- data/examples/prompts_dir/sysinfo_raw.md +0 -8
- data/examples/prompts_dir/tagline.md +0 -1
- data/examples/prompts_dir/tell_joke.md +0 -1
- data/examples/prompts_dir/tell_joke_with_next.md +0 -4
- data/examples/prompts_dir/use_local_tool.md +0 -8
- data/examples/prompts_dir/use_tools.md +0 -8
- data/examples/prompts_dir/weather.md +0 -2
- data/examples/prompts_dir/whats_new.md +0 -2
- data/examples/prompts_dir/with_timestamp.md +0 -5
- data/examples/requirements/sinatra_taskflow_app.md +0 -139
- data/examples/rules/01_classify_ruby.rb +0 -16
- data/examples/rules/02_prefer_claude_for_code.rb +0 -19
- data/examples/rules/03_gate_prompt_length.rb +0 -19
- data/examples/rules/04_tool_selection.rb +0 -41
- data/examples/rules/README.md +0 -30
- data/examples/run_all.sh +0 -294
- data/examples/tools/word_count_tool.rb +0 -30
- data/lib/AGENTS.md +0 -57
- data/lib/aia/model_switch_handler.rb +0 -100
- data/mcp_servers/README.md +0 -110
- data/mcp_servers/apple-mcp.json +0 -8
- data/mcp_servers/filesystem.json +0 -9
- data/mcp_servers/mcp_server_chart.json +0 -11
- data/mcp_servers/playwright_one.json +0 -8
- data/mcp_servers/playwright_server_definition.json +0 -9
- data/mcp_servers/playwright_two.json +0 -8
- data/mcp_servers/tavily_mcp_server.json +0 -8
- data/mkdocs.yml +0 -169
data/docs/index.md
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
|
2
|
-
|
|
3
|
-
## Table of Contents
|
|
4
|
-
|
|
5
|
-
- [AIA - AI Assistant](#aia---ai-assistant)
|
|
6
|
-
- [Key Features](#key-features)
|
|
7
|
-
- [🚀 Dynamic Prompt Management](#-dynamic-prompt-management)
|
|
8
|
-
- [🎭 Roles & 🎓 Skills](#-roles---skills)
|
|
9
|
-
- [🔧 Powerful Integration](#-powerful-integration)
|
|
10
|
-
- [💬 Interactive Chat Sessions](#-interactive-chat-sessions)
|
|
11
|
-
- [🎯 Advanced Features](#-advanced-features)
|
|
12
|
-
- [Quick Start](#quick-start)
|
|
13
|
-
- [Core Architecture](#core-architecture)
|
|
14
|
-
- [Component Overview](#component-overview)
|
|
15
|
-
- [Core Components](#core-components)
|
|
16
|
-
- [External Dependencies](#external-dependencies)
|
|
17
|
-
- [Documentation Structure](#documentation-structure)
|
|
18
|
-
- [Getting Started](#getting-started)
|
|
19
|
-
- [Guides](#guides)
|
|
20
|
-
- [Reference](#reference)
|
|
21
|
-
- [Community & Support](#community--support)
|
|
22
|
-
- [License](#license)
|
|
23
|
-
|
|
24
|
-
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
|
25
|
-
|
|
26
|
-
# AIA - AI Assistant
|
|
27
|
-
|
|
28
|
-
<table border="0">
|
|
29
|
-
<tr>
|
|
30
|
-
<td width="30%" valign="top">
|
|
31
|
-
<img src="assets/images/aia.png" alt="AIA - May I take your prompt?" width="200" />
|
|
32
|
-
<div align="center">
|
|
33
|
-
<strong>The Prompt is the Code</strong>
|
|
34
|
-
</div>
|
|
35
|
-
</td>
|
|
36
|
-
<td width="70%" valign="top">
|
|
37
|
-
|
|
38
|
-
Welcome to AIA, your powerful CLI tool for dynamic prompt management and AI interaction.
|
|
39
|
-
<br/><br/>
|
|
40
|
-
<strong>AIA (AI Assistant)</strong> is a Ruby-based command-line tool that revolutionizes how you interact with AI models. It's designed for generative AI workflows, enabling you to effortlessly manage AI prompts, integrate seamlessly with shell and embedded Ruby (ERB), run batch processes, and engage in interactive chats with user-defined directives, tools, and MCP clients.
|
|
41
|
-
</td>
|
|
42
|
-
</tr>
|
|
43
|
-
</table>
|
|
44
|
-
|
|
45
|
-
<div align="center">
|
|
46
|
-
AIA treats prompts as executable programs, complete with configuration, logic, and workflows.
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
!!! tip "🚀 New: AI Assistant Scheduler (AIAS)"
|
|
52
|
-
|
|
53
|
-
**Schedule and automate your AIA prompts!** AIAS is a new Ruby gem that lets you run AIA prompts on a cron-like schedule — perfect for recurring AI tasks, automated reports, and timed workflows.
|
|
54
|
-
|
|
55
|
-
**[View AIAS on GitHub →](https://github.com/madbomber/aias)**
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
!!! tip "🎭 Roles: Give Your Robot a Personality"
|
|
60
|
-
|
|
61
|
-
Roles are plain-text prompt files that define how your AI thinks, talks, and interacts with you. Drop one in `~/.prompts/roles/` and your robot instantly becomes someone new.
|
|
62
|
-
|
|
63
|
-
**For fun:**
|
|
64
|
-
```bash
|
|
65
|
-
aia --chat --role pirate # Arrr, matey!
|
|
66
|
-
aia --chat --role nyc_cabbie # opinions about EVERYTHING
|
|
67
|
-
aia --chat --role stoned_hacker # solves it anyway, dude
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
**For serious work:**
|
|
71
|
-
```bash
|
|
72
|
-
# Explains quantum physics to your 7-year-old
|
|
73
|
-
aia --chat --role first_grade_teacher
|
|
74
|
-
|
|
75
|
-
# Three expert robots on the same design doc, simultaneously
|
|
76
|
-
aia --model gpt-4o=architect,claude=security,gemini=performance design.md
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Assign a different role to each model and get multiple expert perspectives in one command. **[Full Roles Guide →](guides/models.md)**
|
|
80
|
-
|
|
81
|
-
!!! tip "🎓 Skills: Teach Your Robot Your Process"
|
|
82
|
-
|
|
83
|
-
Skills are structured instruction sets that tell your robot *exactly how* to approach a task — your workflow, your standards, every single time. Each skill is a directory with a `SKILL.md` file in `~/.prompts/skills/`.
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
aia -s code-quality my_prompt # one skill
|
|
87
|
-
aia -s code-quality,security-review my_prompt # stack them
|
|
88
|
-
aia --chat --role senior_dev -s code-quality # role + skill
|
|
89
|
-
/skill code-quality # add mid-chat
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Combine roles and skills: a pirate who follows your code review process, a first-grade teacher who uses your step-by-step explanation method, or multiple robots each with their own role and skill set — all from the command line. **[Full Skills Guide →](directives-reference.md)**
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Key Features
|
|
97
|
-
|
|
98
|
-
### 🚀 Dynamic Prompt Management
|
|
99
|
-
- **Hierarchical Configuration**: Embedded directives > CLI args > environment variables > config files > defaults
|
|
100
|
-
- **Prompt Sequences and Workflows**: Chain prompts together for complex AI workflows
|
|
101
|
-
- **Fuzzy Search**: Find prompts quickly with fuzzy matching (requires `fzf`)
|
|
102
|
-
|
|
103
|
-
### 🎭 Roles & 🎓 Skills
|
|
104
|
-
- **Robot Personalities**: Give any robot a voice — fun personas like a pirate or NYC cabbie, or professional ones like a senior architect or first-grade teacher
|
|
105
|
-
- **Per-Model Roles**: Assign a different role to each model in a multi-model session — `--model gpt-4o=architect,claude=security`
|
|
106
|
-
- **Reusable Skill Sets**: Encode your exact workflow once in a `SKILL.md` file; apply it to any prompt with `-s skill-name`
|
|
107
|
-
- **Role + Skill Combos**: A robot can be *who you want* (role) and *know exactly what to do* (skill) simultaneously
|
|
108
|
-
- **Mid-Chat Skills**: Add a skill to a running chat session with `/skill skill-name`
|
|
109
|
-
|
|
110
|
-
### 🔧 Powerful Integration
|
|
111
|
-
- **Shell Integration**: Execute shell commands directly within prompts
|
|
112
|
-
- **Ruby (ERB) Processing**: Use Ruby code in your prompts for dynamic content
|
|
113
|
-
- **RubyLLM::Tool Support**: Function callbacks for enhanced AI capabilities
|
|
114
|
-
- **MCP Client Support**: Integrate with Model Context Protocol clients
|
|
115
|
-
|
|
116
|
-
### 💬 Interactive Chat Sessions
|
|
117
|
-
- **Context Management**: Maintain conversation history and context
|
|
118
|
-
- **Multi-model Support**: Use multiple AI models simultaneously
|
|
119
|
-
- **Consensus Mode**: Get consensus responses from multiple models
|
|
120
|
-
- **Voice Support**: Convert text to speech and back
|
|
121
|
-
|
|
122
|
-
### 🎯 Advanced Features
|
|
123
|
-
- **Executable Prompts**: Run prompts as executable scripts
|
|
124
|
-
- **ERB Parameters**: Use embedded Ruby for dynamic prompt parameters
|
|
125
|
-
- **Image Generation**: Generate images with customizable parameters
|
|
126
|
-
- **Tool Integration**: Use custom Ruby tools for enhanced functionality
|
|
127
|
-
|
|
128
|
-
## Quick Start
|
|
129
|
-
|
|
130
|
-
1. **Install AIA:**
|
|
131
|
-
```bash
|
|
132
|
-
gem install aia
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
2. **Install dependencies:**
|
|
136
|
-
```bash
|
|
137
|
-
brew install fzf
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
3. **Create your first prompt:**
|
|
141
|
-
```bash
|
|
142
|
-
mkdir -p ~/.prompts
|
|
143
|
-
cat > ~/.prompts/what_is.md << 'EOF'
|
|
144
|
-
---
|
|
145
|
-
parameters:
|
|
146
|
-
topic: null
|
|
147
|
-
---
|
|
148
|
-
What is <%= topic %>?
|
|
149
|
-
EOF
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
4. **Run your prompt:**
|
|
153
|
-
```bash
|
|
154
|
-
aia what_is
|
|
155
|
-
```
|
|
156
|
-
You'll be prompted to enter a value for `topic`, then AIA will send your question to the AI model.
|
|
157
|
-
|
|
158
|
-
5. **Start an interactive chat:**
|
|
159
|
-
```bash
|
|
160
|
-
aia --chat
|
|
161
|
-
|
|
162
|
-
# Or use multiple models for comparison
|
|
163
|
-
aia --chat --model "gpt-4o-mini,gpt-3.5-turbo"
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
When AIA starts, you'll see the friendly robot mascot:
|
|
167
|
-
|
|
168
|
-
```plain
|
|
169
|
-
|
|
170
|
-
, ,
|
|
171
|
-
(\____/) AI Assistant (v1.0.0) is Online
|
|
172
|
-
(_oo_) ["gpt-4o-mini", "claude-sonnet-4-20250514"]
|
|
173
|
-
(O) using ruby_llm
|
|
174
|
-
__||__ \) model db was last refreshed on
|
|
175
|
-
[/______\] / 2026-02-04
|
|
176
|
-
/ \__AI__/ \/ You can share my tools
|
|
177
|
-
/ /__\
|
|
178
|
-
(\ /____\
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Core Architecture
|
|
183
|
-
|
|
184
|
-
AIA follows a modular Ruby gem structure with clear separation of concerns:
|
|
185
|
-
|
|
186
|
-
### Component Overview
|
|
187
|
-
|
|
188
|
-
```mermaid
|
|
189
|
-
graph TD
|
|
190
|
-
A[CLI Input] --> B[Config System]
|
|
191
|
-
B --> C[Prompt Handler]
|
|
192
|
-
C --> D[Directive Processor]
|
|
193
|
-
D --> E[Context Manager]
|
|
194
|
-
E --> F[RubyLLM Adapter]
|
|
195
|
-
F --> G[AI Models]
|
|
196
|
-
|
|
197
|
-
H[Prompt Files] --> C
|
|
198
|
-
I[Role Files] --> C
|
|
199
|
-
J[Tools] --> F
|
|
200
|
-
K[MCP Clients] --> F
|
|
201
|
-
|
|
202
|
-
C --> L[Chat Processor Service]
|
|
203
|
-
L --> M[UI Presenter]
|
|
204
|
-
M --> N[Terminal Output]
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### Core Components
|
|
208
|
-
|
|
209
|
-
- **AIA::Config** - Configuration management with hierarchical precedence
|
|
210
|
-
- **AIA::PromptHandler** - Main prompt processing orchestrator
|
|
211
|
-
- **AIA::ChatProcessorService** - Interactive chat session management
|
|
212
|
-
- **AIA::DirectiveProcessor** - Processes embedded directives (`/command params`)
|
|
213
|
-
- **AIA::RubyLLMAdapter** - Replaced in v2 by `RobotFactory` which builds `RobotLab::Robot` or `RobotLab::Network` instances powered by the `robot_lab` gem.
|
|
214
|
-
- **AIA::RobotFactory** - Builds `RobotLab::Robot` or `RobotLab::Network` instances; the primary AI execution backend in v2
|
|
215
|
-
- **AIA::ShellCommandExecutor** - Executes shell commands safely within prompts
|
|
216
|
-
- **AIA::HistoryManager** - Manages prompt parameter history and user input
|
|
217
|
-
- **AIA::UIPresenter** - Terminal output formatting and presentation
|
|
218
|
-
- **AIA::Session** - Manages chat sessions and state
|
|
219
|
-
- **AIA::Fzf** - Fuzzy finder integration for prompt selection
|
|
220
|
-
- **AIA::Directives::Checkpoint** - Manages conversation checkpoints, restore, clear, and review operations
|
|
221
|
-
|
|
222
|
-
### External Dependencies
|
|
223
|
-
|
|
224
|
-
- **prompt_manager gem** - Core prompt management functionality
|
|
225
|
-
- **robot_lab gem** - Robot/network execution engine (replaces direct ruby_llm usage in v2)
|
|
226
|
-
- **ruby_llm gem** - AI model interface layer (used internally by robot_lab)
|
|
227
|
-
- **fzf** - Command-line fuzzy finder (external CLI tool)
|
|
228
|
-
|
|
229
|
-
## Documentation Structure
|
|
230
|
-
|
|
231
|
-
### Getting Started
|
|
232
|
-
- [Installation](installation.md) - Get AIA up and running
|
|
233
|
-
- [Configuration](configuration.md) - Configure AIA for your needs
|
|
234
|
-
- [Getting Started Guide](guides/getting-started.md) - Your first steps with AIA
|
|
235
|
-
|
|
236
|
-
### Guides
|
|
237
|
-
- [Chat Mode](guides/chat.md) - Interactive conversations with AI
|
|
238
|
-
- [Working with Models](guides/models.md) - Multi-model support and configuration
|
|
239
|
-
- [Tools Integration](guides/tools.md) - Extend AIA with custom tools
|
|
240
|
-
- [Advanced Prompting](advanced-prompting.md) - Master complex prompt techniques
|
|
241
|
-
|
|
242
|
-
### Reference
|
|
243
|
-
- [CLI Parameters](cli-reference.md) - Complete command-line reference
|
|
244
|
-
- [Directives Reference](directives-reference.md) - All available directives
|
|
245
|
-
- [Examples](examples/index.md) - Practical examples and use cases
|
|
246
|
-
|
|
247
|
-
## Community & Support
|
|
248
|
-
|
|
249
|
-
- **GitHub**: [madbomber/aia](https://github.com/MadBomber/aia)
|
|
250
|
-
- **Issues**: [Report bugs and request features](https://github.com/MadBomber/aia/issues)
|
|
251
|
-
- **RubyGems**: [aia gem](https://rubygems.org/gems/aia)
|
|
252
|
-
|
|
253
|
-
## License
|
|
254
|
-
|
|
255
|
-
AIA is open source software. See the [LICENSE](https://github.com/MadBomber/aia/blob/main/LICENSE) file for details.
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
Ready to get started? Head to the [Installation](installation.md) guide to begin your AIA journey!
|
data/docs/installation.md
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
|
2
|
-
|
|
3
|
-
## Table of Contents
|
|
4
|
-
|
|
5
|
-
- [Installation](#installation)
|
|
6
|
-
- [Prerequisites](#prerequisites)
|
|
7
|
-
- [Required](#required)
|
|
8
|
-
- [Recommended](#recommended)
|
|
9
|
-
- [Installation Methods](#installation-methods)
|
|
10
|
-
- [Method 1: Install from RubyGems (Recommended)](#method-1-install-from-rubygems-recommended)
|
|
11
|
-
- [Method 2: Install from Source](#method-2-install-from-source)
|
|
12
|
-
- [Method 3: Using Bundler](#method-3-using-bundler)
|
|
13
|
-
- [Verify Installation](#verify-installation)
|
|
14
|
-
- [Initial Setup](#initial-setup)
|
|
15
|
-
- [1. Create Prompts Directory](#1-create-prompts-directory)
|
|
16
|
-
- [2. Create Configuration Directory](#2-create-configuration-directory)
|
|
17
|
-
- [3. Basic Configuration File (Optional)](#3-basic-configuration-file-optional)
|
|
18
|
-
- [4. Set Up API Keys](#4-set-up-api-keys)
|
|
19
|
-
- [OpenAI](#openai)
|
|
20
|
-
- [Anthropic Claude](#anthropic-claude)
|
|
21
|
-
- [Google Gemini](#google-gemini)
|
|
22
|
-
- [Ollama (Local models)](#ollama-local-models)
|
|
23
|
-
- [Optional Dependencies](#optional-dependencies)
|
|
24
|
-
- [Install fzf for Fuzzy Search](#install-fzf-for-fuzzy-search)
|
|
25
|
-
- [macOS (using Homebrew)](#macos-using-homebrew)
|
|
26
|
-
- [Ubuntu/Debian](#ubuntudebian)
|
|
27
|
-
- [Other systems](#other-systems)
|
|
28
|
-
- [Testing Your Installation](#testing-your-installation)
|
|
29
|
-
- [1. Check Available Models](#1-check-available-models)
|
|
30
|
-
- [2. Test Basic Functionality](#2-test-basic-functionality)
|
|
31
|
-
- [3. Test Chat Mode](#3-test-chat-mode)
|
|
32
|
-
- [Troubleshooting](#troubleshooting)
|
|
33
|
-
- [Common Issues](#common-issues)
|
|
34
|
-
- ["Command not found: aia"](#command-not-found-aia)
|
|
35
|
-
- ["No models available"](#no-models-available)
|
|
36
|
-
- ["fzf not found" warning](#fzf-not-found-warning)
|
|
37
|
-
- [Permission errors](#permission-errors)
|
|
38
|
-
- [Getting Help](#getting-help)
|
|
39
|
-
- [Next Steps](#next-steps)
|
|
40
|
-
- [Updating AIA](#updating-aia)
|
|
41
|
-
|
|
42
|
-
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
|
43
|
-
|
|
44
|
-
# Installation
|
|
45
|
-
|
|
46
|
-
This guide will help you install AIA and get it running on your system.
|
|
47
|
-
|
|
48
|
-
## Prerequisites
|
|
49
|
-
|
|
50
|
-
### Required
|
|
51
|
-
- **Ruby**: Version >= 4.0.0
|
|
52
|
-
- **RubyGems**: Usually comes with Ruby
|
|
53
|
-
|
|
54
|
-
### Recommended
|
|
55
|
-
- **fzf**: For fuzzy prompt searching
|
|
56
|
-
- **git**: For prompt management with version control
|
|
57
|
-
|
|
58
|
-
## Installation Methods
|
|
59
|
-
|
|
60
|
-
### Method 1: Install from RubyGems (Recommended)
|
|
61
|
-
|
|
62
|
-
The easiest way to install AIA is through RubyGems:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
gem install aia
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Method 2: Install from Source
|
|
69
|
-
|
|
70
|
-
If you want the latest development version:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
git clone https://github.com/MadBomber/aia.git
|
|
74
|
-
cd aia
|
|
75
|
-
bundle install
|
|
76
|
-
rake install
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Method 3: Using Bundler
|
|
80
|
-
|
|
81
|
-
Add to your Gemfile:
|
|
82
|
-
|
|
83
|
-
```ruby
|
|
84
|
-
gem 'aia'
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Then run:
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
bundle install
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Verify Installation
|
|
94
|
-
|
|
95
|
-
After installation, verify that AIA is working:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
aia --version
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
You should see the version number printed.
|
|
102
|
-
|
|
103
|
-
## Initial Setup
|
|
104
|
-
|
|
105
|
-
### 1. Create Prompts Directory
|
|
106
|
-
|
|
107
|
-
AIA stores prompts in a directory (default: `~/.prompts`). Create it:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
mkdir -p ~/.prompts
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### 2. Create Configuration Directory
|
|
114
|
-
|
|
115
|
-
Create the configuration directory (following XDG Base Directory Specification):
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
mkdir -p ~/.config/aia
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 3. Basic Configuration File (Optional)
|
|
122
|
-
|
|
123
|
-
Create a basic configuration file at `~/.config/aia/aia.yml`:
|
|
124
|
-
|
|
125
|
-
```yaml
|
|
126
|
-
# Basic AIA configuration
|
|
127
|
-
# Uses nested structure - see docs/configuration.md for full reference
|
|
128
|
-
|
|
129
|
-
llm:
|
|
130
|
-
temperature: 0.7
|
|
131
|
-
|
|
132
|
-
models:
|
|
133
|
-
- name: gpt-4o-mini
|
|
134
|
-
|
|
135
|
-
prompts:
|
|
136
|
-
dir: ~/.prompts
|
|
137
|
-
|
|
138
|
-
flags:
|
|
139
|
-
verbose: false
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### 4. Set Up API Keys
|
|
143
|
-
|
|
144
|
-
AIA uses the RubyLLM gem, which supports multiple AI providers. Set up your API keys as environment variables:
|
|
145
|
-
|
|
146
|
-
#### OpenAI
|
|
147
|
-
```bash
|
|
148
|
-
export OPENAI_API_KEY="your_openai_api_key_here"
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
#### Anthropic Claude
|
|
152
|
-
```bash
|
|
153
|
-
export ANTHROPIC_API_KEY="your_anthropic_api_key_here"
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
#### Google Gemini
|
|
157
|
-
```bash
|
|
158
|
-
export GOOGLE_API_KEY="your_google_api_key_here"
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
#### Ollama (Local models)
|
|
162
|
-
```bash
|
|
163
|
-
export OLLAMA_URL="http://localhost:11434"
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Add these to your shell profile (`.bashrc`, `.zshrc`, etc.) to make them permanent.
|
|
167
|
-
|
|
168
|
-
## Optional Dependencies
|
|
169
|
-
|
|
170
|
-
### Install fzf for Fuzzy Search
|
|
171
|
-
|
|
172
|
-
AIA supports fuzzy searching for prompts using `fzf`. Install it:
|
|
173
|
-
|
|
174
|
-
#### macOS (using Homebrew)
|
|
175
|
-
```bash
|
|
176
|
-
brew install fzf
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
#### Ubuntu/Debian
|
|
180
|
-
```bash
|
|
181
|
-
apt-get install fzf
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
#### Other systems
|
|
185
|
-
See the [fzf installation guide](https://github.com/junegunn/fzf#installation).
|
|
186
|
-
|
|
187
|
-
## Testing Your Installation
|
|
188
|
-
|
|
189
|
-
### 1. Check Available Models
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
aia --available-models
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
This will show all available AI models.
|
|
196
|
-
|
|
197
|
-
### 2. Test Basic Functionality
|
|
198
|
-
|
|
199
|
-
Create a simple prompt file:
|
|
200
|
-
|
|
201
|
-
```bash
|
|
202
|
-
echo "Hello, what can you help me with today?" > ~/.prompts/hello.md
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Run it:
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
aia hello
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### 3. Test Chat Mode
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
aia --chat
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
This should start an interactive chat session.
|
|
218
|
-
|
|
219
|
-
## Troubleshooting
|
|
220
|
-
|
|
221
|
-
### Common Issues
|
|
222
|
-
|
|
223
|
-
#### "Command not found: aia"
|
|
224
|
-
- Make sure Ruby's bin directory is in your PATH
|
|
225
|
-
- Try reinstalling: `gem uninstall aia && gem install aia`
|
|
226
|
-
|
|
227
|
-
#### "No models available"
|
|
228
|
-
- Check that your API keys are set correctly
|
|
229
|
-
- Verify your internet connection
|
|
230
|
-
- Try: `aia --available-models` to diagnose
|
|
231
|
-
|
|
232
|
-
#### "fzf not found" warning
|
|
233
|
-
- Install fzf as described above
|
|
234
|
-
- Or disable fuzzy search: `aia --no-fuzzy`
|
|
235
|
-
|
|
236
|
-
#### Permission errors
|
|
237
|
-
- Try installing with: `gem install aia --user-install`
|
|
238
|
-
- Or use `sudo` (not recommended): `sudo gem install aia`
|
|
239
|
-
|
|
240
|
-
### Getting Help
|
|
241
|
-
|
|
242
|
-
If you encounter issues:
|
|
243
|
-
|
|
244
|
-
1. Check the [FAQ](faq.md)
|
|
245
|
-
2. Search existing [GitHub issues](https://github.com/MadBomber/aia/issues)
|
|
246
|
-
3. Create a new issue with:
|
|
247
|
-
- Your OS and Ruby version
|
|
248
|
-
- The exact error message
|
|
249
|
-
- Steps to reproduce
|
|
250
|
-
|
|
251
|
-
## Next Steps
|
|
252
|
-
|
|
253
|
-
Once AIA is installed:
|
|
254
|
-
|
|
255
|
-
1. Read the [Configuration Guide](configuration.md)
|
|
256
|
-
2. Follow the [Getting Started Guide](guides/getting-started.md)
|
|
257
|
-
3. Explore [Examples](examples/index.md)
|
|
258
|
-
|
|
259
|
-
## Updating AIA
|
|
260
|
-
|
|
261
|
-
To update to the latest version:
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
gem update aia
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
Or if installed from source:
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
cd path/to/aia
|
|
271
|
-
git pull
|
|
272
|
-
bundle install
|
|
273
|
-
rake install
|
|
274
|
-
```
|