1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) 2026 Kirky.X. All rights reserved.
// SPDX-License-Identifier: MIT
//! DaemonRunner capability trait (T6/unified-architecture Phase 2, Task 2.11).
//!
//! Defines [`DaemonRunner`], the capability trait object stored in
//! [`Kit`](crate::kit::Kit) under [`DaemonKey`](crate::kit::DaemonKey) when
//! the `daemon` feature is enabled. The concrete impl (Task 2.11) wraps the
//! existing [`Daemon`] + [`IndexObserver`] (Observer pattern) so that the
//! unified Kit can hand a pre-configured daemon handle to `daemon_cmd::run`
//! instead of having the CLI construct subsystems ad-hoc.
//!
//! # Blocking semantics
//!
//! [`DaemonRunner::start`] is **blocking** — it enters the daemon event loop
//! and returns only when the daemon stops (user interrupt, watcher error, or
//! channel disconnect). This mirrors the existing [`Daemon::run`] semantics.
//! Callers that need non-blocking behavior should spawn a thread.
//!
//! [`Daemon`]: super::Daemon
//! [`IndexObserver`]: super::IndexObserver
//! [`Daemon::run`]: super::Daemon::run
use Path;
use DaemonError;
/// Capability trait for the Daemon subsystem (file-watcher + incremental
/// indexing).
///
/// Stored in [`Kit`](crate::kit::Kit) as `Arc<dyn DaemonRunner>` under
/// [`DaemonKey`](crate::kit::DaemonKey) when the `daemon` feature is enabled.
/// Conceptually requires `StorageKey` + `IndexerKey`; the concrete impl
/// (Task 2.11) is self-contained — it opens its own [`IndexFacade`] from the
/// supplied `db_path` and constructs a fresh [`Daemon`] per `start` call.
/// Therefore `Requirements = NoRequirements` at the type level; the bootstrap
/// (Task 2.13) enforces build ordering (Storage → ... → Indexer → Daemon).
///
/// [`IndexFacade`]: crate::index::IndexFacade
/// [`Daemon`]: super::Daemon
/// Compile-time assertion that `DaemonRunner` is object-safe and `Send + Sync`.
const _: = ;