ai-consultants 4.0.2 → 4.0.4

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 (71) hide show
  1. package/.env.example +8 -11
  2. package/CLAUDE.md +18 -2
  3. package/README.md +13 -118
  4. package/SKILL.md +7 -3
  5. package/docs/COST_RATES.md +7 -4
  6. package/docs/JSON_SCHEMA.md +1 -1
  7. package/docs/SETUP.md +10 -25
  8. package/docs/SMART_ROUTING.md +8 -50
  9. package/docs/cost_rates.json +10 -5
  10. package/package.json +2 -1
  11. package/references/configuration.md +1 -1
  12. package/scripts/config.sh +9 -22
  13. package/scripts/configure.sh +8 -5
  14. package/scripts/consult_all.sh +3 -3
  15. package/scripts/doctor.sh +4 -4
  16. package/scripts/install.sh +2 -2
  17. package/scripts/lib/api.sh +0 -55
  18. package/scripts/lib/cache.sh +0 -24
  19. package/scripts/lib/code_optimizer.sh +0 -53
  20. package/scripts/lib/common.sh +1 -57
  21. package/scripts/lib/costs.sh +0 -17
  22. package/scripts/lib/personas.sh +0 -18
  23. package/scripts/lib/reliability.sh +0 -23
  24. package/scripts/lib/routing.sh +18 -119
  25. package/scripts/lib/session.sh +0 -81
  26. package/scripts/query_glm.sh +1 -1
  27. package/docs/releases/v2.10.1.md +0 -84
  28. package/docs/releases/v2.10.2.md +0 -40
  29. package/docs/releases/v2.10.3.md +0 -63
  30. package/docs/releases/v2.10.4.md +0 -63
  31. package/docs/releases/v2.10.5.md +0 -57
  32. package/docs/releases/v2.10.6.md +0 -59
  33. package/docs/releases/v2.10.7.md +0 -53
  34. package/docs/releases/v2.10.8.md +0 -58
  35. package/docs/releases/v2.10.9.md +0 -123
  36. package/docs/releases/v2.11.0.md +0 -163
  37. package/docs/releases/v2.12.0.md +0 -182
  38. package/docs/releases/v2.13.0.md +0 -179
  39. package/docs/releases/v2.13.1.md +0 -133
  40. package/docs/releases/v2.14.0.md +0 -124
  41. package/docs/releases/v2.14.1.md +0 -70
  42. package/docs/releases/v2.14.2.md +0 -77
  43. package/docs/releases/v2.15.0.md +0 -72
  44. package/docs/releases/v2.15.1.md +0 -80
  45. package/docs/releases/v2.16.0.md +0 -71
  46. package/docs/releases/v2.17.0.md +0 -62
  47. package/docs/releases/v2.17.1.md +0 -46
  48. package/docs/releases/v2.17.2.md +0 -51
  49. package/docs/releases/v2.18.0.md +0 -63
  50. package/docs/releases/v2.19.0.md +0 -66
  51. package/docs/releases/v2.19.1.md +0 -44
  52. package/docs/releases/v2.19.2.md +0 -54
  53. package/docs/releases/v2.20.0.md +0 -65
  54. package/docs/releases/v2.21.0.md +0 -65
  55. package/docs/releases/v2.21.1.md +0 -84
  56. package/docs/releases/v2.22.0.md +0 -82
  57. package/docs/releases/v2.23.0.md +0 -75
  58. package/docs/releases/v2.24.0.md +0 -88
  59. package/docs/releases/v2.25.0.md +0 -101
  60. package/docs/releases/v2.25.1.md +0 -77
  61. package/docs/releases/v2.25.2.md +0 -53
  62. package/docs/releases/v3.0.0.md +0 -71
  63. package/docs/releases/v3.1.0.md +0 -95
  64. package/docs/releases/v3.1.1.md +0 -54
  65. package/docs/releases/v3.2.0.md +0 -96
  66. package/docs/releases/v3.3.0.md +0 -80
  67. package/docs/releases/v3.4.0.md +0 -102
  68. package/docs/releases/v3.5.0.md +0 -129
  69. package/docs/releases/v4.0.0.md +0 -107
  70. package/docs/releases/v4.0.1.md +0 -57
  71. package/docs/releases/v4.0.2.md +0 -98
package/.env.example CHANGED
@@ -198,7 +198,7 @@ QWEN3_CMD=qwen
198
198
  # =============================================================================
199
199
 
200
200
  # GLM - The Methodologist
201
- GLM_MODEL=glm-5.3
201
+ GLM_MODEL=glm-5.3-flash
202
202
  GLM_TIMEOUT=180
203
203
  GLM_API_MAX_TOKENS=16384
204
204
  GLM_API_URL=https://api.z.ai/api/coding/paas/v4/chat/completions
@@ -335,15 +335,12 @@ ENABLE_RELIABILITY_TRACKING=true
335
335
  # SESSION MANAGEMENT
336
336
  # =============================================================================
337
337
 
