docdex 0.2.55 → 0.2.57

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.57
4
+ - Bump release metadata to 0.2.57.
5
+
6
+ ## 0.2.56
7
+ - Clarify packaged agent-facing local delegation docs for code-oriented tasks versus `general_question`.
8
+
3
9
  ## 0.2.55
4
10
  - Raise installer-managed Codex MCP `tool_timeout_sec` and `startup_timeout_sec` defaults to 300 seconds.
5
11
  - Update packaged Codex MCP examples to show the 300-second timeout settings.
package/assets/agents.md CHANGED
@@ -1,4 +1,4 @@
1
- ---- START OF DOCDEX INFO V0.2.55 ----
1
+ ---- START OF DOCDEX INFO V0.2.57 ----
2
2
  Docdex URL: http://127.0.0.1:28491
3
3
  Use this base URL for Docdex HTTP endpoints.
4
4
  Health check endpoint: `GET /healthz` (not `/v1/health`).
@@ -29,7 +29,7 @@ Health check endpoint: `GET /healthz` (not `/v1/health`).
29
29
  Docdex (Documentation Indexer) serves as your persistent "brain" on the user's machine. It operates on a Waterfall Retrieval model:
30
30
 
31
31
  1. Local First (Tier 1): Instant search of repo code, symbols, and ingested library documentation.
32
- 2. Web Enrichment (Tier 2): Gated fallback to DuckDuckGo/Headless Chrome only when local confidence is low or explicitly requested.
32
+ 2. Web Enrichment (Tier 2): Gated fallback to the configured web provider (DuckDuckGo by default, `mswarm` when selected) plus Headless Chrome when local confidence is low or explicitly requested.
33
33
  3. Cognition (Tier 3): Local LLM inference (Ollama) with context assembly.
34
34
 
35
35
  Key Constraints:
