docdex 0.2.45 → 0.2.47

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.47
4
+ - Bump release metadata to 0.2.47.
5
+
6
+ ## 0.2.46
7
+ - Bump release metadata to 0.2.46.
8
+
3
9
  ## 0.2.45
4
10
  - Update packaged agent docs with FD-hardening guidance and bump release metadata to 0.2.45.
5
11
 
package/assets/agents.md CHANGED
@@ -1,4 +1,4 @@
1
- ---- START OF DOCDEX INFO V0.2.45 ----
1
+ ---- START OF DOCDEX INFO V0.2.47 ----
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`).
@@ -112,6 +112,8 @@ For mcoda agents, also consider:
112
112
  - `usage`: best-fit role (for example `code_writer` or `code_reviewer`); use this for quick matching.
113
113
  - `reasoning_rating`: reasoning score out of 10; prefer higher for complex reasoning tasks.
114
114
  - `health_status`: only use agents marked `healthy` (treat `-` as unknown).
115
+ - 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.
116
+ - Supported mcoda local CLI adapters include `claude-cli` in addition to `codex-cli`/`gemini-cli`/`openai-cli`/`ollama-cli`.
115
117
  Table output shows `USAGE`, `COMPLEXITY`, `RATING`, `REASON`, `COST/$1M`, and `HEALTH` for mcoda agents (`-` means unknown).
116
118
  - 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`).
117
119
  Use `agent: model:<ollama-model>` to force a specific local model (for example, `model:phi3.5:3.8b`).
@@ -165,6 +167,7 @@ Use these only when MCP tools cannot be called (e.g., blocked sandbox networking
165
167
  - `docdexd search --repo <path> --query "<q>"`: /search equivalent (HTTP/local).
166
168
  - `docdexd delegation savings`: delegation telemetry (JSON: offloaded count, local/primary tokens & costs, savings).
167
169
  - `docdexd delegation agents --json`: list local delegation targets and capabilities (mcoda agents include `max_complexity`, `rating`, `cost_per_million`, `usage`, `reasoning_rating`, `health_status`).
170
+ - `mcoda agent list --json --refresh-health`: preferred machine-consumer inventory command for fresh health; fallback to plain `--json` for older mcoda versions.
168
171
  - `docdexd open --repo <path> --file <rel>`: safe file slice read (head/start/end/clamp).
169
172
  - `docdexd file ensure-newline|write --repo <path> --file <rel>`: minimal file edits.
170
173
  - `docdexd test run-node --repo <path> --file <rel> --args "..."`: run Node scripts.
@@ -226,6 +229,7 @@ Common params:
226
229
  Notes:
227
230
  - `skip_local_search=true` effectively forces web discovery (Tier 2).
228
231
  - If DOCDEX_WEB_ENABLED=1, web discovery can be slow; plan timeouts accordingly.
232
+ - Responses include `meta.dag_session_id`; pass it to `/v1/dag/export` or `docdex_dag_export` to export the same trace.
229
233
 
230
234
  ### 3a) Capabilities (HTTP)
231
235
 
@@ -2475,8 +2475,27 @@ function registerStartup({ binaryPath, port, repoRoot, logger, distBaseDir, star
2475
2475
  return { ok: false, reason: "unsupported_platform" };
2476
2476
  }
2477
2477
 
2478
- async function startDaemonWithHealthCheck({ binaryPath, port, host, logger, distBaseDir, startNow = true }) {
2479
- const startup = registerStartup({
2478
+ async function startDaemonWithHealthCheck({
2479
+ binaryPath,
2480
+ port,
2481
+ host,
2482
+ logger,
2483
+ distBaseDir,
2484
+ startNow = true,
2485
+ deps
2486
+ }) {
2487
+ const helpers = {
2488
+ registerStartup,
2489
+ waitForDaemonHealthy,
2490
+ stopDaemonService,
2491
+ stopDaemonFromLock,
2492
+ stopDaemonByName,
2493
+ clearDaemonLocks
2494
+ };
2495
+ if (deps && typeof deps === "object") {
2496
+ Object.assign(helpers, deps);
2497
+ }
2498
+ const startup = helpers.registerStartup({
2480
2499
  binaryPath,
2481
2500
  port,
2482
2501
  repoRoot: daemonRootPath(),
@@ -2491,16 +2510,18 @@ async function startDaemonWithHealthCheck({ binaryPath, port, host, logger, dist
2491
2510
  if (!startNow) {
2492
2511
  return { ok: true, reason: "registered" };
2493
2512
  }
2494
- startDaemonService({ logger });
2495
- const healthy = await waitForDaemonHealthy({ host, port });
2513
+ // `registerStartup(..., startNow: true)` already starts the service on all
2514
+ // supported platforms. Starting it again here can interrupt the first boot
2515
+ // and leave the daemon stuck behind its own lock file.
2516
+ const healthy = await helpers.waitForDaemonHealthy({ host, port });
2496
2517
  if (healthy) {
2497
2518
  return { ok: true, reason: "healthy" };
2498
2519
  }
2499
2520
  logger?.warn?.(`[docdex] daemon failed health check on ${host}:${port}`);
2500
- stopDaemonService({ logger });
2501
- stopDaemonFromLock({ logger });
2502
- stopDaemonByName({ logger });
2503
- clearDaemonLocks();
2521
+ helpers.stopDaemonService({ logger });
2522
+ helpers.stopDaemonFromLock({ logger });
2523
+ helpers.stopDaemonByName({ logger });
2524
+ helpers.clearDaemonLocks();
2504
2525
  return { ok: false, reason: "health_failed" };
2505
2526
  }
2506
2527
 
@@ -2858,6 +2879,7 @@ module.exports = {
2858
2879
  applyAgentInstructions,
2859
2880
  buildDaemonEnv,
2860
2881
  buildLaunchAgentPlist,
2882
+ startDaemonWithHealthCheck,
2861
2883
  resolveDaemonPortState,
2862
2884
  normalizeVersion
2863
2885
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docdex",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
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": {