338
- SESSION_CLEANUP_DAYS=7 # Auto-cleanup sessions older than N days
338
+ SESSION_CLEANUP_DAYS=7 # Deprecated no-op; retained for v4.x compatibility
339
339
  # SESSION_DIR=/custom/state/sessions
340
340
 
341
- # =============================================================================
342
- # INTERACTIVE MODE
343
- # =============================================================================
344
-
345
- ENABLE_PROGRESS_BARS=true # Show progress bars during consultation
346
- ENABLE_EARLY_TERMINATION=true # Allow Ctrl+C to stop with partial results
341
+ # Deprecated no-ops; retained for v4.x compatibility
342
+ ENABLE_PROGRESS_BARS=true
343
+ ENABLE_EARLY_TERMINATION=true
347
344
 
348
345
  # =============================================================================
349
346
  # PRE-FLIGHT CHECKS
@@ -383,10 +380,10 @@ INCLUDE_CRITICAL_COMMENTS=true
383
380
  MAX_BODY_SUMMARY_LINES=3
384
381
  MIN_IDENTIFIER_LENGTH=8
385
382
  PRESERVE_EXPORTS=true
386
- USE_COMPACT_PROMPTS=true
383
+ USE_COMPACT_PROMPTS=true # Deprecated no-op; retained for v4.x compatibility
387
384
  FORCE_PROJECT_TREE=false
388
- ENABLE_SELECTIVE_CONTEXT=false
389
- MAX_FILES_PER_CONSULTANT=5
385
+ ENABLE_SELECTIVE_CONTEXT=false # Deprecated no-op; retained for v4.x compatibility
386
+ MAX_FILES_PER_CONSULTANT=5 # Deprecated no-op; retained for v4.x compatibility
390
387
 
391
388
  # =============================================================================
392
389
  # REPORTING & STORAGE
package/CLAUDE.md CHANGED
@@ -6,7 +6,7 @@ AI Consultants is a multi-model coverage system that queries up to 10 AI consult
6
6
 
7
7
  **Self-Exclusion**: The invoking agent is automatically excluded from both the panel and synthesis. Claude Code won't query or synthesize with Claude, Codex CLI won't query or synthesize with Codex, etc.
8
8
 
9
- **Version**: 4.0.2
9
+ **Version**: 4.0.4
10
10
 
11
11
  ## Distribution
12
12
 
@@ -393,7 +393,7 @@ All consultants now use premium models by default:
393
393
  | Codex | gpt-5.6-sol |
394
394
  | Mistral | CLI: mistral-medium-3.5; API: mistral-large-3 |
395
395
  | DeepSeek | deepseek-v4-pro |
396
- | GLM | glm-5.3 |
396
+ | GLM | glm-5.3-flash |
397
397
  | Grok | grok-4.6 |
398
398
  | Qwen3 | qwen3.7-max |
399
399
  | Kimi | kimi-code/k3 |
@@ -760,6 +760,22 @@ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/s
760
760
 
761
761
  ## Changelog
762
762
 
