lific 2.4.0

Local-first, lightweight issue tracker. Single binary, SQLite-backed, MCP-native.
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
use rmcp::schemars;
use schemars::JsonSchema;
use serde::Deserialize;

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct SearchInput {
    #[schemars(description = "Text to search for across issues, pages, and comments")]
    pub query: String,
    #[schemars(description = "Filter to a specific project (e.g. LIF)")]
    pub project: Option<String>,
    #[schemars(description = "Restrict results to one type: issue, page, or comment")]
    pub result_type: Option<String>,
    #[schemars(
        description = "Sort mode: relevance (default, best match first) or recent (most recently updated first)"
    )]
    pub sort: Option<String>,
    #[schemars(
        description = "Match mode: 'fts' (default, tokenized with prefix matching) or 'literal' (case-insensitive substring, for punctuation-heavy needles that FTS tokenizes away)."
    )]
    pub mode: Option<String>,
    #[schemars(description = "Max results (default 20)")]
    pub limit: Option<i64>,
    #[schemars(description = "Zero-indexed offset for paging")]
    pub offset: Option<i64>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct ListIssuesInput {
    #[schemars(description = "Project ID (e.g. LIF)")]
    pub project: String,
    #[schemars(description = "Filter by status: backlog, todo, active, done, cancelled")]
    pub status: Option<String>,
    #[schemars(description = "Filter by priority: urgent, high, medium, low, none")]
    pub priority: Option<String>,
    #[schemars(description = "Filter by module name")]
    pub module: Option<String>,
    #[schemars(description = "Filter by label name")]
    pub label: Option<String>,
    #[schemars(description = "Only return issues with no unresolved blockers")]
    pub workable: Option<bool>,
    #[schemars(description = "Return issues with at least one blocker.")]
    pub blocked: Option<bool>,
    #[schemars(description = "Created at/after ISO date or datetime (e.g. 2026-06-01)")]
    pub created_since: Option<String>,
    #[schemars(description = "Created before ISO date or datetime (exclusive)")]
    pub created_until: Option<String>,
    #[schemars(description = "Updated at/after ISO date or datetime.")]
    pub updated_since: Option<String>,
    #[schemars(description = "Updated before ISO date or datetime (exclusive)")]
    pub updated_until: Option<String>,
    #[schemars(
        description = "Sort Order: sort_order (default), sequence, created, updated, priority"
    )]
    pub order_by: Option<String>,
    #[schemars(description = "Sort direction: asc (default) or desc")]
    pub order: Option<String>,
    #[schemars(description = "Max results (default 50)")]
    pub limit: Option<i64>,
    #[schemars(description = "Zero-indexed offset for paging")]
    pub offset: Option<i64>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct GetIssueInput {
    #[schemars(description = "Issue ID like PRO-42 or ADA-7")]
    pub identifier: String,
    #[schemars(description = "Comment trail: 'recent' (default, last 3), 'all', or 'none'.")]
    pub include_comments: Option<String>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct GetActivityInput {
    #[schemars(description = "Issue ID (PRO-42), page ID (PRO-DOC-3), or bare project ID (PRO)")]
    pub identifier: String,
    #[schemars(description = "Max entries (default 30, cap 200)")]
    pub limit: Option<i64>,
    #[schemars(description = "Zero-indexed offset for paging")]
    pub offset: Option<i64>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct CreateIssueInput {
    #[schemars(description = "Project ID (e.g. LIF)")]
    pub project: String,
    #[schemars(description = "Issue title")]
    pub title: String,
    #[schemars(description = "Markdown description")]
    pub description: Option<String>,
    #[schemars(description = "Status: backlog, todo, active, done, cancelled (default: backlog)")]
    pub status: Option<String>,
    #[schemars(description = "Priority: urgent, high, medium, low, none (default: none)")]
    pub priority: Option<String>,
    #[schemars(description = "Module name to assign to")]
    pub module: Option<String>,
    #[schemars(description = "Label names to attach")]
    pub labels: Option<Vec<String>>,
    #[schemars(description = "Start date (ISO 8601 date, e.g. 2026-06-01)")]
    pub start_date: Option<String>,
    #[schemars(description = "Target/due date (ISO 8601 date, e.g. 2026-06-15)")]
    pub target_date: Option<String>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct UpdateIssueInput {
    #[schemars(description = "Issue ID like PRO-42")]
    pub identifier: String,
    #[schemars(description = "New title")]
    pub title: Option<String>,
    #[schemars(description = "New description (markdown)")]
    pub description: Option<String>,
    #[schemars(description = "New status: backlog, todo, active, done, cancelled")]
    pub status: Option<String>,
    #[schemars(description = "New priority: urgent, high, medium, low, none")]
    pub priority: Option<String>,
    #[schemars(
        description = "New module name. Omit to leave unchanged; pass an empty string \"\" to unassign."
    )]
    pub module: Option<String>,
    #[schemars(description = "Replace labels")]
    pub labels: Option<Vec<String>>,
    #[schemars(description = "New start date (ISO 8601 date, e.g. 2026-06-01)")]
    pub start_date: Option<String>,
    #[schemars(description = "New target/due date (ISO 8601 date, e.g. 2026-06-15)")]
    pub target_date: Option<String>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct BulkUpdateInput {
    #[schemars(description = "Project ID (e.g. LIF)")]
    pub project: String,
    // ── Filter (which issues to change; mirrors list_issues) ──
    #[schemars(
        description = "Only affect issues with this status: backlog, todo, active, done, cancelled"
    )]
    pub filter_status: Option<String>,
    #[schemars(
        description = "Only affect issues with this priority: urgent, high, medium, low, none"
    )]
    pub filter_priority: Option<String>,
    #[schemars(description = "Only affect issues in this module (by name)")]
    pub filter_module: Option<String>,
    #[schemars(description = "Only affect issues carrying this label (by name)")]
    pub filter_label: Option<String>,
    // ── Target (fields to set on every matching issue) ──
    #[schemars(description = "New status to set: backlog, todo, active, done, cancelled")]
    pub set_status: Option<String>,
    #[schemars(description = "New priority to set: urgent, high, medium, low, none")]
    pub set_priority: Option<String>,
    #[schemars(description = "New module (by name) to set")]
    pub set_module: Option<String>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct GetBoardInput {
    #[schemars(description = "Project ID (e.g. LIF)")]
    pub project: String,
    #[schemars(description = "Group by: status, priority, or module (default: status)")]
    pub group_by: Option<String>,
    #[schemars(
        description = "Include done and cancelled issues (default false). By default closed columns appear as count-only stubs."
    )]
    pub include_closed: Option<bool>,
    #[schemars(description = "Cap issues rendered per column; output notes the remainder")]
    pub max_per_column: Option<i64>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct LinkIssuesInput {
    #[schemars(description = "Source issue ID (e.g. PRO-1)")]
    pub source: String,
    #[schemars(description = "Target issue ID (e.g. PRO-2)")]
    pub target: String,
    #[schemars(description = "Relation type: blocks, relates_to, or duplicate")]
    pub relation_type: String,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct UnlinkIssuesInput {
    #[schemars(description = "First issue ID")]
    pub source: String,
    #[schemars(description = "Second issue ID")]
    pub target: String,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct GetPageInput {
    #[schemars(description = "Page ID like LIF-DOC-1")]
    pub identifier: String,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct CreatePageInput {
    #[schemars(description = "Project ID (e.g. LIF). Omit for workspace-level page.")]
    pub project: Option<String>,
    #[schemars(description = "Page title")]
    pub title: String,
    #[schemars(description = "Markdown content")]
    pub content: Option<String>,
    #[schemars(description = "Folder name to place page in")]
    pub folder: Option<String>,
    #[schemars(description = "Status: draft, active, complete, archived")]
    pub status: Option<String>,
    #[schemars(
        description = "Label names to attach (project-scoped; ignored on workspace pages)"
    )]
    pub labels: Option<Vec<String>>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct UpdatePageInput {
    #[schemars(description = "Page ID like LIF-DOC-1")]
    pub identifier: String,
    #[schemars(description = "New title")]
    pub title: Option<String>,
    #[schemars(description = "New markdown content")]
    pub content: Option<String>,
    #[schemars(
        description = "Move to folder name. Omit to leave unchanged; pass an empty string \"\" for project root."
    )]
    pub folder: Option<String>,
    #[schemars(description = "Status: draft, active, complete, archived")]
    pub status: Option<String>,
    #[schemars(description = "Pin (true) or unpin (false) the page to the top of the page list.")]
    pub pinned: Option<bool>,
    #[schemars(description = "Replace labels; [] clears all (project-scoped)")]
    pub labels: Option<Vec<String>>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct EditIssueInput {
    #[schemars(description = "Issue ID like PRO-42")]
    pub identifier: String,
    #[schemars(description = "Exact string to find. Must be unique unless replace_all is true.")]
    pub old_string: String,
    #[schemars(description = "Replacement string (must differ from old_string)")]
    pub new_string: String,
    #[schemars(description = "Field to edit: 'description' (default) or 'title'")]
    pub field: Option<String>,
    #[schemars(description = "Replace all occurrences (default false)")]
    pub replace_all: Option<bool>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct EditPageInput {
    #[schemars(description = "Page ID like LIF-DOC-1")]
    pub identifier: String,
    #[schemars(description = "Exact string to find. Must be unique unless replace_all is true.")]
    pub old_string: String,
    #[schemars(description = "Replacement string (must differ from old_string)")]
    pub new_string: String,
    #[schemars(description = "Field to edit: 'content' (default) or 'title'")]
    pub field: Option<String>,
    #[schemars(description = "Replace all occurrences (default false)")]
    pub replace_all: Option<bool>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct DeleteInput {
    #[schemars(
        description = "Type of thing to delete: issue, page, plan, project, module, label, or folder"
    )]
    pub resource_type: String,
    #[schemars(
        description = "ID or name (e.g. LIF-1, LIF-DOC-1, LIF for projects, or name for modules/labels/folders)"
    )]
    pub identifier: String,
    #[schemars(description = "Project ID (required for deleting module/label/folder by name)")]
    pub project: Option<String>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct ListResourcesInput {
    #[schemars(description = "Resource type: project, module, label, folder, page, issue, or plan")]
    pub resource_type: String,
    #[schemars(description = "Project ID (required for issues, plans, modules, labels, and folders; optional for pages and projects)")]
    pub project: Option<String>,
    #[schemars(description = "Folder name (for pages)")]
    pub folder: Option<String>,
    #[schemars(description = "Label name (for issues or pages)")]
    pub label: Option<String>,
    #[schemars(
        description = "Status filter for pages (draft, active, complete, archived) or plans"
    )]
    pub status: Option<String>,
    #[schemars(
        description = "Sort column (for page lists): sort_order (default), title, status, created, or updated"
    )]
    pub order_by: Option<String>,
    #[schemars(description = "Sort direction (for page lists): asc (default) or desc")]
    pub order: Option<String>,
    #[schemars(description = "Max results (plans default to 50 and cap at 500; issues and pages default to 100; other lists ignore this field)")]
    pub limit: Option<i64>,
    #[schemars(description = "Zero-indexed offset for issue, page, or plan paging")]
    pub offset: Option<i64>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct ManageResourceInput {
    #[schemars(description = "Resource type: project, module, label, or folder")]
    pub resource_type: String,
    #[schemars(description = "Action: create or update")]
    pub action: String,
    #[schemars(
        description = "Required for module, label, or folder updates; projects use `project` instead"
    )]
    pub current_name: Option<String>,
    #[schemars(
        description = "Project ID (e.g. LIF), required for module/label/folder operations and for project updates"
    )]
    pub project: Option<String>,
    #[schemars(description = "Name (required when creating a project, module, label, or folder)")]
    pub name: Option<String>,
    #[schemars(description = "Identifier (required for project create, e.g. PRO)")]
    pub identifier: Option<String>,
    #[schemars(description = "Description")]
    pub description: Option<String>,
    #[schemars(
        description = "Status (for module: backlog, planned, active, paused, done, cancelled)"
    )]
    pub status: Option<String>,
    #[schemars(description = "Color hex (for label, e.g. #EF4444)")]
    pub color: Option<String>,
    #[schemars(
        description = "Icon for project or module: 'lucide:<Name>' or a literal emoji. Omit to leave unchanged; pass an empty string \"\" to clear."
    )]
    pub emoji: Option<String>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct AddCommentInput {
    #[schemars(description = "Issue ID (e.g. LIF-1), project page ID (e.g. LIF-DOC-1), or workspace page ID (e.g. DOC-1)")]
    pub identifier: String,
    #[schemars(description = "Comment content (markdown)")]
    pub content: String,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct ListCommentsInput {
    #[schemars(description = "Issue ID (e.g. LIF-1), project page ID (e.g. LIF-DOC-1), or workspace page ID (e.g. DOC-1)")]
    pub identifier: String,
    #[schemars(description = "Filter to comments by this author username")]
    pub author: Option<String>,
    #[schemars(
        description = "Sort direction by creation time: asc (default, oldest first) or desc (newest first)"
    )]
    pub order: Option<String>,
    #[schemars(
        description = "Optional maximum comments to return (cap 500). Omit to return the full thread."
    )]
    pub limit: Option<i64>,
    #[schemars(description = "Zero-indexed offset for paging")]
    pub offset: Option<i64>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct EditCommentInput {
    #[schemars(description = "Comment id (from add_comment or list_comments)")]
    pub comment_id: i64,
    #[schemars(description = "New comment content (markdown)")]
    pub content: String,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct DeleteCommentInput {
    #[schemars(description = "Comment id (from add_comment or list_comments)")]
    pub comment_id: i64,
}

// ── Plans (LIF-168/169/170/171) ──────────────────────────────

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct PlanStepInput {
    #[schemars(description = "Step title, short and imperative")]
    pub title: String,
    #[schemars(description = "Optional longer notes/description for this step")]
    pub description: Option<String>,
    #[schemars(description = "Issue ID this step mirrors (e.g. LIF-42)")]
    pub issue: Option<String>,
    #[schemars(description = "Pre-mark this step done (default false)")]
    pub done: Option<bool>,
    #[schemars(description = "Nested child steps (any depth)")]
    pub steps: Option<Vec<PlanStepInput>>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct CreatePlanInput {
    #[schemars(description = "Project ID (e.g. LIF)")]
    pub project: String,
    #[schemars(description = "Plan title")]
    pub title: String,
    #[schemars(
        description = "Optional anchor issue (e.g. LIF-42). Closing it auto-archives the plan."
    )]
    pub anchor_issue: Option<String>,
    #[schemars(
        description = "Full nested step tree. Each step: {title, description?, issue?, done?, steps?[]}"
    )]
    pub steps: Option<Vec<PlanStepInput>>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct GetPlanInput {
    #[schemars(description = "Plan ID like LIF-PLAN-3")]
    pub plan: String,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct EditPlanStepInput {
    #[schemars(description = "Plan ID like LIF-PLAN-3")]
    pub plan: String,
    #[schemars(description = "Numeric step id (the #N shown by get_plan)")]
    pub step_id: i64,
    #[schemars(description = "Exact string to find. Must be unique unless replace_all is true.")]
    pub old_string: String,
    #[schemars(description = "Replacement string")]
    pub new_string: String,
    #[schemars(description = "Field to edit: 'description' (default) or 'title'")]
    pub field: Option<String>,
    #[schemars(description = "Replace all occurrences (default false)")]
    pub replace_all: Option<bool>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct UpdatePlanStepInput {
    #[schemars(description = "Plan ID like LIF-PLAN-3")]
    pub plan: String,
    #[schemars(
        description = "Step ID to operate on (#N from get_plan). OMIT operates on the plan itself."
    )]
    pub step_id: Option<i64>,
    #[schemars(description = "New title for the target")]
    pub title: Option<String>,
    // ── Plan-level (step_id omitted) ──
    #[schemars(description = "Plan status: active done or archived")]
    pub status: Option<String>,
    #[schemars(description = "Set the plan's anchor issue")]
    pub anchor_issue: Option<String>,
    #[schemars(description = "Clear the plan's anchor issue")]
    pub clear_anchor: Option<bool>,
    // ── Step-level (step_id set) ──
    #[schemars(description = "Mark the step done/undone (a linked issue syncs)")]
    pub done: Option<bool>,
    #[schemars(description = "Attach an issue (e.g. LIF-42) to the step")]
    pub attach_issue: Option<String>,
    #[schemars(description = "Detach the step's issue reference")]
    pub detach_issue: Option<bool>,
    #[schemars(description = "Add a child step with this title under the target step")]
    pub add_child_title: Option<String>,
    #[schemars(description = "Description for the added child step")]
    pub add_child_description: Option<String>,
    #[schemars(description = "Issue ID for the added child step")]
    pub add_child_issue: Option<String>,
    #[schemars(description = "Reparent the step under this step id")]
    pub move_parent_step_id: Option<i64>,
    #[schemars(description = "Reparent the step to the plan root")]
    pub move_to_root: Option<bool>,
    #[schemars(description = "New position among siblings (0-based)")]
    pub move_position: Option<i64>,
    #[schemars(description = "Delete the step and its subtree")]
    pub delete: Option<bool>,
    #[schemars(description = "Return the full re-rendered tree instead of the delta (default false)")]
    pub echo_tree: Option<bool>,
}

#[derive(Debug, Default, Deserialize, JsonSchema)]
pub struct ExportInput {
    #[schemars(
        description = "What to export: an issue ID (PRO-42), a page ID (PRO-DOC-3), or a bare project ID (PRO) for the whole project"
    )]
    pub identifier: String,
}