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/examples/README.md
DELETED
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
# AIA Examples — Batch Mode
|
|
2
|
-
|
|
3
|
-
These demo scripts progressively illustrate AIA's batch mode capabilities. Each script is self-contained and builds on concepts from earlier demos.
|
|
4
|
-
|
|
5
|
-
## Prerequisites
|
|
6
|
-
|
|
7
|
-
- AIA installed (`gem install aia`)
|
|
8
|
-
- Ollama installed and running (`ollama serve`)
|
|
9
|
-
- Run the setup script first:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
cd examples
|
|
13
|
-
bash 00_setup_aia.sh
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
The setup script pulls the `qwen3` model and writes `aia_config.yml`, which all demos use via the `-c` flag for isolated, reproducible runs.
|
|
17
|
-
|
|
18
|
-
### Using Your Own API Keys and Models
|
|
19
|
-
|
|
20
|
-
These demos default to Ollama with the `qwen3` model so they run locally with no API keys required. However, local models can be slow depending on your hardware — some demos may take a while to complete.
|
|
21
|
-
|
|
22
|
-
For a faster experience, consider using a cloud provider's least expensive tool-capable model. Both `gpt-4o-mini` (OpenAI) and `claude-haiku-4-5` (Anthropic) are inexpensive, fast, support tool use, and will run these demos for pennies. You can easily change the setup to use any provider and model available through the [ruby_llm](https://rubyllm.com) gem. AIA supports OpenAI, Anthropic, Google Gemini, DeepSeek, Mistral, Perplexity, OpenRouter, AWS Bedrock, and local providers like Ollama and LM Studio.
|
|
23
|
-
|
|
24
|
-
To switch providers, edit `aia_config.yml` and change the model name:
|
|
25
|
-
|
|
26
|
-
```yaml
|
|
27
|
-
models:
|
|
28
|
-
- name: gpt-4o-mini # OpenAI — fast and cheap
|
|
29
|
-
- name: claude-haiku-4-5 # Anthropic — fast and cheap
|
|
30
|
-
- name: gemini-2.0-flash # Google
|
|
31
|
-
- name: ollama/qwen3 # Ollama (local, no API key needed)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Set the corresponding API key as an environment variable (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`). See the [RubyLLM configuration guide](https://rubyllm.com/configuration) for the full list of supported providers and their settings.
|
|
35
|
-
|
|
36
|
-
## Demo Scripts
|
|
37
|
-
|
|
38
|
-
### 00 — Setup
|
|
39
|
-
|
|
40
|
-
`00_setup_aia.sh` — Verifies that `aia` and `ollama` are installed, pulls the `qwen3` model, creates the `prompts_dir/` directory, and writes `aia_config.yml`. Run this once before any other demo.
|
|
41
|
-
|
|
42
|
-
Docs: [Getting Started](https://madbomber.github.io/aia/guides/getting-started/), [Installation](https://madbomber.github.io/aia/installation/), [Local Models](https://madbomber.github.io/aia/guides/local-models/)
|
|
43
|
-
|
|
44
|
-
### 01 — Basic Usage
|
|
45
|
-
|
|
46
|
-
`01_basic_usage.sh` — The simplest case: send a prompt file to a model and print the response. Demonstrates the `-c` config flag and `--no-output` to suppress file output.
|
|
47
|
-
|
|
48
|
-
Docs: [Basic Usage](https://madbomber.github.io/aia/guides/basic-usage/), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
49
|
-
|
|
50
|
-
### 02 — YAML Front Matter
|
|
51
|
-
|
|
52
|
-
`02_frontmatter.sh` — Shows how YAML front matter between `---` delimiters can embed configuration directly in a prompt file. Demonstrates the `temperature` shorthand to make responses more creative.
|
|
53
|
-
|
|
54
|
-
**Supported front matter keys:** `model`, `temperature`, `top_p`, `next`, `pipeline`, `shell`, `erb`
|
|
55
|
-
|
|
56
|
-
Docs: [Configuration](https://madbomber.github.io/aia/configuration/), [Prompt Management](https://madbomber.github.io/aia/prompt_management/)
|
|
57
|
-
|
|
58
|
-
### 03 — Shell Integration
|
|
59
|
-
|
|
60
|
-
`03_shell_integration.sh` — Demonstrates `$(command)` and `$ENVAR` expansion in prompts. Part 1 shows shell expansion on (default); Part 2 uses `shell: false` in front matter to pass the raw `$(...)` text through to the model.
|
|
61
|
-
|
|
62
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/), [Configuration](https://madbomber.github.io/aia/configuration/)
|
|
63
|
-
|
|
64
|
-
### 04 — ERB Templating
|
|
65
|
-
|
|
66
|
-
`04_erb_templating.sh` — Demonstrates `<%= expression %>` ERB tags in prompts. Part 1 shows ERB evaluation on (default); Part 2 uses `erb: false` in front matter to send the literal ERB tags to the model.
|
|
67
|
-
|
|
68
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/), [Configuration](https://madbomber.github.io/aia/configuration/)
|
|
69
|
-
|
|
70
|
-
### 05 — Shell Then ERB
|
|
71
|
-
|
|
72
|
-
`05_shell_then_erb.sh` — Demonstrates that shell expansion runs before ERB processing. Shell output becomes part of the Ruby expression that ERB evaluates. For example, `<%= "$(uname -s)".downcase %>` first expands to `<%= "Darwin".downcase %>`, then ERB produces `darwin`.
|
|
73
|
-
|
|
74
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/)
|
|
75
|
-
|
|
76
|
-
### 06 — Prompt Chaining
|
|
77
|
-
|
|
78
|
-
`06_prompt_chaining.sh` — Chains two prompts so the output of the first becomes context for the second. Part 1 uses the `--next` CLI flag; Part 2 uses the `next:` front matter key. Both produce the same result.
|
|
79
|
-
|
|
80
|
-
Docs: [Workflows and Pipelines](https://madbomber.github.io/aia/workflows-and-pipelines/), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
81
|
-
|
|
82
|
-
### 07 — Pipeline
|
|
83
|
-
|
|
84
|
-
`07_pipeline.sh` — Runs a four-step pipeline where each prompt refines the previous response: brainstorm names, evaluate them, pick the best, write a tagline. Uses `--pipeline` with comma-separated prompt IDs. Notes that the same chain can be defined via `pipeline:` in front matter.
|
|
85
|
-
|
|
86
|
-
Docs: [Workflows and Pipelines](https://madbomber.github.io/aia/workflows-and-pipelines/), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
87
|
-
|
|
88
|
-
### 08 — Context Files
|
|
89
|
-
|
|
90
|
-
`08_context_files.sh` — Attaches external file contents to a prompt using positional arguments after the prompt ID. The model receives both the prompt and the file contents, allowing it to reference them in its response.
|
|
91
|
-
|
|
92
|
-
Docs: [Basic Usage](https://madbomber.github.io/aia/guides/basic-usage/), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
93
|
-
|
|
94
|
-
### 09 — Roles
|
|
95
|
-
|
|
96
|
-
`09_roles.sh` — Demonstrates `--role` to prepend a reusable system prompt. Role files live in `prompts_dir/roles/` as `.md` files. Runs the same prompt three ways: no role (baseline), `--role pirate`, and `--role formal`, showing how roles change the response style.
|
|
97
|
-
|
|
98
|
-
Docs: [Working with Models — Per-Model Roles](https://madbomber.github.io/aia/guides/models/#per-model-roles), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
99
|
-
|
|
100
|
-
### 10 — STDIN Piping
|
|
101
|
-
|
|
102
|
-
`10_stdin_piping.sh` — Pipes text into AIA via STDIN. The piped content is appended to the prompt. Part 1 pipes a string with `echo`; Part 2 pipes the output of `ls -la`.
|
|
103
|
-
|
|
104
|
-
Docs: [Executable Prompts — Piping and Redirection](https://madbomber.github.io/aia/guides/executable-prompts/#piping-and-redirection), [Basic Usage](https://madbomber.github.io/aia/guides/basic-usage/)
|
|
105
|
-
|
|
106
|
-
### 11 — Multiple Models
|
|
107
|
-
|
|
108
|
-
`11_multi_model.sh` — Sends the same prompt to two models simultaneously using `-m model1,model2`. Part 1 shows **comparison mode** (default) where both responses are displayed side by side. Part 2 shows **cooperative mode** (`--consensus`) where the first model synthesizes a unified answer from both responses.
|
|
109
|
-
|
|
110
|
-
**Requires:** A second Ollama model (`phi4-mini`), auto-pulled if missing.
|
|
111
|
-
|
|
112
|
-
Docs: [Working with Models — Multi-Model Operations](https://madbomber.github.io/aia/guides/models/#multi-model-operations), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
113
|
-
|
|
114
|
-
### 12 — Token Usage
|
|
115
|
-
|
|
116
|
-
`12_token_usage.sh` — Demonstrates the `--tokens` flag, which displays input/output token counts after each response. Part 1 shows single-model usage; Part 2 shows a multi-model comparison table.
|
|
117
|
-
|
|
118
|
-
Docs: [Working with Models — Token Usage and Cost Tracking](https://madbomber.github.io/aia/guides/models/#token-usage-and-cost-tracking), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
119
|
-
|
|
120
|
-
### 13 — Cost Tracking
|
|
121
|
-
|
|
122
|
-
`13_cost_tracking.sh` — Demonstrates the `--cost` flag, which adds per-model cost estimates to the token usage table. Uses `gpt-4o-mini` (OpenAI) and `claude-haiku-4-5` (Anthropic) for a cross-provider cost comparison. `--cost` implies `--tokens`.
|
|
123
|
-
|
|
124
|
-
**Requires:** `OPENAI_API_KEY` and `ANTHROPIC_API_KEY` environment variables.
|
|
125
|
-
|
|
126
|
-
Docs: [Working with Models — Token Usage and Cost Tracking](https://madbomber.github.io/aia/guides/models/#token-usage-and-cost-tracking), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
127
|
-
|
|
128
|
-
### 14 — Output to File
|
|
129
|
-
|
|
130
|
-
`14_output_file.sh` — Demonstrates the `-o` flag for saving responses to a file. Part 1 writes to a file; Part 2 shows the default overwrite behavior; Part 3 uses `--append` to accumulate multiple responses in the same file.
|
|
131
|
-
|
|
132
|
-
Docs: [Basic Usage — Output Management](https://madbomber.github.io/aia/guides/basic-usage/#3-output-management), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
133
|
-
|
|
134
|
-
### 15 — Parameters
|
|
135
|
-
|
|
136
|
-
`15_parameters.sh` — Demonstrates prompt parameters defined in YAML front matter. Parameters create reusable templates with `<%= name %>` placeholders filled at runtime. Part 1 uses a prompt where all parameters have defaults (runs automatically). Part 2 has a required parameter (null default) that AIA prompts the user to enter interactively.
|
|
137
|
-
|
|
138
|
-
Docs: [Prompt Management](https://madbomber.github.io/aia/prompt_management/), [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/)
|
|
139
|
-
|
|
140
|
-
### 16 — Directives
|
|
141
|
-
|
|
142
|
-
`16_directives.sh` — Lists all available directives and demonstrates two features. Part 1 uses the `include` directive, which inserts and renders another prompt file at render time via `<%= include 'path/to/file' %>`. Part 2 shows how to create a custom directive: a Ruby class inheriting from `AIA::Directive` with `desc`-annotated methods. The custom `timestamp` directive is loaded via `--tools` and used in a prompt with `<%= timestamp %>`.
|
|
143
|
-
|
|
144
|
-
Docs: [Directives Reference](https://madbomber.github.io/aia/directives-reference/), [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/)
|
|
145
|
-
|
|
146
|
-
### 17 — Require and Conditionals
|
|
147
|
-
|
|
148
|
-
`17_require_and_conditionals.sh` — Two ERB power features. Part 1 uses `--rq json` to load the `json` gem so `JSON.pretty_generate` works inside ERB tags. Part 2 uses `<% if %>` / `<% elsif %>` / `<% else %>` control flow with a parameter to conditionally include different prompt sections based on the audience.
|
|
149
|
-
|
|
150
|
-
Docs: [Advanced Prompting — Conditional Execution](https://madbomber.github.io/aia/advanced-prompting/#conditional-execution), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
151
|
-
|
|
152
|
-
### 18 — Tools via --require
|
|
153
|
-
|
|
154
|
-
`18_tools.sh` — Loads `RubyLLM::Tool` subclasses from the `shared_tools` gem via `--rq shared_tools`. AIA discovers tools automatically and registers them for the model to call. The prompt asks three questions that require calling `current_date_time`, `system_info`, and `dns` tools.
|
|
155
|
-
|
|
156
|
-
**Requires:** `gem install shared_tools`
|
|
157
|
-
|
|
158
|
-
Docs: [Shared Tools](https://madbomber.github.io/aia/guides/shared-tools/), [Tools Integration](https://madbomber.github.io/aia/guides/tools/)
|
|
159
|
-
|
|
160
|
-
### 19 — Local Tools
|
|
161
|
-
|
|
162
|
-
`19_local_tools.sh` — Loads a local `RubyLLM::Tool` from a `.rb` file using `--tools tools/word_count_tool.rb`. Shows the full tool pattern: class definition, description, parameters, and execute method. The model calls the tool to analyze a text passage.
|
|
163
|
-
|
|
164
|
-
Docs: [Tools Integration — Creating Custom Tools](https://madbomber.github.io/aia/guides/tools/#creating-custom-tools), [CLI Reference](https://madbomber.github.io/aia/cli-reference/)
|
|
165
|
-
|
|
166
|
-
### 20 — MCP Servers
|
|
167
|
-
|
|
168
|
-
`20_mcp_servers.sh` — Demonstrates MCP (Model Context Protocol) server integration. Part 1 loads an MCP server from a JSON file via `--mcp mcp/filesystem.json` (Claude Desktop format). Part 2 uses `aia_config_with_mcp.yml` where the MCP server is defined in YAML within the config file itself.
|
|
169
|
-
|
|
170
|
-
**Requires:** Node.js / `npx` (for the `@modelcontextprotocol/server-filesystem` server).
|
|
171
|
-
|
|
172
|
-
Docs: [MCP Integration](https://madbomber.github.io/aia/mcp-integration/), [Configuration — MCP Server Configuration](https://madbomber.github.io/aia/configuration/#mcp-server-configuration)
|
|
173
|
-
|
|
174
|
-
### 21 — Executable Prompts
|
|
175
|
-
|
|
176
|
-
`21_executable_prompts.sh` — Demonstrates prompt files with a shebang line (`#!/usr/bin/env aia ...`) that can be run directly from the command line. AIA auto-detects the shebang and strips it before processing. Part 1 runs a minimal executable prompt directly. Part 2 runs an executable prompt that combines front matter, ERB, and shell expansion. Part 3 pipes a prompt file (shebang included) to AIA via STDIN, showing that the shebang is stripped automatically from piped input too.
|
|
177
|
-
|
|
178
|
-
Docs: [Executable Prompts](https://madbomber.github.io/aia/guides/executable-prompts/)
|
|
179
|
-
|
|
180
|
-
### 22 — Chat Mode
|
|
181
|
-
|
|
182
|
-
`22_chat_mode.sh` — Demonstrates interactive chat mode via the `--chat` flag. Uses `expect` to script the interactive sessions. Part 1 opens a pure chat with no initial prompt. Part 2 processes a prompt in batch mode first, then enters chat with that context in the conversation history. Part 3 runs a full pipeline (brainstorm, evaluate, pick best) to completion, then enters chat for follow-up questions about the results. Part 4 shows chat-mode directives like `/help`. The key takeaway: all batch processing completes before the chat session begins, and the model retains full context from the batch phase.
|
|
183
|
-
|
|
184
|
-
**Requires:** `expect` (pre-installed on macOS).
|
|
185
|
-
|
|
186
|
-
Docs: [Chat Guide](https://madbomber.github.io/aia/guides/chat/), [Directives Reference](https://madbomber.github.io/aia/directives-reference/), [Workflows and Pipelines](https://madbomber.github.io/aia/workflows-and-pipelines/)
|
|
187
|
-
|
|
188
|
-
### 23 — Verify Mode
|
|
189
|
-
|
|
190
|
-
`23_verify.sh` — Demonstrates `/verify` mode via `VerificationNetwork`. Two robots independently answer the same question with slightly different system prompts, then a third reconciler robot compares both answers and produces a final verified response. Part 1 verifies a factual question (causes of the 2008 financial crisis); Part 2 verifies a technical explanation (TCP three-way handshake).
|
|
191
|
-
|
|
192
|
-
**Requires:** `expect` (pre-installed on macOS).
|
|
193
|
-
|
|
194
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/), [Chat Guide](https://madbomber.github.io/aia/guides/chat/)
|
|
195
|
-
|
|
196
|
-
### 24 — Decompose Mode
|
|
197
|
-
|
|
198
|
-
`24_decompose.sh` — Demonstrates `/decompose` mode via `PromptDecomposer`. A coordinator robot analyzes whether a prompt can be split into 2–5 independent sub-tasks. If decomposable, specialist robots run each in parallel and results are synthesized into a single coherent response. Falls back to normal mode if the prompt is not decomposable. Part 1 uses a complex multi-part TCP/UDP question; Part 2 demonstrates the fallback with a simple question.
|
|
199
|
-
|
|
200
|
-
**Requires:** `expect` (pre-installed on macOS).
|
|
201
|
-
|
|
202
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/), [Chat Guide](https://madbomber.github.io/aia/guides/chat/)
|
|
203
|
-
|
|
204
|
-
### 25 — Spawn Mode
|
|
205
|
-
|
|
206
|
-
`25_spawn.sh` — Demonstrates `/spawn` mode via `SpawnHandler`. Dynamically creates a specialist robot on demand. Part 1 explicitly names a specialist type (`/spawn security-expert`) and asks a SQL injection question. Part 2 uses auto-detection (`/spawn` with no args) where the primary robot determines the needed expertise from the question content. Specialists are cached and reused within the session.
|
|
207
|
-
|
|
208
|
-
**Requires:** `expect` (pre-installed on macOS).
|
|
209
|
-
|
|
210
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/), [Chat Guide](https://madbomber.github.io/aia/guides/chat/)
|
|
211
|
-
|
|
212
|
-
### 26 — Debate Mode
|
|
213
|
-
|
|
214
|
-
`26_debate.sh` — Demonstrates `/debate` mode via `DebateHandler`. Two robots debate a topic across multiple rounds. Each round, every robot sees what the other said and responds. The debate ends when a robot says CONVERGED or after 5 rounds. `SimilarityScorer` also detects convergence by comparing round-to-round similarity. Uses `qwen3` (Tobor) vs `phi4-mini` (Quark) debating REST vs GraphQL.
|
|
215
|
-
|
|
216
|
-
**Requires:** `expect` (pre-installed on macOS), `phi4-mini` model (auto-pulled if missing).
|
|
217
|
-
|
|
218
|
-
Docs: [Advanced Prompting](https://madbomber.github.io/aia/advanced-prompting/), [Working with Models](https://madbomber.github.io/aia/guides/models/)
|
|
219
|
-
|
|
220
|
-
### 27 — @mention Routing
|
|
221
|
-
|
|
222
|
-
`27_mention_routing.sh` — Demonstrates `@mention` routing in a multi-model network. Prefixing a message with `@RobotName` directs it to a specific robot; only that robot responds. Robot names are assigned by AIA: `qwen3` becomes `Tobor`, `phi4-mini` becomes `Quark`. Part 1 routes to `@Tobor`; Part 2 routes to `@Quark`; Part 3 shows how an unknown `@mention` triggers a listing of available robot names. Part 4 opens interactive chat to mix directed and undirected turns freely.
|
|
223
|
-
|
|
224
|
-
**Requires:** `expect` (pre-installed on macOS), `phi4-mini` model (auto-pulled if missing).
|
|
225
|
-
|
|
226
|
-
Docs: [Chat Guide](https://madbomber.github.io/aia/guides/chat/), [Working with Models](https://madbomber.github.io/aia/guides/models/)
|
|
227
|
-
|
|
228
|
-
### 28 — Model Switching
|
|
229
|
-
|
|
230
|
-
`28_model_switching.sh` — Demonstrates the `/model` directive for switching models mid-conversation. Conversation history is transferred to the new model so it has full context of everything discussed before the switch. Part 1 asks a question with `qwen3` (Tobor), switches to `phi4-mini` (Quark) via `/model ollama/phi4-mini`, then asks a follow-up that requires the previous exchange for context.
|
|
231
|
-
|
|
232
|
-
**Requires:** `expect` (pre-installed on macOS), `phi4-mini` model (auto-pulled if missing).
|
|
233
|
-
|
|
234
|
-
Docs: [Chat Guide](https://madbomber.github.io/aia/guides/chat/), [Working with Models](https://madbomber.github.io/aia/guides/models/)
|
|
235
|
-
|
|
236
|
-
### 29 — Agent Harness
|
|
237
|
-
|
|
238
|
-
`29_agent_harness.sh` — Demonstrates AIA as a full agent harness using a three-tier orchestration model. Tobor starts with an `orchestrator` role loaded via `--role orchestrator`, making it the primary coordinator. Part 1 shows Tobor describing its coordination strategy for a complex request. Part 2 uses `/spawn security-expert` to create a specialist lead agent on demand and route a task to it. Part 3 uses `/decompose` with a multi-dimension design review — Tobor and Quark run parallel workstreams as task runners, then Tobor synthesizes the result. Part 4 opens a free orchestration session where any combination of `/spawn`, `/decompose`, `/delegate`, `/debate`, and `@mention` routing can be tried.
|
|
239
|
-
|
|
240
|
-
The orchestrator role file lives at `examples/prompts_dir/roles/orchestrator.md` and can be customized to tune Tobor's coordination behavior.
|
|
241
|
-
|
|
242
|
-
**Requires:** `expect` (pre-installed on macOS), `phi4-mini` model (auto-pulled if missing).
|
|
243
|
-
|
|
244
|
-
Docs: [Chat Guide](https://madbomber.github.io/aia/guides/chat/), [Roles](https://madbomber.github.io/aia/guides/roles/)
|
|
245
|
-
|
|
246
|
-
## Running All Demos
|
|
247
|
-
|
|
248
|
-
`run_all.sh` runs all non-interactive demo scripts in sequence and captures the combined output. It serves as a structural integration test — since LLM responses are non-deterministic, exact diffs between runs won't match, but you can spot missing sections, crashes, or changed command output.
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
cd examples
|
|
252
|
-
|
|
253
|
-
# Run all demos and save output to a timestamped log
|
|
254
|
-
bash run_all.sh
|
|
255
|
-
|
|
256
|
-
# Print to terminal only (no log file)
|
|
257
|
-
bash run_all.sh --no-save
|
|
258
|
-
|
|
259
|
-
# Save to your own file with tee
|
|
260
|
-
bash run_all.sh --no-save 2>&1 | tee my_run.log
|
|
261
|
-
|
|
262
|
-
# Show help
|
|
263
|
-
bash run_all.sh --help
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
Output logs are saved to `examples/output/run_YYYYMMDD_HHMMSS.log`. Compare runs with:
|
|
267
|
-
|
|
268
|
-
```bash
|
|
269
|
-
diff output/run_PREV.log output/run_LATEST.log
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
**What it runs:** Scripts 01-14, 16-19, and 21 (18 scripts total).
|
|
273
|
-
|
|
274
|
-
**What it skips:**
|
|
275
|
-
|
|
276
|
-
| Script | Reason |
|
|
277
|
-
|--------|--------|
|
|
278
|
-
| `00_setup_aia.sh` | Run manually first (pulls models, writes config) |
|
|
279
|
-
| `15_parameters.sh` | Part 2 prompts interactively for a required parameter |
|
|
280
|
-
| `20_mcp_servers.sh` | Requires Node.js/npx + MCP filesystem server |
|
|
281
|
-
| `22_chat_mode.sh` | Interactive chat session (uses `expect`) |
|
|
282
|
-
| `23_verify.sh` | Uses `expect` for interactive chat |
|
|
283
|
-
| `24_decompose.sh` | Uses `expect` for interactive chat |
|
|
284
|
-
| `25_spawn.sh` | Uses `expect` for interactive chat |
|
|
285
|
-
| `26_debate.sh` | Uses `expect` for interactive chat |
|
|
286
|
-
| `27_mention_routing.sh` | Uses `expect` for interactive chat |
|
|
287
|
-
| `28_model_switching.sh` | Uses `expect` for interactive chat |
|
|
288
|
-
| `29_agent_harness.sh` | Uses `expect` for interactive chat; Part 4 is fully interactive |
|
|
289
|
-
|
|
290
|
-
The output includes a banner with version info, per-script pass/fail status, and a summary with counts.
|
|
291
|
-
|
|
292
|
-
## Directory Structure
|
|
293
|
-
|
|
294
|
-
```
|
|
295
|
-
examples/
|
|
296
|
-
common.sh # Shared setup sourced by all demos
|
|
297
|
-
run_all.sh # Batch runner for non-interactive demos
|
|
298
|
-
aia_config.yml # Generated by 00_setup_aia.sh
|
|
299
|
-
aia_config_with_mcp.yml # Config with MCP server (demo 20)
|
|
300
|
-
prompts_dir/ # All demo prompt files
|
|
301
|
-
roles/ # Role files (demo 09)
|
|
302
|
-
includes/ # Includable files (demo 16)
|
|
303
|
-
context/ # Context files (demo 08)
|
|
304
|
-
directives/ # Custom directive files (demo 16)
|
|
305
|
-
tools/ # Local tool files (demo 19)
|
|
306
|
-
mcp/ # MCP server configs (demo 20)
|
|
307
|
-
output/ # Timestamped run logs (git-ignored)
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
## Notes
|
|
311
|
-
|
|
312
|
-
- All demos use `-c aia_config.yml` to isolate from your personal AIA configuration. The `-c` flag replaces your user config with bundled defaults plus the specified file.
|
|
313
|
-
- `common.sh` clears all `AIA_*` environment variables to prevent leakage from your shell.
|
|
314
|
-
- Demos 11-12 require a second Ollama model (`phi4-mini`), which is auto-pulled.
|
|
315
|
-
- Demo 13 requires cloud API keys for OpenAI and Anthropic.
|
|
316
|
-
- Demo 18 requires the `shared_tools` gem.
|
|
317
|
-
- Demo 20 requires Node.js for the MCP filesystem server.
|
|
318
|
-
|
|
319
|
-
## Full Documentation
|
|
320
|
-
|
|
321
|
-
For complete AIA documentation, visit the [AIA documentation site](https://madbomber.github.io/aia/).
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Advanced Multi-Robot Capabilities Without Examples
|
|
2
|
-
|
|
3
|
-
AIA v2 includes several advanced multi-robot execution modes that have no demo
|
|
4
|
-
scripts yet. These are currently accessible only through chat-time directives
|
|
5
|
-
(`/verify`, `/debate`, etc.) inside a `--chat` session, but the underlying
|
|
6
|
-
handlers are self-contained and could equally be exposed via CLI flags, YAML
|
|
7
|
-
front matter, or `//` prompt-file directives in batch mode.
|
|
8
|
-
|
|
9
|
-
## Already Covered
|
|
10
|
-
|
|
11
|
-
`11_multi_model.sh` covers:
|
|
12
|
-
- Multi-model comparison mode (`-m modelA,modelB`)
|
|
13
|
-
- `--consensus` cooperative synthesis
|
|
14
|
-
|
|
15
|
-
## Missing Demos
|
|
16
|
-
|
|
17
|
-
| Feature | Handler | Min models | Current entry point |
|
|
18
|
-
|---|---|---|---|
|
|
19
|
-
| `/verify` self-review | `VerificationNetwork` | 1 | `/verify` in chat |
|
|
20
|
-
| `/decompose` parallel tasks | `PromptDecomposer` | 1 | `/decompose` in chat |
|
|
21
|
-
| `/spawn` specialist robots | `SpawnHandler` | 1 | `/spawn [type]` in chat |
|
|
22
|
-
| `/debate` multi-round | `DebateHandler` | 2 | `/debate` in chat |
|
|
23
|
-
| `@mention` routing | `MentionRouter` | 2 | `@robot_name question` in chat |
|
|
24
|
-
| Natural language model switch | `ModelSwitchHandler` | 1 | "switch to X" in chat |
|
|
25
|
-
| `/delegate` TrakFlow teams | `DelegateHandler` | 2 | `/delegate` in chat |
|
|
26
|
-
|
|
27
|
-
## Feature Details
|
|
28
|
-
|
|
29
|
-
### `/verify` Self-Review (`lib/aia/verification_network.rb`)
|
|
30
|
-
- Two robots independently answer the same question with slightly different system
|
|
31
|
-
prompts to encourage independence, then a third "reconciler" robot compares both
|
|
32
|
-
answers, identifies agreements and disagreements, and produces a final verified
|
|
33
|
-
answer.
|
|
34
|
-
- All three robots use the same model (`config.models.first`) — no second model needed.
|
|
35
|
-
- Batch-capable: the handler takes a prompt string and returns a response with no
|
|
36
|
-
interactive steps. Could be exposed as `--verify` CLI flag or `mode: verify`
|
|
37
|
-
front matter.
|
|
38
|
-
|
|
39
|
-
### `/decompose` Parallel Tasks (`lib/aia/prompt_decomposer.rb`)
|
|
40
|
-
- A coordinator robot analyzes whether a complex prompt can be split into 2-5
|
|
41
|
-
independent sub-tasks. If decomposable, specialist robots solve each in parallel
|
|
42
|
-
and results are synthesized into a unified answer. Falls back to normal mode if
|
|
43
|
-
the prompt is not decomposable.
|
|
44
|
-
- Single model is sufficient.
|
|
45
|
-
- Batch-capable: no interactivity required. Could be `--decompose` or `mode: decompose`.
|
|
46
|
-
|
|
47
|
-
### `/spawn` Specialist Robots (`lib/aia/spawn_handler.rb`)
|
|
48
|
-
- Dynamically creates a specialist robot on demand. The user can name a type
|
|
49
|
-
(`/spawn security-expert`) or omit it and let the primary robot auto-detect the
|
|
50
|
-
needed expertise. Spawned specialists are cached for reuse within the session.
|
|
51
|
-
Optionally creates TrakFlow tasks when TrakFlow is available.
|
|
52
|
-
- Single model is sufficient.
|
|
53
|
-
- Batch-capable: specialist type could be specified via CLI flag or front matter.
|
|
54
|
-
|
|
55
|
-
### `/debate` Multi-Round (`lib/aia/debate_handler.rb`)
|
|
56
|
-
- Two or more robots debate a topic across rounds. Each round, every robot responds
|
|
57
|
-
to the previous arguments. Stops when any robot says "CONVERGED" or after 5
|
|
58
|
-
rounds. Displays formatted round-by-round output.
|
|
59
|
-
- Requires a 2-model network (`-m modelA,modelB`).
|
|
60
|
-
- Batch-capable: debate runs to completion without user input — could be `--debate`.
|
|
61
|
-
|
|
62
|
-
### `@mention` Routing (`lib/aia/mention_router.rb`)
|
|
63
|
-
- Directs a message to one specific robot in a multi-model network by name.
|
|
64
|
-
Syntax: `@robot_name your question`. If the robot name is unknown, available
|
|
65
|
-
robots are listed. Shows token metrics with `--tokens`.
|
|
66
|
-
- Requires a 2-model network.
|
|
67
|
-
- Genuinely interactive: the value is in the user directing conversation flow
|
|
68
|
-
turn-by-turn; less meaningful as a one-shot batch operation.
|
|
69
|
-
|
|
70
|
-
### Natural Language Model Switch (`lib/aia/model_switch_handler.rb`)
|
|
71
|
-
- Detects model-change intent from natural language input, e.g. "switch to llama"
|
|
72
|
-
or "use phi4-mini instead". Shows "Interpreted as: /model X" and prompts for
|
|
73
|
-
confirmation (y/n). On confirmation, rebuilds the robot with the new model and
|
|
74
|
-
transfers history. Also handles `model_compare` and `model_switch_capability` intents.
|
|
75
|
-
- Genuinely interactive: depends on the user directing the conversation.
|
|
76
|
-
|
|
77
|
-
### `/delegate` TrakFlow Teams (`lib/aia/delegate_handler.rb`)
|
|
78
|
-
- A lead robot breaks the prompt into subtasks and assigns each to team members via
|
|
79
|
-
a TrakFlow plan. Each robot executes its subtask in order with full shared context.
|
|
80
|
-
Shows the plan before execution, then step-by-step results.
|
|
81
|
-
- Requires a 2-model network and the TrakFlow gem.
|
|
82
|
-
- **Blocked**: `trak_flow` gem currently has a LoadError in this environment.
|
|
83
|
-
Defer until the TrakFlow dependency is resolved.
|
|
84
|
-
|
|
85
|
-
## Batch Mode Extension Opportunities
|
|
86
|
-
|
|
87
|
-
`/verify`, `/decompose`, `/debate`, and `/spawn` are ready to be lifted out of
|
|
88
|
-
chat-only access. `@mention` routing and natural language model switching are
|
|
89
|
-
genuinely conversational and are better left as chat-only features.
|
|
90
|
-
|
|
91
|
-
| Feature | Suggested CLI flag | Suggested front matter key |
|
|
92
|
-
|---|---|---|
|
|
93
|
-
| `/verify` | `--verify` | `mode: verify` |
|
|
94
|
-
| `/decompose` | `--decompose` | `mode: decompose` |
|
|
95
|
-
| `/debate` | `--debate` | `mode: debate` |
|
|
96
|
-
| `/spawn` | `--spawn TYPE` | `mode: spawn` / `spawn_type: TYPE` |
|
|
97
|
-
|
|
98
|
-
## Demo Implementation Notes
|
|
99
|
-
|
|
100
|
-
- Chat-mode demos would use `expect` scripting like `22_chat_mode.sh`.
|
|
101
|
-
- Single-model demos can reuse `ollama/qwen3` from the setup script.
|
|
102
|
-
- Multi-model demos need a second model — `ollama/phi4-mini` (already used in
|
|
103
|
-
`11_multi_model.sh`) is the natural choice.
|
|
104
|
-
- Suggested numbering: `23_verify.sh`, `24_decompose.sh`, `25_spawn.sh`,
|
|
105
|
-
`26_debate.sh`, `27_mention_routing.sh`, `28_model_switching.sh`
|
|
106
|
-
- Skip `29_delegate.sh` until the TrakFlow LoadError is resolved.
|
data/examples/aia_config.yml
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# AIA configuration for example demos
|
|
2
|
-
# Used by all demo scripts via: aia -c aia_config.yml ...
|
|
3
|
-
#
|
|
4
|
-
# This file is loaded with the -c / --config-file flag.
|
|
5
|
-
# It replaces the user's personal config (~/.config/aia/aia.yml),
|
|
6
|
-
# starting from bundled defaults + these values only.
|
|
7
|
-
# CLI flags passed directly to aia still take precedence.
|
|
8
|
-
#
|
|
9
|
-
# NOTE: Relative paths resolve against the directory where aia is invoked.
|
|
10
|
-
# Run demo scripts from the examples/ directory.
|
|
11
|
-
|
|
12
|
-
prompts:
|
|
13
|
-
dir: ./prompts_dir
|
|
14
|
-
|
|
15
|
-
models:
|
|
16
|
-
- name: gpt-4.1
|
|
17
|
-
|
|
18
|
-
output:
|
|
19
|
-
file: ~
|
|
20
|
-
|
|
21
|
-
flags:
|
|
22
|
-
chat: false
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# AIA configuration for agent harness demo (29_agent_harness.sh)
|
|
2
|
-
#
|
|
3
|
-
# Extends the base demo config with an orchestrator system prompt so Tobor
|
|
4
|
-
# is pre-configured as the primary coordinator from the start of the session.
|
|
5
|
-
# The system_prompt is injected into the robot's context at build time —
|
|
6
|
-
# it is NOT sent as a user message. Use this config with --chat and optionally
|
|
7
|
-
# -m MODEL_A,MODEL_B to add specialist network robots.
|
|
8
|
-
#
|
|
9
|
-
# Usage:
|
|
10
|
-
# aia -c aia_config_orchestrator.yml --chat
|
|
11
|
-
# aia -c aia_config_orchestrator.yml -m gpt-4.1,gpt-4.1-mini --chat
|
|
12
|
-
|
|
13
|
-
prompts:
|
|
14
|
-
dir: ./prompts_dir
|
|
15
|
-
system_prompt: |
|
|
16
|
-
You are Tobor, the primary AI orchestrator in this session.
|
|
17
|
-
|
|
18
|
-
Your role is to coordinate a team of specialized robots to handle complex
|
|
19
|
-
tasks. Think like a project director: delegate what can be parallelized,
|
|
20
|
-
direct what requires deep specialization, and synthesize what needs
|
|
21
|
-
holistic judgment.
|
|
22
|
-
|
|
23
|
-
When you receive a request, apply this decision framework:
|
|
24
|
-
|
|
25
|
-
- Direct response: Simple, self-contained questions — answer yourself.
|
|
26
|
-
- /spawn specialist-type: Questions requiring narrow domain expertise.
|
|
27
|
-
This creates a specialist lead agent on the fly and routes the task to it.
|
|
28
|
-
- /decompose: Complex requests with multiple independent dimensions.
|
|
29
|
-
This splits the task into parallel workstreams across your robot team,
|
|
30
|
-
then synthesizes the results into a unified response.
|
|
31
|
-
- /delegate: Structured multi-step tasks where steps have dependencies.
|
|
32
|
-
This creates a tracked execution plan with ordered hand-offs between robots.
|
|
33
|
-
|
|
34
|
-
Always be explicit about which coordination strategy you are using and why.
|
|
35
|
-
When you spawn or decompose, briefly state the workstreams or specialist
|
|
36
|
-
roles before execution so the user understands the plan.
|
|
37
|
-
|
|
38
|
-
models:
|
|
39
|
-
- name: gpt-4.1
|
|
40
|
-
|
|
41
|
-
output:
|
|
42
|
-
file: ~
|
|
43
|
-
|
|
44
|
-
flags:
|
|
45
|
-
chat: false
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# AIA configuration with MCP server defined in YAML.
|
|
2
|
-
# Equivalent to using --mcp mcp/filesystem.json but
|
|
3
|
-
# keeps everything in one config file.
|
|
4
|
-
|
|
5
|
-
prompts:
|
|
6
|
-
dir: ./prompts_dir
|
|
7
|
-
|
|
8
|
-
models:
|
|
9
|
-
- name: ollama/qwen3
|
|
10
|
-
|
|
11
|
-
output:
|
|
12
|
-
file: ~
|
|
13
|
-
|
|
14
|
-
flags:
|
|
15
|
-
chat: false
|
|
16
|
-
|
|
17
|
-
mcp_servers:
|
|
18
|
-
- name: filesystem
|
|
19
|
-
command: npx
|
|
20
|
-
args: ["-y", "@modelcontextprotocol/server-filesystem", "./prompts_dir"]
|
|
21
|
-
timeout: 10000
|
data/examples/common.sh
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# examples/common.sh
|
|
2
|
-
#
|
|
3
|
-
# Shared setup for all demo scripts. Source this at the top:
|
|
4
|
-
# source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
|
|
5
|
-
#
|
|
6
|
-
# What it does:
|
|
7
|
-
# 1. cd's into the examples directory
|
|
8
|
-
# 2. Unsets all AIA_* environment variables so only the
|
|
9
|
-
# config file controls behavior
|
|
10
|
-
# 3. Sets CONFIG for use in aia commands
|
|
11
|
-
|
|
12
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
13
|
-
cd "${SCRIPT_DIR}"
|
|
14
|
-
|
|
15
|
-
# When running from inside the development repo, prefer the local bin/aia
|
|
16
|
-
# over any system-installed gem. bin/aia loads from ../lib/aia directly,
|
|
17
|
-
# so demos always run against the version in this checkout.
|
|
18
|
-
# Exported so child processes (including `expect`'s `spawn aia`) inherit it.
|
|
19
|
-
REPO_BIN="$(cd "${SCRIPT_DIR}/.." && pwd)/bin"
|
|
20
|
-
if [ -f "${REPO_BIN}/aia" ]; then
|
|
21
|
-
export PATH="${REPO_BIN}:${PATH}"
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# Clear all AIA_* env vars so personal settings don't leak in.
|
|
25
|
-
while IFS= read -r var; do
|
|
26
|
-
unset "$var"
|
|
27
|
-
done < <(env | grep '^AIA_' | cut -d= -f1)
|
|
28
|
-
|
|
29
|
-
CONFIG="aia_config.yml"
|
|
30
|
-
|
|
31
|
-
# Drain leaked escape sequences from the terminal input buffer.
|
|
32
|
-
# Reline queries cursor position (\e[6n) inside the pty; the
|
|
33
|
-
# terminal's responses (\e[row;colR) can leak into bash's stdin
|
|
34
|
-
# after expect exits. Call this after every expect block.
|
|
35
|
-
drain_terminal() {
|
|
36
|
-
sleep 0.2
|
|
37
|
-
stty sane 2>/dev/null || true
|
|
38
|
-
while IFS= read -r -t 0.2 -n 100 _ 2>/dev/null; do :; done
|
|
39
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# examples/directives/timestamp_directive.rb
|
|
2
|
-
#
|
|
3
|
-
# A custom directive that inserts a formatted timestamp.
|
|
4
|
-
# Load with: aia --tools directives/timestamp_directive.rb
|
|
5
|
-
#
|
|
6
|
-
# In a prompt file (ERB):
|
|
7
|
-
# Generated at: <%= timestamp %>
|
|
8
|
-
# Generated at: <%= timestamp '%Y-%m-%d' %>
|
|
9
|
-
#
|
|
10
|
-
# In chat mode:
|
|
11
|
-
# /timestamp
|
|
12
|
-
# /timestamp %Y-%m-%d
|
|
13
|
-
|
|
14
|
-
module AIA
|
|
15
|
-
class CustomDirectives < Directive
|
|
16
|
-
desc "Insert current timestamp (optional strftime format, default: %Y-%m-%d %H:%M:%S)"
|
|
17
|
-
def timestamp(args = [], context_manager = nil)
|
|
18
|
-
format = args.empty? ? '%Y-%m-%d %H:%M:%S' : args.join(' ')
|
|
19
|
-
Time.now.strftime(format)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
parameters:
|
|
3
|
-
audience: developer
|
|
4
|
-
---
|
|
5
|
-
<% if audience == "developer" %>
|
|
6
|
-
Explain how Ruby's garbage collector works.
|
|
7
|
-
Include details about generational GC and object marking.
|
|
8
|
-
<% elsif audience == "manager" %>
|
|
9
|
-
Explain what garbage collection is in programming.
|
|
10
|
-
Focus on why it matters for application performance.
|
|
11
|
-
Keep it non-technical.
|
|
12
|
-
<% else %>
|
|
13
|
-
Explain what garbage collection means in programming
|
|
14
|
-
as if I were ten years old.
|
|
15
|
-
<% end %>
|
|
16
|
-
|
|
17
|
-
Keep your answer to one paragraph.
|