763
+ ### v4.0.4
764
+
765
+ - **Housekeeping now removes dead implementation without removing public compatibility.** The cleanup deletes uncalled API, cache, optimizer, common, cost, persona, reliability, routing-summary, and session-display helpers, plus the stale README changelog and redundant npm ignore file. The documented `get_routing_mode`, `get_recommended_count`, and `get_category_timeout` helpers stay available and are regression-tested. Six historic config keys that had no runtime reader remain accepted as explicitly deprecated no-ops through v4.x: `SESSION_CLEANUP_DAYS`, `ENABLE_PROGRESS_BARS`, `ENABLE_EARLY_TERMINATION`, `USE_COMPACT_PROMPTS`, `ENABLE_SELECTIVE_CONTEXT`, and `MAX_FILES_PER_CONSULTANT`.
766
+ - **All Bash test suites now share one assertion framework.** `scripts/lib/test_helpers.sh` owns counters, pass/fail/skip rendering, regex/string/numeric/JSON/exit assertions, section rendering, and both concise and detailed summaries. `test_suite.sh` retains compatibility adapters for its established assertion call sites while delegating all mechanics; its summary fails on zero assertions or any failure. The previously excluded `test_functions.sh` is replaced by auto-discovered `test_common.sh`, which keeps regression coverage for diagnosed failures, quorum, health probes, feature-flag recognition, Kimi stream extraction, fenced/bare JSON normalization, confidence preservation, and both detailed-summary failure gates.
767
+ - **The package and active guidance are smaller and truthful.** `package.json#files` is the sole npm allowlist; the package excludes the GitHub release-note archive, tests, fixtures, and maintainer release tooling while retaining active docs. The manifest moves 107 → 61 files, packed bytes 340,662 → 268,831, and unpacked bytes 1,145,406 → 929,330. Setup/CI instructions use `doctor` and `configure`, examples use XDG consultation paths, and routing documentation describes real affinity selection rather than an inert routing-mode/timeout path.
768
+ - **Verification is wholly offline for this patch.** No consultant adapter, model, host transport, roster, cost rate, or synthesis behavior changed, so no billable live smoke was needed. Hermetic `npm test` passed 24/24 suites; core 447 assertions, configure 94 checks, installer/package 51 checks, common-helper 38 checks, Bash 3.2 syntax, ShellCheck, `npm ci --dry-run`, markdown links, and two rounds of cross-family cleanup review are green. PR #16 merged with its merge commit and all final CI checks passed.
769
+
770
+ ### v4.0.3
771
+
772
+ - **GLM's active catalog target moves from `glm-5.3` to `glm-5.3-flash` without changing transport or tier semantics.** `scripts/config.sh:189` changes the clean-install default, and the maximum/premium/standard branches at `scripts/config.sh:626-656` select the same exact provider ID. `max_quality` still supplies `GLM_REASONING_EFFORT=max`; economy deliberately remains `glm-4-flash`.
773
+ - **Existing managed installs advance without rewriting explicit choices.** `scripts/configure.sh:310-318` migrates the two exact historical generated defaults, `glm-5.2` and `glm-5.3`, to Flash and records `# ai-consultants:default`. A `# ai-consultants:pin` survives, including an explicit old `glm-5.3`; `scripts/test_configure.sh:449-461` covers both current-default migration and pin preservation.
774
+ - **Identity and pricing stay honest.** The OpenAI-compatible adapter sends `glm-5.3-flash`, `reasoning_effort=max`, and the 16,384-token GLM budget; the synthetic transport test requires provider-reported identity and requested-model metadata (`scripts/test_api_transport.sh:253-263`). `docs/cost_rates.json` marks Flash unpriced and retains a zero/unpriced entry for legacy `glm-5.3` pins, avoiding the generic fallback rate.
775
+ - **The exact ai-consultants transport completed one authorized no-retry live smoke.** Z.AI returned HTTP 200 and provider-reported `glm-5.3-flash` in about 12 seconds with 37 measured input tokens and 308 output tokens. The provider accepted max effort but returned near-structured text rather than the requested JSON; the adapter preserved `PONG` through its explicit unstructured fallback with confidence 5, so strict schema adherence is not claimed. PR #15 CI, the post-bump 23-suite gate, 452 core checks, configure 94/94, API transport 88/88, and ShellCheck are green.
776
+
777
+ Deliberately unchanged: `delegation-kit` remained read-only; its Claude-to-Z.AI gate and runner were not copied into this API-only consultant. Installation does not silently edit personal configuration, so an existing unpinned `.env` advances when the user runs `configure`; explicit pins remain user-owned. The separate `agent/model-defaults-4.1.0-wip` branch is not part of this patch release.
778
+
763
779
  ### v4.0.2
764
780
 
765
781
  - **The Grok adapter used to copy a rotating OAuth credential into a disposable HOME and delete any refreshed token at exit.** Parallel calls amplified the race: both could seed from one refresh token, one rotation vanished with its temp directory, and the ambient session could be left stale. `scripts/lib/grok_oauth.sh` now owns a durable generation under the XDG data root and `scripts/query_grok.sh` defaults to `GROK_OAUTH_MODE=shared`.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # AI Consultants v4.0.2
1
+ # AI Consultants v4.0.4
2
2
 
3
3
  > **Coverage, not a single guess.** A panel of up to 10 frontier models from different vendors fans out on your question in parallel and hands you the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses.
4
4
 
