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
67
68
69
70
71
72
73
//! Injection-context assembly — structured data for the SessionStart and
//! PreCompact hooks.
//!
//! These types carry the *data* the hook needs; they contain no markdown. The
//! daemon (`kindling-server`) owns the byte-for-byte markdown formatting (so the
//! `toLocaleString`-equivalent date logic lives in exactly one place). This
//! split keeps the service deterministic and trivially testable, and keeps the
//! formatting parity surface contained to one server module.
//!
//! Mirrors the queries performed inline by the Node hooks in
//! `plugins/kindling-claude-code/hooks/{session-start,pre-compact}.js`.
use ;
/// A pin resolved to its target's content, for injection previews.
///
/// `note` is the pin's reason (Node: `pin.note`); `content` is the *target*
/// observation/summary content the pin points at (Node: `pin.content`, which
/// the TS `listActivePins` join hydrates). Either may be absent: a pin can have
/// no reason, and its target may have been redacted or deleted.
/// Structured data backing the SessionStart injection.
///
/// Built by [`KindlingService::session_start_context`](crate::KindlingService::session_start_context).
/// The server formats `pins` under a `## Pinned Items` heading and `recent`
/// under `## Recent Activity`, then prepends the Prior-Context header.
/// Structured data backing the PreCompact injection.
///
/// Built by [`KindlingService::pre_compact_context`](crate::KindlingService::pre_compact_context).
/// The server formats `pins` under `## Pinned Items (preserve across
/// compaction)` and the summary under `## Session Summary` (no top-level
/// header).