@@ -67,7 +67,9 @@ Standard retrieval. The daemon automatically handles the waterfall (Local -> Web
67
67
  | MCP Tool | Purpose |
68
68
  | --- | --- |
69
69
  | docdex_search | Search code, docs, and ingested libraries. Returns ranked snippets. |
70
- | docdex_web_research | Explicitly trigger Tier 2 web discovery (DDG + Headless Chrome). Use when you need external docs not present locally. |
70
+ | docdex_web_research | Explicitly trigger Tier 2 web discovery (configured provider + Headless Chrome). Use when you need external docs not present locally. |
71
+
72
+ When `DOCDEX_WEB_DISCOVERY_PROVIDER=mswarm` or `[web].discovery_provider = "mswarm"`, Docdex's runtime web-discovery adapter sends `POST {base_url}/v1/swarm/web/search` using `[integrations.mswarm].base_url`, adds the `x-api-key` header from `[integrations.mswarm].api_key`, and sends JSON shaped like `{ "query": "<search query>", "tool_id": "docdex" }`. Treat this as a runtime integration detail: agents should normally configure and invoke Docdex search/web tools rather than calling the raw mswarm endpoint directly unless they are debugging the integration itself.
71
73
 
72
74
  ### B. Code Intelligence (AST & Graph)
73
75
 
@@ -99,8 +101,9 @@ Use local delegation for low-complexity code-writing tasks and lightweight gener
99
101
  | docdex_local_completion | Delegate small tasks to a local model with strict output formats. |
100
102
  | HTTP /v1/delegate | HTTP endpoint for delegated completions with structured responses. |
101
103
 
102
- Required fields: `task_type`, `instruction`, `context`. Optional: `max_tokens`, `timeout_ms`, `mode` (`draft_only` or `draft_then_refine`), `agent` (local agent id/slug or `model:<name>` to force an Ollama model; raw model names from `docdexd delegation agents` are also accepted). Use `general_question` for lightweight Q&A and the existing code-oriented task types for code writing/editing.
104
+ Required fields: `task_type`, `instruction`, `context`. Optional: `max_tokens`, `timeout_ms`, `mode` (`draft_only` or `draft_then_refine`), `agent` (local agent id/slug or `model:<name>` to force an Ollama model; raw model names from `docdexd delegation agents` are also accepted). Use `general_question` for lightweight Q&A and the existing code-oriented task types for code writing/editing. Lane-specific defaults come from `[llm.delegation.code]` for code-oriented task types and `[llm.delegation.general]` for `general_question`; flat `local_agent_id` / `cloud_agent_id` / `primary_agent_id` remain compatibility fallbacks when lane-specific values are unset. This allows a coder-focused local agent for code work, a more general local agent for Q&A, and optional cloud fallbacks for each lane.
103
105
  Expensive model library: `docs/expensive_models.json` (match by `agent_id`, `agent_slug`, `model`, or adapter type; case-insensitive).
106
+ If `[llm.delegation.cloud].enabled = true` and `[integrations.mswarm].api_key` is set, Docdex discovers managed cloud fallbacks with `mcoda cloud agent list --json` and materializes them as `mswarm-cloud-<remote-slug>` mcoda agents. Use `[llm.delegation.code].cloud_agent_id` / `[llm.delegation.general].cloud_agent_id` to pin the preferred cloud fallback for each lane.
104
107
  To choose a local target, run `docdexd delegation agents` (or `--json`) and prefer:
105
108
  - `code_writer` for scaffolding/boilerplate/docstrings.
106
109
  - `code_reviewer` for tests/format/refactors.
@@ -109,14 +112,16 @@ For mcoda agents, also consider:
109
112
  - `max_complexity`: do not assign tasks above this ceiling.
110
113
  - `rating`: prefer higher-rated agents for reliability.
111
114
  - `cost_per_million`: USD per 1M tokens; prefer lower cost when ratings/complexity match.
112
- - Automatic local target selection must exclude mcoda agents that are paid (`cost_per_million > 0`) or otherwise matched by `docs/expensive_models.json`, unless the user explicitly overrides the target.
115
+ - Automatic target selection prefers healthy local Ollama models and local mcoda agents first. Managed `mswarm-cloud-*` agents are only considered after local candidates, or when the user/config explicitly prefers a cloud fallback.
116
+ - Automatic target selection excludes paid mcoda candidates unless they are cheaper than the effective caller/primary model. Explicit per-request `agent` overrides remain hard overrides.
113
117
  - `usage`: best-fit role (for example `code_writer` or `code_reviewer`); use this for quick matching.
114
118
  - `reasoning_rating`: reasoning score out of 10; prefer higher for complex reasoning tasks.
115
119
  - `health_status`: only use agents marked `healthy` (treat `-` as unknown).
116
- - Docdex refreshes mcoda inventory via `mcoda agent list --json --refresh-health`; it retries with legacy `mcoda agent list --json` if the refresh flag is unavailable.
120
+ - For setup/ops, inspect cloud candidates with `mcoda cloud agent list --json --provider openrouter --limit ... --max-cost-per-1m-token ... --sorted-by-catalog-rating --min-context ... --min-reasoning ...`.
121
+ - Docdex refreshes mcoda inventory via `mcoda agent list --json --refresh-health`; it retries with legacy `mcoda agent list --json` if the refresh flag is unavailable. That refresh also updates `agent_usage_limits`, so managed cloud agents with exhausted quota appear as `limited` and are skipped until reset.
117
122
  - Supported mcoda local CLI adapters include `claude-cli` in addition to `codex-cli`/`gemini-cli`/`openai-cli`/`ollama-cli`.
118
123
  Table output shows `USAGE`, `COMPLEXITY`, `RATING`, `REASON`, `COST/$1M`, and `HEALTH` for mcoda agents (`-` means unknown).
119
- - When `llm.delegation.re_evaluate = true` (default), Docdex reviews successful local mcoda runs using the primary agent when available and writes updated ratings to `~/.mcoda/mcoda.db` (disable with `DOCDEX_DELEGATION_REEVALUATE=0`).
124
+ - When `llm.delegation.re_evaluate = true` (default), Docdex reviews successful mcoda delegation runs, including managed cloud agents, using the primary agent when available and writes updated ratings to `~/.mcoda/mcoda.db` (disable with `DOCDEX_DELEGATION_REEVALUATE=0`).
120
125
  Use `agent: model:<ollama-model>` to force a specific local model (for example, `model:phi3.5:3.8b`).
121
126
  Avoid entries that only advertise `embedding` or `vision`.
122
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docdex",
3
- "version": "0.2.55",
3
+ "version": "0.2.57",
4
4
  "mcpName": "io.github.bekirdag/docdex",
5
5
  "description": "Local-first documentation and code indexer with HTTP/MCP search, AST, and agent memory.",
6
6
  "bin": {