5
- [![Version](https://img.shields.io/badge/version-4.0.2-blue.svg)](https://github.com/matteoscurati/ai-consultants)
5
+ [![Version](https://img.shields.io/badge/version-4.0.4-blue.svg)](https://github.com/matteoscurati/ai-consultants)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
  [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/skills)
8
8
  [![GitHub stars](https://img.shields.io/github/stars/matteoscurati/ai-consultants?style=social)](https://github.com/matteoscurati/ai-consultants)
@@ -331,7 +331,7 @@ skillport status ai-consultants
331
331
  git clone https://github.com/matteoscurati/ai-consultants.git
332
332
  cd ai-consultants
333
333
  ./scripts/doctor.sh --fix
334
- ./scripts/setup_wizard.sh
334
+ ./bin/ai-consultants configure
335
335
  ```
336
336
 
337
337
  **Commands:**
@@ -411,7 +411,7 @@ the observed version is response provenance only.
411
411
 
412
412
  | Consultant | Default Model | Persona | Focus |
413
413
  |------------|---------------|---------|-------|
414
- | **GLM** | glm-5.3 | The Methodologist | Structured approaches |
414
+ | **GLM** | glm-5.3-flash | The Methodologist | Structured approaches |
415
415
  | **DeepSeek** | deepseek-v4-pro | The Code Specialist | Algorithms, code generation |
416
416
 
417
417
  ### Installing Consultant CLIs
@@ -483,7 +483,7 @@ detail instead of reducing every consultant to its summary.
483
483
  | Mistral CLI | mistral-medium-3.5 | mistral-medium-3.5 | mistral-medium-3.5 | devstral-small-2 |
484
484
  | Mistral API | mistral-large-3 | mistral-large-3 | mistral-large-3 | mistral-large-3 |
485
485
  | DeepSeek | deepseek-v4-pro | deepseek-v4-pro | deepseek-v4-flash | deepseek-v4-flash |
486
- | GLM | glm-5.3 | glm-5.3 | glm-5.3 | glm-4-flash |
486
+ | GLM | glm-5.3-flash | glm-5.3-flash | glm-5.3-flash | glm-4-flash |
487
487
  | Grok | grok-4.6 | grok-4.6 | grok-4.5 | grok-4.5 |
488
488
  | Qwen3 | qwen3.8-max when Token Plan is configured; otherwise qwen3.7-max | qwen3.7-max | qwen3.6-35b-a3b | qwen3-32b |
489
489
  | Kimi | kimi-code/k3-256k | kimi-code/k3 | kimi-code/k3 | kimi-code/k3 |
@@ -698,15 +698,19 @@ Classify -> Route -> Fan out (parallel) -> Coverage synthesis
698
698
  Each consultation generates:
699
699
 
700
700
  ```
701
- /tmp/ai_consultations/TIMESTAMP/
701
+ ${XDG_CACHE_HOME:-$HOME/.cache}/ai-consultants/consultations/TIMESTAMP/
702
+ ├── context.md # Built consultation context
702
703
  ├── gemini.json # Individual responses
703
704
  ├── codex.json # with confidence scores
704
705
  ├── mistral.json
705
706
  ├── grok.json
706
707
  ├── synthesis.json # Coverage union
708
+ ├── optimization_metrics.json
707
709
  └── report.md # Human-readable report
708
710
  ```
709
711
 
712
+ The command prints the exact output directory as its final stdout line.
713
+
710
714
  ---
711
715
 
712
716
  ## Best Practices
@@ -736,7 +740,8 @@ enough — the panel adds little.
736
740
 
737
741
  - **Never** include credentials or API keys in queries
738
742
  - Review and redact sensitive code before sending it to any external consultant
739
- - Files in `/tmp` are automatically cleaned up
743
+ - Private query and context-staging files are removed automatically; generated
744
+ reports remain in the XDG cache directory until you remove them
740
745
 
741
746
  ---
742
747
 
@@ -748,121 +753,11 @@ enough — the panel adds little.
748
753
  - [Smart Routing](docs/SMART_ROUTING.md) - Category-based routing
749
754
  - [JSON Schema](docs/JSON_SCHEMA.md) - Output format specification
750
755
  - [Reference Details](references/details.md) - Presets, strategies, best practices
756
+ - [Changelog](https://github.com/matteoscurati/ai-consultants/blob/main/CHANGELOG.md) - Complete version history
751
757
  - [Contributing](CONTRIBUTING.md) - How to contribute
752
758
 
753
759
  ---
754
760
 
755
- ## Changelog
756
-
757
- ### v2.23.0
758
-
759
- - **`ENABLE_REFLECTION` and `REFLECTION_CYCLES` removed.** The self-reflection module they controlled was never called by anything, so the settings had never affected a consultation — v2.16's `converge` and `adversarial` shapes already run critique-refine off measured consensus. **If you set either key**, remove it: `configure --set ENABLE_REFLECTION=...` now exits non-zero, and both keys are dropped when an existing `.env` is rewritten.
760
- - **The release gate works again.** Two test suites failed deterministically against any real user configuration, so no release since 2.22.0 could pass its own `npm test`.
761
- - **`npm test` no longer swallows failures.** A failing assertion followed by a passing one inside the same test function was counted as a pass, across 8 of 13 test functions.
762
- - **Feature flags can no longer be enrolled as consultants.** A registry that told feature flags apart from custom API agents was 18 entries out of date; it is now complete and pinned by a test.
763
- - **Preset tables corrected** — they described a debate and peer-review depth the code has not enforced since v2.16, and called `high-stakes`/`max_quality` "all consultants" when they enable 5 and 8 of 11. See the [v2.23.0 release note](docs/releases/v2.23.0.md).
764
-
765
- ### v2.22.0
766
-
767
- - **`ai-consultants configure`**: a public automatic configurator. It detects your installed CLIs and API keys, picks CLI-first transports, and writes a private XDG config while preserving your existing settings and secrets. Drive it with repeatable `--set KEY=VALUE`, review it with `--interactive` / `--advanced`, or preview it with `--dry-run`. See the [v2.22.0 release note](docs/releases/v2.22.0.md).
768
-
769
- ### v2.21.1
770
-
771
- - **Kimi K3**: Kimi now defaults to `kimi-code/k3`, and the adapter passes the model explicitly with `--model`.
772
- - **Focused 11-consultant roster**: Kilo, Aider, Amp, and Ollama were removed end-to-end, including their adapters and configuration variables. See the [v2.21.1 release note](docs/releases/v2.21.1.md) for migration guidance.
773
-
774
- ### v2.15.1
775
-
776
- - **Gemini fixes (Antigravity CLI)**: the default model (`Gemini 3.1 Pro (High)`) wraps its JSON in a ```` ```json ```` fence; v2.15.0 didn't strip it, so every Gemini reply degraded to a generic fallback. Now de-fenced on all paths (response processing, self-reflection, synthesis).
777
- - **Works out-of-the-box for `npx`**: Gemini auto-selects API mode when `GEMINI_API_KEY` is set (the `agy` CLI can't be npm-installed and is OAuth-only), so a key-only environment no longer silently drops Gemini.
778
- - **Synthesis no longer hangs** when `agy` is the synthesizer (it was launched interactively instead of in print mode).
779
-
780
- ### v2.10.0
781
-
782
- - **MiniMax M2.5 support**: New API-based consultant with "The Pragmatic Optimizer" persona
783
- - **15 consultants total**: Gemini, Codex, Mistral, Kilo, Cursor, Aider, Amp, Kimi, Claude, Qwen3, GLM, Grok, DeepSeek, MiniMax, Ollama
784
- - **npx distribution**: `npx ai-consultants "question"` - run directly without install
785
- - **npm packaging**: `package.json` with zero dependencies, `.npmignore` for clean publishing
786
-
787
- ### v2.8.1
788
-
789
- - **Bug fixes**: Fixed `((count++))` abort under `set -e`, missing Amp in consultant map, hardcoded `claude` in synthesize.sh
790
- - **Security**: Variable name validation before `export` in escalation and cost-aware routing
791
- - **DRY refactoring**: Rewrote `query_kilo.sh` and `query_cursor.sh` using shared `process_consultant_response()`; added `get_model_for_tier()` as single source of truth
792
-
793
- ### v2.8.0
794
-
795
- - **Amp CLI support**: New consultant with "The Systems Thinker" persona
796
- - **13 consultants total**: Gemini, Codex, Mistral, Kilo, Cursor, Aider, Amp, Claude, Qwen3, GLM, Grok, DeepSeek, Ollama
797
- - **Installation**: `curl -fsSL https://ampcode.com/install.sh | bash`
798
-
799
- ### v2.7.0
800
-
801
- - **Qwen CLI support**: CLI/API mode switching for Qwen3 via qwen-code
802
- - **5 switchable agents**: Gemini, Codex, Claude, Mistral, and now Qwen3 support CLI/API mode
803
- - **CLI default**: `QWEN3_USE_API` defaults to `false` (CLI mode via qwen-code)
804
-
805
- ### v2.6.0
806
-
807
- - **CLI/API mode switching**: Gemini, Codex, Claude, and Mistral can switch between CLI and API mode
808
- - **New environment variables**: `*_USE_API` and `*_API_URL` for each switchable agent
809
- - **Unified API query module**: `lib/api_query.sh` for consistent API handling
810
-
811
- ### v2.5.0
812
-
813
- - **Model quality tiers**: Premium, standard, and economy tiers for all consultants
814
- - **New presets**: `max_quality`, `medium`, `fast` for quick tier selection
815
- - **Premium defaults**: All consultants now use premium models by default (March 2026)
816
- - **`apply_model_tier()` function**: Programmatically switch all models to a tier
817
- - **Updated models**: opus-4.6, gemini-3.1-pro-preview, gpt-5.3-codex, mistral-large-3, etc.
818
-
819
- ### v2.4.0
820
-
821
- - **Budget enforcement**: Optional budget limits with configurable actions (warn/stop)
822
- - **Budget checks**: 4 enforcement points (before/after consultation, debate, synthesis)
823
- - **Budget configuration**: Configurable via natural language or environment variables
824
-
825
- ### v2.3.0
826
-
827
- - **Semantic caching**: Cache responses to avoid redundant API calls (15-25% savings)
828
- - **Cost-aware routing**: Route simple queries to cheaper models (30-50% savings)
829
- - **Fallback escalation**: Auto-escalate to premium model if confidence < 7
830
- - **Debate optimization**: Skip debate if all consultants agree (opt-in)
831
- - **Category exceptions**: SECURITY/ARCHITECTURE always trigger debate
832
- - **Quality monitoring**: `optimization_metrics.json` tracks optimization impact
833
- - **Compact reports**: Shorter reports by default (summaries only)
834
- - **Response limits**: Per-category token limits (opt-in)
835
-
836
- ### v2.2.0
837
-
838
- - **Claude consultant**: New consultant with "The Synthesizer" persona
839
- - **Self-exclusion**: Invoking agent automatically excluded from panel
840
- - **Presets**: Quick configuration with `--preset minimal/balanced/high-stakes/security`
841
- - **Doctor command**: Diagnostic and auto-fix tool
842
- - **Synthesis strategies**: `--strategy majority/risk_averse/security_first/compare_only`
843
- - **Confidence intervals**: Statistical confidence ranges (e.g., "8 +/- 1.2")
844
- - **Anonymous peer review**: Unbiased evaluation of responses
845
- - **Ollama support**: Local model inference for privacy
846
- - **Panic mode**: Automatic rigor when uncertainty detected
847
- - **One-liner install**: `curl | bash` installation
848
-
849
- ### v2.1.0
850
-
851
- - New consultants: Aider, DeepSeek
852
- - 17 configurable personas
853
- - Token optimization with AST extraction
854
-
855
- ### v2.0.0
856
-
857
- - Persona system with 15 predefined roles
858
- - Confidence scoring (1-10) on every response
859
- - Auto-synthesis with weighted recommendations
860
- - Multi-Agent Debate (MAD)
861
- - Smart routing by question category
862
- - Session management and cost tracking
863
-
864
- ---
865
-
866
761
  ## License
867
762
 
868
763
  MIT License - see [LICENSE](LICENSE) for details.
package/SKILL.md CHANGED
@@ -5,10 +5,10 @@ license: MIT
5
5
  compatibility: Requires bash, jq, and at least 2 AI CLI tools (agy, codex, vibe, etc.). macOS and Linux.
6
6
  metadata:
7
7
  author: matteoscurati
8
- version: 4.0.2
8
+ version: 4.0.4
9
9
  ---
10
10
 
11
- # AI Consultants v4.0.2 - AI Expert Panel
11
+ # AI Consultants v4.0.4 - AI Expert Panel
12
12
 
13
13
  **Coverage, not a single guess.** Convene a panel of AI "consultants" from different vendors for coding questions: they fan out in parallel and you get the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses. Each consultant has a **configurable persona** that decorrelates its analysis.
14
14
 
@@ -185,13 +185,17 @@ See [Full Configuration Reference](references/configuration.md) for all variable
185
185
  ## Output
186
186
 
187
187
  ```
188
- /tmp/ai_consultations/TIMESTAMP/
188
+ ${XDG_CACHE_HOME:-$HOME/.cache}/ai-consultants/consultations/TIMESTAMP/
189
+ ├── context.md # Built consultation context
189
190
  ├── gemini.json # Individual responses
190
191
  ├── codex.json
191
192
  ├── synthesis.json # Coverage union
193
+ ├── optimization_metrics.json
192
194
  └── report.md # Human-readable
193
195
  ```
194
196
 
197
+ The command prints the exact output directory as its final stdout line.
198
+
195
199
  ## Doctor Command
196
200
 
197
201
  Diagnose and fix issues:
@@ -1,4 +1,4 @@
1
- # Cost Rates - AI Consultants v4.0.2
1
+ # Cost Rates - AI Consultants v4.0.4
2
2
 
3
3
  This page documents the per-token rates used by the cost tracking system.
4
4
 
@@ -45,7 +45,8 @@ models programmatically.
45
45
  | gemini-3-flash | Legacy | $0.0005 | Removed Cursor consultant |
46
46
  | deepseek-v4-pro | Premium | $0.000435 | DeepSeek |
47
47
  | deepseek-v4-flash | Standard/Economy | $0.00014 | DeepSeek |
48
- | glm-5.3 | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
48
+ | glm-5.3-flash | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
49
+ | glm-5.3 | Legacy pins | Unpriced | GLM coding-plan endpoint |
49
50
  | glm-4-flash | Economy | $0.001 | GLM |
50
51
  | grok-4.6 | Maximum/Premium | $0.002 | Grok |
51
52
  | grok-4.5 | Standard/Economy | $0.002 | Grok |
@@ -86,7 +87,8 @@ models programmatically.
86
87
  | gemini-3-flash | Legacy | $0.003 | Removed Cursor consultant |
87
88
  | deepseek-v4-pro | Premium | $0.00087 | DeepSeek |
88
89
  | deepseek-v4-flash | Standard/Economy | $0.00028 | DeepSeek |
89
- | glm-5.3 | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
90
+ | glm-5.3-flash | Maximum/Premium/Standard | Unpriced | GLM coding-plan endpoint |
91
+ | glm-5.3 | Legacy pins | Unpriced | GLM coding-plan endpoint |
90
92
  | glm-4-flash | Economy | $0.003 | GLM |
91
93
  | grok-4.6 | Maximum/Premium | $0.006 | Grok |
92
94
  | grok-4.5 | Standard/Economy | $0.006 | Grok |
@@ -174,7 +176,8 @@ the providers' official pricing pages: [Anthropic](https://platform.claude.com/d
174
176
  [MiniMax](https://platform.minimax.io/docs/guides/pricing-paygo). Gemini 3.7's
175
177
  listed rate is the promotion effective through December 31, 2026.
176
178
 
177
- `glm-5.3`, `qwen3.8-max`, and `kimi-code/k3-256k` are explicitly unpriced on
179
+ `glm-5.3-flash`, legacy-pinned `glm-5.3`, `qwen3.8-max`, and
180
+ `kimi-code/k3-256k` are explicitly unpriced on
178
181
  the transports used here. Their zero catalog entries prevent the estimator from
179
182
  inventing a dollar figure; session reports disclose their exclusion rather than
180
183
  presenting them as free.
@@ -1,4 +1,4 @@
1
- # JSON Schema - AI Consultants v3.5
1
+ # AI Consultants JSON Schema
2
2
 
3
3
  This document describes the JSON schema used for consultant responses.
4
4
 
package/docs/SETUP.md CHANGED
@@ -1,4 +1,4 @@
1
- # Setup Guide - AI Consultants v2.21.1
1
+ # AI Consultants Setup Guide
2
2
 
3
3
  This guide walks you through installing and configuring AI Consultants for various AI coding agents.
4
4
 
@@ -688,33 +688,18 @@ Checks:
688
688
  ./scripts/doctor.sh --fix
689
689
  ```
690
690
 
691
- ### Preflight Check
692
-
693
- ```bash
694
- ./scripts/preflight_check.sh
695
- ```
696
-
697
- Expected output:
698
- ```
699
- [OK] jq installed
700
- [OK] Gemini CLI installed and authenticated
701
- [OK] Codex CLI installed and authenticated
702
- Status: Ready
703
- ```
704
-
705
- ### Setup Wizard (Bash)
691
+ ### Configuration
706
692
 
707
- Interactive configuration:
693
+ Auto-detect the available CLI and API transports:
708
694
 
709
695
  ```bash
710
- ./scripts/setup_wizard.sh
696
+ ./bin/ai-consultants configure
711
697
  ```
712
698
 
713
- The wizard will:
714
- 1. Check installed CLIs
715
- 2. Test authentication
716
- 3. Suggest configuration
717
- 4. Generate `.env` file
699
+ Use `--interactive` for a guided review, `--advanced` for every supported
700
+ parameter, or `--dry-run` to preview the generated configuration without
701
+ writing it. The deprecated `setup_wizard.sh` and `preflight_check.sh` entry
702
+ points remain compatibility forwarders but are not the maintained interface.
718
703
 
719
704
  ---
720
705
 
@@ -805,10 +790,10 @@ After setup:
805
790
  **Bash:**
806
791
  ```bash
807
792
  # Test your configuration
808
- ./scripts/consult_all.sh --preset minimal "How do I optimize a SQL query?"
793
+ output_dir=$(./scripts/consult_all.sh --preset minimal "How do I optimize a SQL query?")
809
794
 
810
795
  # View the report
811
- cat /tmp/ai_consultations/*/report.md
796
+ less "$output_dir/report.md"
812
797
  ```
813
798
 
814
799
  See [README.md](../README.md) for usage examples and full documentation.
@@ -1,4 +1,4 @@
1
- # Smart Routing - AI Consultants v2.11
1
+ # AI Consultants Smart Routing
2
2
 
3
3
  The Smart Routing system automatically selects the most suitable consultants based on the question category.
4
4
 
@@ -85,30 +85,11 @@ This is useful for:
85
85
  The matrix is loaded once per shell and cached in memory — no jq overhead
86
86
  on subsequent calls.
87
87
 
88
- ## Routing Modes
89
-
90
- The system automatically determines how many consultants to involve:
91
-
92
- | Mode | Consultants | Categories | Rationale |
93
- |------|-------------|------------|-----------|
94
- | **full** | All enabled | SECURITY, GENERAL | All for complete perspectives |
95
- | **selective** | Top 5 by affinity | CODE_REVIEW, BUG_DEBUG, ARCHITECTURE, ALGORITHM, DATABASE, API_DESIGN, TESTING | Best matches for the category |
96
- | **single** | 1 | QUICK_SYNTAX | Only the best for quick answers |
97
-
98
- ### Selection Logic
99
-
100
- ```
101
- SECURITY → full (all) # Too important to exclude anyone
102
- QUICK_SYNTAX → single (1) # A quick answer is sufficient
103
- CODE_REVIEW → selective (5) # Top 5 by affinity
104
- BUG_DEBUG → selective (5)
105
- ARCHITECTURE → selective (5)
106
- * → full (all) # Default: all enabled
107
- ```
108
-
109
88
  ## Cost-Aware Routing (v2.3+)
110
89
 
111
- When `ENABLE_COST_AWARE_ROUTING=true`, the system routes queries to cheaper models based on complexity:
90
+ When `ENABLE_COST_AWARE_ROUTING=true`, selected consultants use economy models
91
+ for simple questions and can retry low-confidence responses with their premium
92
+ model. Consultant selection itself continues to use the affinity matrix above.
112
93
 
113
94
  ```bash
114
95
  ENABLE_COST_AWARE_ROUTING=true
@@ -119,23 +100,6 @@ COMPLEXITY_THRESHOLD_MEDIUM=6 # Score 4-6 = use standard models
119
100
 
120
101
  See [COST_RATES.md](COST_RATES.md) for model pricing by tier.
121
102
 
122
- ## Timeout per Category
123
-
124
- Timeouts optimized based on category complexity:
125
-
126
- | Category | Timeout | Rationale |
127
- |----------|---------|-----------|
128
- | QUICK_SYNTAX | 60s | Short answers |
129
- | DATABASE | 120s | Medium-complexity queries |
130
- | TESTING | 120s | Test case generation |
131
- | CODE_REVIEW | 180s | Detailed analysis |
132
- | BUG_DEBUG | 180s | Investigation |
133
- | ALGORITHM | 180s | Reasoning |
134
- | API_DESIGN | 180s | Detailed design |
135
- | GENERAL | 180s | Default |
136
- | ARCHITECTURE | 240s | Complex design |
137
- | SECURITY | 240s | In-depth analysis |
138
-
139
103
  ## Supported Categories
140
104
 
141
105
  ### CODE_REVIEW
@@ -235,8 +199,8 @@ ENABLE_SMART_ROUTING=true \
235
199
 
236
200
  # Output:
237
201
  # [INFO] Category: SECURITY
238
- # [INFO] Routing mode: full (all enabled consultants)
239
- # [INFO] Timeout: 240s
202
+ # [INFO] Smart routing for category SECURITY...
203
+ # [INFO] Selected consultants: Mistral Codex ...
240
204
  ```
241
205
 
242
206
  ## API Functions
@@ -255,12 +219,6 @@ select_consultants "SECURITY" 7 # → All enabled consultants
255
219
  # Check recommendation
256
220
  is_recommended "SECURITY" "Claude" 7 && echo "Recommended"
257
221
 
258
- # Get timeout
259
- get_category_timeout "ARCHITECTURE" # → 240
260
-
261
- # Get routing mode
262
- get_routing_mode "QUICK_SYNTAX" # → single
263
-
264
- # Cost-aware selection (v2.3)
265
- select_consultants_cost_aware "QUICK_SYNTAX" 7 # → Economy model selection
222
+ # Cost-aware model selection (v2.3)
223
+ get_cost_aware_model "codex" 2 # → Economy model when enabled
266
224
  ```
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.2",
2
+ "version": "4.0.4",
3
3
  "updated": "2026-08-23",
4
4
  "models": {
5
5
  "_comment_units": "All rates are USD per 1,000 tokens (per-1K). lib/costs.sh computes cost as (token_count / 1000) * rate, so every value here MUST be a per-1K rate = (provider $/1M price) / 1000. Do NOT paste $/MTok figures directly.",
@@ -402,6 +402,10 @@
402
402
  "input": 0,
403
403
  "output": 0
404
404
  },
405
+ "glm-5.3-flash": {
406
+ "input": 0,
407
+ "output": 0
408
+ },
405
409
  "kimi-code/k3-256k": {
406
410
  "input": 0,
407
411
  "output": 0
@@ -411,6 +415,7 @@
411
415
  "qwen3.8-max",
412
416
  "qwen3.8-max-preview",
413
417
  "glm-5.3",
418
+ "glm-5.3-flash",
414
419
  "kimi-code/k3-256k"
415
420
  ],
416
421
  "consultant_fallbacks": {
@@ -420,7 +425,7 @@
420
425
  "codex": "gpt-5.6-sol",
421
426
  "mistral": "mistral-large-3",
422
427
  "deepseek": "deepseek-v4-pro",
423
- "glm": "glm-5.3",
428
+ "glm": "glm-5.3-flash",
424
429
  "grok": "grok-4.6",
425
430
  "qwen3": "qwen3.7-max",
426
431
  "kimi": "kimi-code/k3",
@@ -434,7 +439,7 @@
434
439
  "codex": "gpt-5.6-sol",
435
440
  "mistral": "mistral-medium-3.5",
436
441
  "deepseek": "deepseek-v4-pro",
437
- "glm": "glm-5.3",
442
+ "glm": "glm-5.3-flash",
438
443
  "grok": "grok-4.6",
439
444
  "qwen3": "qwen3.8-max",
440
445
  "kimi": "kimi-code/k3-256k",
@@ -446,7 +451,7 @@
446
451
  "codex": "gpt-5.6-sol",
447
452
  "mistral": "mistral-medium-3.5",
448
453
  "deepseek": "deepseek-v4-pro",
449
- "glm": "glm-5.3",
454
+ "glm": "glm-5.3-flash",
450
455
  "grok": "grok-4.6",
451
456
  "qwen3": "qwen3.7-max",
452
457
  "kimi": "kimi-code/k3",
@@ -458,7 +463,7 @@
458
463
  "codex": "gpt-5.6-terra",
459
464
  "mistral": "mistral-medium-3.5",
460
465
  "deepseek": "deepseek-v4-flash",
461
- "glm": "glm-5.3",
466
+ "glm": "glm-5.3-flash",
462
467
  "grok": "grok-4.5",
463
468
  "qwen3": "qwen3.6-35b-a3b",
464
469
  "kimi": "kimi-code/k3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-consultants",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "A cross-vendor panel of up to 10 AI models that returns the coverage union of their distinct perspectives",
5
5
  "bin": {
6
6
  "ai-consultants": "bin/ai-consultants"
@@ -19,6 +19,7 @@
19
19
  "SKILL.md",
20
20
  "CLAUDE.md",
21
21
  "docs/",
22
+ "!docs/releases/",
22
23
  "references/"
23
24
  ],
24
25
  "keywords": [
@@ -252,7 +252,7 @@ KIMI_MODEL=kimi-code/k3
252
252
  QWEN3_MODEL=qwen3.7-max
253
253
  QWEN3_MAX_QUALITY_TIMEOUT=600
254
254
  QWEN3_API_MAX_TOKENS=16384
255
- GLM_MODEL=glm-5.3
255
+ GLM_MODEL=glm-5.3-flash
256
256
  GLM_API_MAX_TOKENS=16384
257
257
  GLM_REASONING_EFFORT= # max_quality sets max
258
258
  GROK_MODEL=grok-4.6